Add Comment.nvim plugin with <c-/> shortcuts

This commit is contained in:
Daniel McKnight 2025-08-27 20:34:11 -07:00
parent 44063ad379
commit f1d1cae623
2 changed files with 54 additions and 43 deletions

View file

@ -1,4 +1,3 @@
-- Configure Indent Settings
vim.cmd("set expandtab")
vim.cmd("set tabstop=2")
vim.cmd("set softtabstop=2")

View file

@ -42,4 +42,16 @@ return {
{
"hrsh7th/cmp-nvim-lsp",
},
{
"numToStr/Comment.nvim",
config = function()
-- Configure Comment Shortcuts
local comment = require("Comment.api")
vim.keymap.set("i", "<C-_>", function()
comment.toggle.linewise.current()
end, { noremap = true, silent = true })
vim.keymap.set("n", "<C-_>", '<Plug>(comment_toggle_linewise_current)')
vim.keymap.set("x", "<C-_>", '<Plug>(comment_toggle_linewise_visual)')
end,
},
}