A sticky note bookmarks plugin for Neovim with git branch awareness. Place sticky notes (fusen - ไป็ฎ in Japanese) in your code and keep them organized across different git branches.
{
"walkersumida/fusen.nvim",
event = "VimEnter",
opts = {},
}
For custom save file location:
{
"walkersumida/fusen.nvim",
event = "VimEnter",
opts = {
save_file = vim.fn.expand("$HOME") .. "/my_fusen_marks.json",
}
}
use {
"walkersumida/fusen.nvim",
config = function()
require("fusen").setup()
end
}
Plug 'walkersumida/fusen.nvim'
Then add to your init.lua:
require("fusen").setup()
require("fusen").setup({
-- Storage location
save_file = vim.fn.expand("$HOME") .. "/fusen_marks.json",
-- Mark appearance
mark = {
icon = "๐",
hl_group = "FusenMark",
},
-- Key mappings
keymaps = {
add_mark = "me", -- Add/edit sticky note
clear_mark = "mc", -- Clear mark at current line
clear_buffer = "mC", -- Clear all marks in buffer
clear_all = "mD", -- Clear ALL marks (deletes entire JSON content)
next_mark = "mn", -- Jump to next mark
prev_mark = "mp", -- Jump to previous mark
list_marks = "ml", -- Show marks in quickfix
}
-- Sign column priority
sign_priority = 10,
-- Annotation display settings
annotation_display = {
mode = "float", -- "eol", "float", "both", "none"
-- Float window settings
float = {
delay = 100,
border = "rounded",
max_width = 50,
max_height = 10,
},
},
-- Exclude specific filetypes from keymaps
exclude_filetypes = {
-- "neo-tree", -- Example: neo-tree
-- "NvimTree", -- Example: nvim-tree
-- "nerdtree", -- Example: NERDTree
},
})
The annotation_display.mode
option controls how annotations are displayed:
"eol"
: Shows annotations at the end of the line (traditional mode)"float"
: Shows annotations in a floating window when cursor hovers over a marked line"both"
: Shows both end-of-line text and floating window"none"
: Hides annotations (marks only)require("fusen").setup({
annotation_display = {
mode = "float",
float = {
delay = 300, -- Show after 300ms (default: 100ms)
border = "single", -- Border style: "single", "double", "rounded", etc.
max_width = 60, -- Maximum width (default: 50)
max_height = 15, -- Maximum height (default: 10)
}
}
})
delay
: Time in milliseconds to wait after cursor stops before showing the float windowborder
: Border style for the float windowmax_width
/ max_height
: Maximum dimensions for the float windowAll default mappings start with m
prefix for consistency:
Key | Description |
---|---|
me |
Add or edit sticky note with annotation |
mc |
Clear sticky note at current line |
mC |
Clear all sticky notes in current buffer |
mD |
Clear ALL sticky notes (deletes entire JSON content) |
mn |
Jump to next sticky note |
mp |
Jump to previous sticky note |
ml |
List all sticky notes in quickfix |
Command | Description |
---|---|
:FusenAddMark |
Add or edit sticky note with annotation |
:FusenClearMark |
Clear sticky note at current line |
:FusenClearBuffer |
Clear all marks in current buffer |
:FusenClearAll |
Clear ALL marks (deletes entire JSON content) |
:FusenNext |
Jump to next mark |
:FusenPrev |
Jump to previous mark |
:FusenList |
Show all marks in quickfix list |
:FusenRefresh |
Refresh all marks display |
:FusenSave |
Manually save marks |
:FusenLoad |
Manually load marks |
:FusenInfo |
Show info about mark at current line |
:FusenBranch |
Show current git branch info |
If you have telescope.nvim installed:
-- Search through all sticky notes
:Telescope fusen marks
-- Set up a keybinding (example)
vim.keymap.set("n", "<leader>fm", ":Telescope fusen marks<CR>", { desc = "Find fusen marks" })
-- In Telescope window:
-- <CR> - Jump to mark
-- <C-d> - Delete mark
One of the unique features of fusen.nvim is its git branch awareness. When you switch git branches, your sticky notes automatically switch too!
# On main branch
git checkout main
# Your main branch sticky notes are loaded
# Switch to feature branch
git checkout feature/new-feature
# Your feature branch sticky notes are loaded
# Sticky notes are stored separately for each branch
This is especially useful when:
Configure how annotations appear in floating windows:
require("fusen").setup({
annotation_display = {
mode = "float", -- Use floating windows
float = {
delay = 300, -- Show after 300ms
border = "single", -- Border style
max_width = 60, -- Maximum width
max_height = 15, -- Maximum height
}
}
})
You can customize the appearance of marks by changing the highlight group:
require("fusen").setup({
mark = {
icon = "๐",
hl_group = "MyCustomHighlight", -- Custom highlight group
},
})
-- Define your custom highlight group
vim.api.nvim_set_hl(0, "MyCustomHighlight", {
fg = "#ff6b6b", -- Red foreground
bg = "#1e1e1e", -- Dark background
bold = true, -- Bold text
})
The hl_group
setting controls the color and style of:
By default, it uses the "Special" highlight group which typically appears in a distinct color in most colorschemes.
-- Set your own mappings
vim.keymap.set("n", "<leader>m", require("fusen").add_mark)
vim.keymap.set("n", "<leader>mc", require("fusen").clear_mark)
-- etc...
Give a โญ๏ธ if this project helped you!