diff options
| author | Brad Clawsie <brad@b7j0c.org> | 2025-11-08 10:16:19 -0600 |
|---|---|---|
| committer | Brad Clawsie <brad@b7j0c.org> | 2025-11-08 10:16:19 -0600 |
| commit | a075b49ccef31ca63ec686fb32d07448d5131cc6 (patch) | |
| tree | 4cfdf8bbeba15cbfefdcc0d0fb69d70ff1f02ed6 /nvim | |
| parent | 659a7c658728da3909abc165cd4852d92efa695a (diff) | |
nvim matching pairs and commenting
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/init.lua | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/nvim/init.lua b/nvim/init.lua index 6eaae6f..980d45d 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -59,4 +59,57 @@ require("lazy").setup({ vim.keymap.set("n", "<leader>fb", '<cmd>Telescope buffers<cr>', { desc = "Find Buffers" }) end, }, + + { + 'windwp/nvim-autopairs', + event = "InsertEnter", + opts = {} + }, + + { + 'kylechui/nvim-surround', + version = "*", + event = "VeryLazy", + }, + + -- [[ Comment.nvim Keymaps ]] + -- + -- This plugin provides "operators" that work with motions. + -- 'gc' is for line comments (e.g., //) + -- 'gb' is for block comments (e.g., /* ... */) + + -- --- Normal Mode (Line Comments) --- + -- gc + [motion] + -- gcc - Toggle comment for the current line + -- gc5j - Toggle comment for the 5 lines below + -- gcG - Toggle comment from cursor to end of file + -- gcap - Toggle comment for the current paragraph + -- gcaw - Toggle comment for the current word + + -- --- Visual Mode (Line Comments) --- + -- Select text (v, V, Ctrl-v) and press 'gc' + -- gc - Toggles line comments for each line in the visual selection. + -- (This keymap is often set manually in the config, as shown in the plugin setup) + + -- --- Normal Mode (Block Comments) --- + -- gb + [motion] + -- gbc - Toggle block comment for the current line + -- gbap - Toggle block comment for the current paragraph (as a single block) + -- gbiw - Toggle block comment for the inner word + + -- --- Visual Mode (Block Comments) --- + -- Select text (v, V, Ctrl-v) and press 'gb' + -- gb - Adds a single block comment around the entire visual selection. + -- (e.g., /* selected text */) + + { + 'numToStr/Comment.nvim', + event = "VeryLazy", + opts = {}, + config = function(_, opts) + require('Comment').setup(opts) + vim.keymap.set('v', 'gc', '<Plug>(Comment.nvim)', { silent = true, desc = "Comment visual selection" }) + end + }, + }) |
