-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed files key in favor of commands * Add wrapper function for vim.notify * Add <Plug> presets * Add BufWinEnter to caching
- Loading branch information
Showing
8 changed files
with
154 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
local dev_comments = {} | ||
|
||
dev_comments.config = { | ||
debug = false, | ||
default_mappings = true, | ||
cache = true, | ||
telescope = { | ||
load = true, | ||
current = { | ||
hidden = false, | ||
depth = 3, | ||
tags = "", | ||
users = "", | ||
}, | ||
open = { | ||
hidden = false, | ||
depth = 3, | ||
tags = "", | ||
users = "", | ||
}, | ||
all = { | ||
hidden = false, | ||
depth = 3, | ||
tags = "", | ||
users = "", | ||
}, | ||
}, | ||
cycle = { | ||
wrap = true, | ||
}, | ||
} | ||
|
||
dev_comments.setup = function(config) | ||
config = config or {} | ||
dev_comments.config = vim.tbl_extend("force", dev_comments.config, config) | ||
if dev_comments.config.default_mappings then | ||
require("dev_comments.presets").set_default_mappings() | ||
end | ||
if dev_comments.config.telescope.load then | ||
require("telescope").load_extension("dev_comments") | ||
end | ||
if dev_comments.config.cache then | ||
require("dev_comments.cache").register() | ||
end | ||
end | ||
|
||
return dev_comments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
local P = {} | ||
|
||
local setup = function() | ||
vim.keymap.set( | ||
"n", | ||
"<Plug>DevCommentsTelescopeCurrent", | ||
"<cmd>lua require('telescope').extensions.dev_comments.current{}<cr>", | ||
{ silent = true } | ||
) | ||
vim.keymap.set( | ||
"n", | ||
"<Plug>DevCommentsTelescopeOpen", | ||
"<cmd>lua require('telescope').extensions.dev_comments.open{}<cr>", | ||
{ silent = true } | ||
) | ||
vim.keymap.set( | ||
"n", | ||
"<Plug>DevCommentsTelescopeAll", | ||
"<cmd>lua require('telescope').extensions.dev_comments.all{}<cr>", | ||
{ silent = true } | ||
) | ||
vim.keymap.set( | ||
"n", | ||
"<Plug>DevCommentsCyclePrev", | ||
"<cmd>lua require('dev_comments.cycle').goto_prev()<cr>", | ||
{ silent = true } | ||
) | ||
vim.keymap.set( | ||
"n", | ||
"<Plug>DevCommentsCycleNext", | ||
"<cmd>lua require('dev_comments.cycle').goto_next()<cr>", | ||
{ silent = true } | ||
) | ||
end | ||
|
||
P.set_default_mappings = function() | ||
setup() | ||
vim.keymap.set("n", "[c", "<Plug>DevCommentsCyclePrev") | ||
vim.keymap.set("n", "]c", "<Plug>DevCommentsCycleNext") | ||
end | ||
|
||
return P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters