dotfiles/modules/programs/nvim/keybinds.lua

22 lines
576 B
Lua
Raw Normal View History

2023-03-26 18:28:49 +02:00
-- buffers
require("which-key").register({
b = {
name = "buffers",
b = { "<cmd>Telescope buffers<cr>", "List buffers" },
d = { "<cmd>bd<cr>", "Delete buffer" },
n = { "<cmd>bnext<cr>", "Next buffer" },
p = { "<cmd>bprevious<cr>", "Previous buffer" },
},
})
-- Clear search with <esc>
require("which-key").register({
["<esc>"] = { "<cmd>noh<cr><esc>", "Escape and clear hlsearch", mode = { "n", "i" } },
})
-- better indenting
require("which-key").register({
["<"] = { "<gv", "Shift left" },
[">"] = { ">gv", "Shift right" },
}, { mode = "v" })