Go to file
2022-07-05 15:12:22 +08:00
lua fix(marks): dont jump to everywhere ,dont edit annotation 2022-07-05 15:12:22 +08:00
.gitignore feat!: update setup,add read/write marks json 2022-07-01 16:28:09 +08:00
LICENSE Initial commit 2022-06-30 11:39:46 +08:00
README.md fix(marks): dont jump to everywhere ,dont edit annotation 2022-07-05 15:12:22 +08:00

bookmarks.nvim

A Bookmarks Plugin With Global File Store For Neovim Written In Lua.

Requirements

  • Neovim >= 0.7.0

Installation

With packer.nvim:

use {
'tomasky/bookmarks.nvim',
-- tag = 'release' -- To use the latest release
}

Usage

For basic setup with all default configs using packer.nvim

use {
  'tomasky/bookmarks.nvim',
  config = function()
    require('bookmarks').setup()
  end
}

Here is an example with most of the default settings:

require('bookmarks').setup {
  save_file = vim.fn.expand "$HOME/.bookmarks", -- bookmarks save file path
  keywords =  {
    ["@t"] = "☑️ ", -- mark annotation startswith @t ,signs this icon of todo
    ["@w"] = "⚠️ ", -- mark annotation startswith @w ,signs this icon of warn
    ["@f"] = "⛏ ", -- mark annotation startswith @f ,signs this icon of fix
    ["@n"] = " ", -- mark annotation startswith @n ,signs this icon of note
  },
  on_attach = function(bufnr)
    local bm = require "bookmarks"
    local map = vim.keymap.set
    map("n","mm",bm.bookmark_toggle) -- add or remove bookmark at current line
    map("n","mi",bm.bookmark_ann) -- add mark annotation at current line
    map("n","mc",bm.bookmark_clean) -- clean all marks in local buffer
    map("n","mn",bm.bookmark_next) -- jump to next mark in local buffer
    map("n","mp",bm.bookmark_prev) -- jump to previous mark in local buffer
    map("n","ml",bm.bookmark_list) -- show marked file list in quickfix window
  end
}

Telescope

require('telescope').load_extension('bookmarks')

Then use :Telescope bookmarks list or require('telescope').extensions.bookmarks.list()

Credits