From 7b0a97c5c6221db4e777b5ba4a95289fa676180b Mon Sep 17 00:00:00 2001 From: Adam <24621027+adoyle0@users.noreply.github.com> Date: Tue, 2 Jan 2024 23:15:37 -0500 Subject: [PATCH] add nvim_comment --- configs/nvim/after/plugin/nvim_comment.lua | 23 ++++++++++++++++++++++ configs/nvim/lua/adam/packer.lua | 1 + 2 files changed, 24 insertions(+) create mode 100644 configs/nvim/after/plugin/nvim_comment.lua diff --git a/configs/nvim/after/plugin/nvim_comment.lua b/configs/nvim/after/plugin/nvim_comment.lua new file mode 100644 index 0000000..c2b0008 --- /dev/null +++ b/configs/nvim/after/plugin/nvim_comment.lua @@ -0,0 +1,23 @@ +require('nvim_comment').setup( + { + -- Linters prefer comment and line to have a space in between markers + marker_padding = true, + -- should comment out empty or whitespace only lines + comment_empty = true, + -- trim empty comment whitespace + comment_empty_trim_whitespace = true, + -- Should key mappings be created + create_mappings = true, + -- Normal mode mapping left hand side + line_mapping = "gcc", + -- Visual/Operator mapping left hand side + operator_mapping = "gc", + -- text object mapping, comment chunk,, + comment_chunk_text_object = "ic", + -- Hook function to call before commenting takes place + hook = nil + } +) + +vim.keymap.set("v", "", "'<,'>CommentToggle") +vim.keymap.set("n", "", "CommentToggle") diff --git a/configs/nvim/lua/adam/packer.lua b/configs/nvim/lua/adam/packer.lua index a7c8d19..0c76e20 100644 --- a/configs/nvim/lua/adam/packer.lua +++ b/configs/nvim/lua/adam/packer.lua @@ -20,6 +20,7 @@ return require('packer').startup(function(use) use 'theprimeagen/harpoon' use 'mbbill/undotree' use 'tpope/vim-fugitive' + use 'terrortylor/nvim-comment' -- Visual use 'vim-airline/vim-airline'