Browse Source

Add cloak and some minor keymaps

master
Tovi Jaeschke-Rogers 11 months ago
parent
commit
b70176dbcb
5 changed files with 42 additions and 22 deletions
  1. +1
    -0
      .config/nvim/lazy-lock.json
  2. +4
    -22
      .config/nvim/lua/tovi/core/remaps.lua
  3. +15
    -0
      .config/nvim/lua/tovi/plugins/cloak.lua
  4. +8
    -0
      .config/nvim/lua/tovi/plugins/fugitive.lua
  5. +14
    -0
      .config/nvim/lua/tovi/plugins/telescope.lua

+ 1
- 0
.config/nvim/lazy-lock.json View File

@ -2,6 +2,7 @@
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" }, "LuaSnip": { "branch": "master", "commit": "82108e7e31cc6fc223cc5df5cae6d89f70bb199f" },
"cloak.nvim": { "branch": "main", "commit": "951b163e55ce7639eb320c450bde9283c4fe968b" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },


+ 4
- 22
.config/nvim/lua/tovi/core/remaps.lua View File

@ -1,6 +1,10 @@
-- Don't copy "c" changes to primary register -- Don't copy "c" changes to primary register
vim.keymap.set("n", "c", '"_c', { desc = "Prevent copying 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 '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
-- Easily open splits -- Easily open splits
vim.keymap.set("n", "<leader>hs", "<cmd>split<cr>", { desc = "Open horizontal spilt" }) vim.keymap.set("n", "<leader>hs", "<cmd>split<cr>", { desc = "Open horizontal spilt" })
vim.keymap.set("n", "<leader>vs", "<cmd>vsplit<cr>", { desc = "Open vertical spilt" }) vim.keymap.set("n", "<leader>vs", "<cmd>vsplit<cr>", { desc = "Open vertical spilt" })
@ -25,20 +29,6 @@ vim.keymap.set("n", "<F7>", function()
vim.cmd("source ~/.cache/nvim/session/shutdown_session.vim") vim.cmd("source ~/.cache/nvim/session/shutdown_session.vim")
end, { desc = "Restore session automatically created on VimLeave" }) end, { desc = "Restore session automatically created on VimLeave" })
-- Navigating with guides
-- vim.keymap.set(
-- "n",
-- "<leader><leader>",
-- '<Esc>/<++><Enter>"_c4l',
-- { desc = "Find next <++> in file and enter insert mode" }
-- )
-- vim.keymap.set(
-- "v",
-- "<leader><leader>",
-- '<Esc>/<++><Enter>"_c4l',
-- { desc = "Find next <++> in file and enter insert mode" }
-- )
-- Spell-check -- Spell-check
vim.keymap.set("n", "<leader>o", "<cmd>setlocal spell! spelllang=en_au<CR>", { desc = "Toggle spell check" }) vim.keymap.set("n", "<leader>o", "<cmd>setlocal spell! spelllang=en_au<CR>", { desc = "Toggle spell check" })
@ -60,14 +50,6 @@ vim.keymap.set("n", "<A-7>", "7gt", { desc = "Navigate to tab 8" })
vim.keymap.set("n", "<A-8>", "8gt", { desc = "Navigate to tab 9" }) vim.keymap.set("n", "<A-8>", "8gt", { desc = "Navigate to tab 9" })
vim.keymap.set("n", "<A-9>", "9gt", { desc = "Navigate to tab 10" }) vim.keymap.set("n", "<A-9>", "9gt", { desc = "Navigate to tab 10" })
-- TODO: Move these into fugitive config
-- vim.keymap.set('n', '<leader>gp', '<cmd>Git push<CR>', options)
-- vim.keymap.set('n', '<leader>gP', '<cmd>Git pull<CR>', options)
-- vim.keymap.set('n', '<leader>ga', '<cmd>Git add .<CR>', options)
-- vim.keymap.set('n', '<leader>gA', '<cmd>Git add<CR>', options)
-- vim.keymap.set('n', '<leader>gc', '<cmd>Git commit<CR>', options)
-- vim.keymap.set('n', '<leader>gC', '<cmd>Git commit -a<CR>', options)
vim.keymap.set("x", "<leader>p", '"_dP', { desc = "Delete into black hole register" }) vim.keymap.set("x", "<leader>p", '"_dP', { desc = "Delete into black hole register" })
vim.keymap.set("n", "<leader>d", '"_d', { desc = "Delete into black hole register" }) vim.keymap.set("n", "<leader>d", '"_d', { desc = "Delete into black hole register" })
vim.keymap.set("v", "<leader>d", '"_d', { desc = "Delete into black hole register" }) vim.keymap.set("v", "<leader>d", '"_d', { desc = "Delete into black hole register" })


+ 15
- 0
.config/nvim/lua/tovi/plugins/cloak.lua View File

@ -0,0 +1,15 @@
return {
"laytan/cloak.nvim",
config = function()
require("cloak").setup({
enabled = true,
patterns = {
{
file_pattern = ".env*",
cloak_pattern = "=.+",
replace = "*",
},
}
})
end,
}

+ 8
- 0
.config/nvim/lua/tovi/plugins/fugitive.lua View File

@ -25,5 +25,13 @@ return {
vim.keymap.set('n', '<leader>gc', function () vim.keymap.set('n', '<leader>gc', function ()
vim.cmd(string.format('Git show %s', gitBlame({vim.fn.line('.'), vim.fn.line('.')}))) vim.cmd(string.format('Git show %s', gitBlame({vim.fn.line('.'), vim.fn.line('.')})))
end) end)
-- vim.keymap.set('n', '<leader>gp', '<cmd>Git push<CR>', options)
-- vim.keymap.set('n', '<leader>gP', '<cmd>Git pull<CR>', options)
-- vim.keymap.set('n', '<leader>ga', '<cmd>Git add .<CR>', options)
-- vim.keymap.set('n', '<leader>gA', '<cmd>Git add<CR>', options)
-- vim.keymap.set('n', '<leader>gc', '<cmd>Git commit<CR>', options)
-- vim.keymap.set('n', '<leader>gC', '<cmd>Git commit -a<CR>', options)
end, end,
} }

+ 14
- 0
.config/nvim/lua/tovi/plugins/telescope.lua View File

@ -131,6 +131,20 @@ return {
}) })
end, { desc = "Find neovim config files" }) end, { desc = "Find neovim config files" })
keymap.set("n", "<leader>vh", builtin.help_tags, { desc = "Fuzzy find help tags" })
keymap.set("n", "<leader>gf", function ()
builtin.grep_string({
search = vim.fn.expand("<cword>"),
})
end, { desc = "Find neovim config files with FZF" })
keymap.set("n", "<leader>gF", function ()
builtin.grep_string({
search = vim.fn.expand("<cWORD>"),
})
end, { desc = "Find neovim config files with FZF" })
vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>") vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>")
end, end,
} }

Loading…
Cancel
Save