From de86f17b131c1761d293bb6b9af32ffb0133d885 Mon Sep 17 00:00:00 2001 From: bain Date: Mon, 28 Aug 2023 21:18:48 +0200 Subject: [PATCH] update nvim config --- nvim/.config/nvim/init.lua | 28 +++++++++++++++++++++++++++- nvim/.config/nvim/lazy-lock.json | 5 +++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 41a826e..677edf1 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -114,7 +114,7 @@ require("lazy").setup({ config = function () local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', function() - builtin.find_files({ follow = true }) + builtin.find_files({ follow = true, hidden = true }) end, {}) vim.keymap.set('n', 'fg', builtin.git_files, {}) vim.keymap.set('n', 'fo', builtin.buffers, {}) @@ -173,6 +173,32 @@ require("lazy").setup({ 'tpope/vim-fugitive', event = "User EnableIDE", }, + { + 'numToStr/Comment.nvim', + lazy = false, + config = function () + require("Comment").setup({ + mappings = { + basic = false, + extra = false, + } + }) + local api = require("Comment.api") + local esc = vim.api.nvim_replace_termcodes( + '', true, false, true + ) + vim.keymap.set('n', '/', api.toggle.linewise.current) + vim.keymap.set('n', '(', api.toggle.blockwise.current) + vim.keymap.set('x', '/', function() + vim.api.nvim_feedkeys(esc, 'nx', false) + api.toggle.linewise(vim.fn.visualmode()) + end) + vim.keymap.set('x', '(', function() + vim.api.nvim_feedkeys(esc, 'nx', false) + api.toggle.blockwise(vim.fn.visualmode()) + end) + end, + } }) -- }}} -- {{{ Keymap diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index e7d214e..88bb17b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,15 +1,16 @@ { + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "c4d6298347f7707e9757351b2ee03d0c00da5c20" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "gitsigns.nvim": { "branch": "main", "commit": "d8590288417fef2430f85bc8b312fae8b1cf2c40" }, - "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, + "lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" }, "lsp-zero.nvim": { "branch": "v2.x", "commit": "f084f4a6a716f55bf9c4026e73027bb24a0325a3" }, "lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" }, "mason.nvim": { "branch": "main", "commit": "c811fbf09c7642eebb37d6694f1a016a043f6ed3" }, "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, "nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" }, - "nvim-treesitter": { "branch": "master", "commit": "cb74c1c5aefd8b903f1b547d08d4df42be07aa2a" }, + "nvim-treesitter": { "branch": "master", "commit": "d94e1ad9575cc211b5726f09b28ca9454aba22fe" }, "nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }, "plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" }, "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },