add comment.nvim and fix lsp keymap

This commit is contained in:
2024-10-01 00:06:01 +02:00
parent d9249a54f1
commit b8e245dede
6 changed files with 35 additions and 17 deletions

15
lua/config/comment.lua Normal file
View File

@@ -0,0 +1,15 @@
local opts = { noremap = true, silent = true }
require("Comment").setup({
mappings = {
---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}`
basic = false,
---Extra mapping; `gco`, `gcO`, `gcA`
extra = false,
},
})
vim.keymap.set("n", "<leader>/", require("Comment.api").toggle.linewise.current)
vim.keymap.set("v", "<leader>/",
'<ESC><CMD>lua require("Comment.api").toggle.linewise(vim.fn.visualmode())<CR>', opts)