diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 360f196..0df1672 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -2,6 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" }, + "cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, diff --git a/.config/nvim/lua/tovi/core/remaps.lua b/.config/nvim/lua/tovi/core/remaps.lua index 923f697..96abda0 100644 --- a/.config/nvim/lua/tovi/core/remaps.lua +++ b/.config/nvim/lua/tovi/core/remaps.lua @@ -1,6 +1,10 @@ -- Don't copy "c" changes to primary register vim.keymap.set("n", "c", '"_c', { desc = "Prevent copying to primary register" }) +-- Move lines up and down +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '<-2gv=gv") + -- Easily open splits vim.keymap.set("n", "hs", "split", { desc = "Open horizontal spilt" }) vim.keymap.set("n", "vs", "vsplit", { desc = "Open vertical spilt" }) @@ -25,20 +29,6 @@ vim.keymap.set("n", "", function() vim.cmd("source ~/.cache/nvim/session/shutdown_session.vim") end, { desc = "Restore session automatically created on VimLeave" }) --- Navigating with guides --- vim.keymap.set( --- "n", --- "", --- '/<++>"_c4l', --- { desc = "Find next <++> in file and enter insert mode" } --- ) --- vim.keymap.set( --- "v", --- "", --- '/<++>"_c4l', --- { desc = "Find next <++> in file and enter insert mode" } --- ) - -- Spell-check vim.keymap.set("n", "o", "setlocal spell! spelllang=en_au", { desc = "Toggle spell check" }) @@ -60,14 +50,6 @@ vim.keymap.set("n", "", "7gt", { desc = "Navigate to tab 8" }) vim.keymap.set("n", "", "8gt", { desc = "Navigate to tab 9" }) vim.keymap.set("n", "", "9gt", { desc = "Navigate to tab 10" }) --- TODO: Move these into fugitive config --- vim.keymap.set('n', 'gp', 'Git push', options) --- vim.keymap.set('n', 'gP', 'Git pull', options) --- vim.keymap.set('n', 'ga', 'Git add .', options) --- vim.keymap.set('n', 'gA', 'Git add', options) --- vim.keymap.set('n', 'gc', 'Git commit', options) --- vim.keymap.set('n', 'gC', 'Git commit -a', options) - vim.keymap.set("x", "p", '"_dP', { desc = "Delete into black hole register" }) vim.keymap.set("n", "d", '"_d', { desc = "Delete into black hole register" }) vim.keymap.set("v", "d", '"_d', { desc = "Delete into black hole register" }) diff --git a/.config/nvim/lua/tovi/plugins/cloak.lua b/.config/nvim/lua/tovi/plugins/cloak.lua new file mode 100644 index 0000000..1bc2118 --- /dev/null +++ b/.config/nvim/lua/tovi/plugins/cloak.lua @@ -0,0 +1,15 @@ +return { + "laytan/cloak.nvim", + config = function() + require("cloak").setup({ + enabled = true, + patterns = { + { + file_pattern = ".env*", + cloak_pattern = "=.+", + replace = "*", + }, + } + }) + end, +} diff --git a/.config/nvim/lua/tovi/plugins/fugitive.lua b/.config/nvim/lua/tovi/plugins/fugitive.lua index 773b1dc..8894718 100644 --- a/.config/nvim/lua/tovi/plugins/fugitive.lua +++ b/.config/nvim/lua/tovi/plugins/fugitive.lua @@ -25,5 +25,13 @@ return { vim.keymap.set('n', 'gc', function () vim.cmd(string.format('Git show %s', gitBlame({vim.fn.line('.'), vim.fn.line('.')}))) end) + + + -- vim.keymap.set('n', 'gp', 'Git push', options) + -- vim.keymap.set('n', 'gP', 'Git pull', options) + -- vim.keymap.set('n', 'ga', 'Git add .', options) + -- vim.keymap.set('n', 'gA', 'Git add', options) + -- vim.keymap.set('n', 'gc', 'Git commit', options) + -- vim.keymap.set('n', 'gC', 'Git commit -a', options) end, } diff --git a/.config/nvim/lua/tovi/plugins/telescope.lua b/.config/nvim/lua/tovi/plugins/telescope.lua index 05419f1..23d721e 100644 --- a/.config/nvim/lua/tovi/plugins/telescope.lua +++ b/.config/nvim/lua/tovi/plugins/telescope.lua @@ -131,6 +131,20 @@ return { }) end, { desc = "Find neovim config files" }) + keymap.set("n", "vh", builtin.help_tags, { desc = "Fuzzy find help tags" }) + + keymap.set("n", "gf", function () + builtin.grep_string({ + search = vim.fn.expand(""), + }) + end, { desc = "Find neovim config files with FZF" }) + + keymap.set("n", "gF", function () + builtin.grep_string({ + search = vim.fn.expand(""), + }) + end, { desc = "Find neovim config files with FZF" }) + vim.keymap.set("n", "u", "Telescope undo") end, }