Files
memos.nvim/doc/memos.nvim.txt
2025-11-29 14:36:40 +08:00

157 lines
5.3 KiB
Plaintext

*memos.nvim.txt* For Neovim | English and 简体中文
==============================================================================
CONTENTS *memos.nvim-contents*
1. About....................................|memos-about|
2. Features.................................|memos-features|
3. Installation.............................|memos-installation|
4. Usage....................................|memos-usage|
5. Configuration............................|memos-configuration|
==============================================================================
1. About *memos-about*
A Neovim plugin to interact with Memos (https://github.com/usememos/memos)
right inside the editor. List, create, edit, and delete your memos without
leaving Neovim.
一个 Neovim 插件,让你在编辑器内部直接与 Memos 进行交互。无需离开 Neovim
即可列表、创建、编辑和删除你的 memos。
==============================================================================
2. Features *memos-features*
- *List Memos*: View, search, and paginate through your memos in a floating
window.
- *Create & Edit*: Create new memos or edit existing ones in a dedicated
buffer with `markdown` filetype support.
- *Delete Memos*: Delete memos directly from the list.
- *Customizable*: Configure API endpoints, keymaps, and more.
- *First-time Setup*: On first launch, you will be prompted to enter your Memos host and token. You can choose to save these permanently.
==============================================================================
3. Installation *memos-installation*
Requires |plenary.nvim|.
Install with |lazy.nvim|:
>lua
-- lua/plugins/memos.lua
require("memos").setup({
-- Number of memos to fetch per page
pageSize = 50,
auto_save = false,
-- Window configuration
window = {
enable_float = false, -- Set to true to open the list in a floating window
width = 0.85, -- Width ratio (0.0 to 1.0)
height = 0.85, -- Height ratio (0.0 to 1.0)
border = "rounded", -- Border style: "single", "double", "rounded", "solid", "shadow"
},
-- Set to false or nil to disable a keymap
keymaps = {
-- Keymap to open the memos list. Default: <leader>mm
start_memos = "<leader>mm",
-- Keymaps for the memo list window
list = {
add_memo = "a",
delete_memo = "d",
delete_memo_visual = "dd",
edit_memo = "<CR>",
vsplit_edit_memo = "<Tab>",
search_memos = "s",
refresh_list = "r",
next_page = ".",
quit = "q",
},
-- Keymaps for the editing/creating buffer
buffer = {
save = "<leader>ms",
},
},
})
<
==============================================================================
4. Usage *memos-usage*
COMMANDS *memos-commands*
*:Memos*
Opens a floating window to list and search your memos.
*:MemosCreate*
Opens a new buffer to create a new memo.
*:MemosSave*
(Available in the memo buffer) Saves the memo you are currently
creating or editing.
DEFAULT KEYMAPS *memos-keymaps*
*Global Keymap:*
| Key | Action |
|--------------------|--------------------------------------|
| `<leader>mm` | Open the Memos list |
*In the Memo List Window:*
| Key | Action |
|--------------------|--------------------------------------|
| `a` | Add a new memo |
| `d` or `dd` | Delete the selected memo |
| `<CR>` | Edit the selected memo |
| `<Tab>` | Edit the selected memo in a vsplit |
| `s` | Search your memos |
| `r` | Refresh the memo list |
| `.` | Load the next page of memos |
| `q` | Quit the list window |
*In the Edit/Create Buffer:*
| Key | Action |
|--------------------|--------------------------------------|
| `<leader>ms` | Save the current memo |
==============================================================================
5. Configuration *memos-configuration*
You can override the default settings by passing a table to the `setup()`
function.
Default configuration:
>lua
-- lua/plugins/memos.lua
require("memos").setup({
auto_save = false,
-- Number of memos to fetch per page
pageSize = 50,
-- Set to false or nil to disable a keymap
keymaps = {
-- Keymap to open the memos list. Default: <leader>mm
start_memos = "<leader>mm",
-- Keymaps for the memo list window
list = {
add_memo = "a",
delete_memo = "d",
delete_memo_visual = "dd",
edit_memo = "<CR>",
vsplit_edit_memo = "<Tab>",
search_memos = "s",
refresh_list = "r",
next_page = ".",
quit = "q",
},
-- Keymaps for the editing/creating buffer
buffer = {
save = "<leader>ms",
-- Back to list from a memo
back_to_list = '<Esc>'
},
},
})
<
vim:tw=78:ts=8:ft=help:norl: