A Neovim plugin that merges navigation features (like those in arrow.nvim and harpoon) with note-taking capabilities
Navigating through project files and understanding them by taking notes is a crucial task for developers. While there are many tools available for navigation, such as arrow.nvim and harpoon, they often lack integrated note-taking capabilities aligned with navigation.
navigate-note.nvim
aims to bridge this gap.
navigate-note.nvim
creates a nav.md
note in your project's root directory. This allows you to take notes and add links to files, facilitating navigation between them. By interleaving notes and file links, navigate-note
aligns navigation with your understanding of the project.
-- Lazy.nvim
{
"you-n-g/navigate-note.nvim",
config=true,
}
For other configurations, please refer to more test configs.
Nav Mode
<m-h>
: Switch to the nav.md
file, your main hub for notes and navigation. If you're already in nav.md
, it takes you back to the last file you were on.<m-p>
: Add the current file and line to nav.md
. This is great for bookmarking important code sections.<m-cr>
: Open the file and line under the cursor in nav.md
.Tab Jumping and Preview
<tab>
: Move to the next file:line
in nav.md
.<s-tab>
: Move to the previous file:line
.<tab>
.Fast Navigating
<numbers>
: Jump to the i-th "file:line" entry.Peeking Mode
<c-a>
and <c-x>
to change the line number in the preview.Jump Mode
file:line
with <m-l>
.-- Lazy.nvim
{
"you-n-g/navigate-note.nvim",
opts = {
filename = "nav.md", -- The filename of the markdown.
width = 0.6, -- The width of the popup window when jumping in the file with <tab>.
keymaps = {
nav_mode = {
-- Navigation & Jumping
next = "<tab>",
prev = "<s-tab>",
open = "<m-cr>",
switch_back = "<m-h>", -- Switch back to the previous file from `nav.md`.
-- Editing
append_link = "<m-p>", -- (P)aste will more align with the meaning.
-- Mode switching
jump_mode = "<m-l>", -- When we jump to a file, jump to the file only or jump to the exact file:line.
},
add = "<localleader>na",
open_nav = "<m-h>", -- Switch to `nav.md`.
},
link_surround = { -- sometime you may want to change the link format in case of conflict with other formatting conversion.
left = "[[", -- The left delimiter for links.
right = "]]" -- The right delimiter for links.
},
context_line_count = { -- It would be a total of `2 * context_line_count - 1` lines.
tab = 8,
vline = 2,
},
}
}
More detailed configuration are listed here. You can find my latest and preferred configuration here as an example.
nav.md
will not enter nav modeContributions to this project are welcome.
You can test the plugin in UI with minimal config with
If you prefer to run tests without a user interface, you can execute make test
to initiate the test suite.