List and search for dev comments using tree-sitter-comment parser
- Performant searching
- Highly configurable
- Sensible defaults (can be disabled)
- Telescope integration
- Filter dev comments by tags i.e.
<TAG>:
and/or users i.e.<TAG>(<user>):
- Cycle through dev comments in a buffer
- All core functionality has unit tests
- Neovim >= 0.8.0
OR
Highly recommended if you use the
all
file mode
Install the plugin with your preferred plugin manager
Plug 'ram02z/dev-comments.nvim'
Plug 'nvim-treesitter/nvim-treesitter'
Plug 'nvim-telescope/telescope.nvim' " optional for picker
lua << EOF
require("dev_comments").setup({
-- configuration
-- leave empty for defaults
})
EOF
use({
"ram02z/dev-comments.nvim",
requires = {
"nvim-treesitter/nvim-treesitter",
"nvim-telescope/nvim-telescope", -- optional
},
config = function()
require("dev_comments").setup({
-- configuration
-- leave empty for defaults
})
end
})
Ensure you have the tree-sitter-comment
parser installed in Neovim
Run :TSInstall comment<CR>
All features are enabled by default.
See the help doc or run :help dev-comments-configuration<CR>
in Neovim
The file modes:
all
: searches in all files based on value ofcwd
open
: searches only open files- Only filters based on
cwd
if provided
- Only filters based on
buffer
: searches only the open buffer- Ignores the value of
cwd
- Ignores the value of
The main options are:
cwd
: filters the search by working directory- Default: value of
vim.loop.cwd()
- Uses
vim.fs.normalize()
to expand variables i.e.~
->/root/home/
- Default: value of
find
: finds files/directories upwards of the working directory- Default: empty table
- Use comma separated strings if you using the commands, i.e.
find=.git
- Sets the first found file/directory to new search directory
- If no matching file/directory found, uses
cwd
tags
: filters the search by tags i.e.<TAG>:
- Default: all tags
- Use comma separated strings if you using the commands, i.e.
tags=TODO
users
: filters the search by user i.e.<TAG>(<USER>):
- Default: all users
- Use comma separated strings if you using the commands, i.e.
users=ram02z,foo
Either set the telescope.load
to true
in the configuration or load the extension manually
require("telescope").load_extension("dev_comments")
The three file modes all
, current
and open
are available by running
:Telescope dev_comments <file-mode><CR>
For more information, run :help dev-comments-telescope<CR>
The cycle feature only works in the current open buffer
Run :help dev-comments-default-commands<CR>
in Neovim
Run :help dev-comments-default-keymaps<CR>
in Neovim
MIT