feat(plugins): Install autocomment plugin
This commit is contained in:
47
after/plugin/comment.lua
Normal file
47
after/plugin/comment.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
local comment = require("Comment")
|
||||
|
||||
local options = {
|
||||
---Add a space b/w comment and the line
|
||||
padding = true,
|
||||
---Whether the cursor should stay at its position
|
||||
sticky = true,
|
||||
---Lines to be ignored while (un)comment
|
||||
ignore = nil,
|
||||
---LHS of toggle mappings in NORMAL mode
|
||||
toggler = {
|
||||
---Line-comment toggle keymap
|
||||
line = "<leader>cc",
|
||||
---Block-comment toggle keymap
|
||||
block = "<leader>cb",
|
||||
},
|
||||
---LHS of operator-pending mappings in NORMAL and VISUAL mode
|
||||
opleader = {
|
||||
---Line-comment keymap
|
||||
line = "cc",
|
||||
---Block-comment keymap
|
||||
block = "cb",
|
||||
},
|
||||
---LHS of extra mappings
|
||||
extra = {
|
||||
---Add comment on the line above
|
||||
above = "gcO",
|
||||
---Add comment on the line below
|
||||
below = "gco",
|
||||
---Add comment at the end of line
|
||||
eol = "gcA",
|
||||
},
|
||||
---Enable keybindings
|
||||
---NOTE: If given `false` then the plugin won't create any mappings
|
||||
mappings = {
|
||||
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
|
||||
basic = true,
|
||||
---Extra mapping; `gco`, `gcO`, `gcA`
|
||||
extra = false,
|
||||
},
|
||||
---Function to call before (un)comment
|
||||
pre_hook = nil,
|
||||
---Function to call after (un)comment
|
||||
post_hook = nil,
|
||||
}
|
||||
|
||||
comment.setup(options)
|
||||
@@ -42,6 +42,7 @@ vim.pack.add({
|
||||
{ src = "https://github.com/petertriho/nvim-scrollbar" },
|
||||
{ src = "https://github.com/j-hui/fidget.nvim" },
|
||||
{ src = "https://github.com/nvimdev/lspsaga.nvim" },
|
||||
{ src = "https://github.com/numtostr/comment.nvim" },
|
||||
|
||||
-- Framework specific
|
||||
{ src = "https://github.com/adibhanna/laravel.nvim" },
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
"rev": "2cb62890cee636fe46722d03b7b2331e54fb3755",
|
||||
"src": "https://github.com/saghen/blink.lib"
|
||||
},
|
||||
"comment.nvim": {
|
||||
"rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb",
|
||||
"src": "https://github.com/numtostr/comment.nvim"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
|
||||
Reference in New Issue
Block a user