dotfiles/home/.config/nvim/lua/plugins/which-key.lua
Marko Korhonen c99903e78e
Tweak neovim config
- Add noice, navic
- Tweak theme configuration
- Tweak cder configuration
- Update .ignore file
2023-11-17 08:04:37 +02:00

30 lines
754 B
Lua

return function()
local wk = require("which-key")
local gitsigns = require("gitsigns")
wk.setup({})
wk.register({
f = { "<cmd>Neoformat<CR>", "Format with Neoformat" },
h = { "<cmd>nohlsearch<CR>", "Turn off search highlight" },
}, { prefix = "<leader>" })
wk.register({
["<C-n>"] = { "<cmd>bnext<CR>", "Next buffer" },
["<C-b>"] = { "<cmd>bprevious<CR>", "Previous buffer" },
["["] = { h = { gitsigns.prev_hunk, "Previous hunk" } },
["]"] = { h = { gitsigns.next_hunk, "Next hunk" } },
})
-- Open cder
wk.register({ cd = {
function()
vim.cmd("Telescope cder")
end,
"Change directories",
} })
-- Exit terminal insert mode with esc
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
end