2023-11-18 02:27:14 +02:00
|
|
|
-- Display possible keybinds
|
2023-11-25 14:13:26 +02:00
|
|
|
-- Here I have also defined some generic keybinds
|
2023-11-18 02:27:14 +02:00
|
|
|
-- Plugin specific keybinds are set up in plugin configuration file
|
2024-01-25 15:30:12 +02:00
|
|
|
|
|
|
|
local function toggle_theme()
|
|
|
|
local current_theme = vim.fn.eval("&background")
|
|
|
|
if current_theme == "dark" then
|
|
|
|
vim.cmd("set background=light")
|
|
|
|
else
|
|
|
|
vim.cmd("set background=dark")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-11-25 14:37:36 +02:00
|
|
|
--- @type LazyPluginSpec
|
2023-11-18 02:27:14 +02:00
|
|
|
return {
|
|
|
|
"folke/which-key.nvim",
|
|
|
|
config = function()
|
|
|
|
local wk = require("which-key")
|
2023-11-21 22:28:54 +02:00
|
|
|
wk.setup()
|
2023-06-27 12:39:51 +03:00
|
|
|
|
2023-11-18 02:27:14 +02:00
|
|
|
wk.register({
|
2023-11-25 14:13:26 +02:00
|
|
|
h = { "<cmd>nohlsearch<cr>", "Turn off search highlight" },
|
2024-01-25 15:30:12 +02:00
|
|
|
b = { toggle_theme, "Toggle background between dark and light" },
|
2023-11-18 02:27:14 +02:00
|
|
|
}, { prefix = "<leader>" })
|
2023-06-27 12:39:51 +03:00
|
|
|
|
2023-11-18 02:27:14 +02:00
|
|
|
wk.register({
|
2023-11-25 14:13:26 +02:00
|
|
|
["<C-n>"] = { "<cmd>bnext<cr>", "Next buffer" },
|
|
|
|
["<C-b>"] = { "<cmd>bprevious<cr>", "Previous buffer" },
|
2023-11-18 02:27:14 +02:00
|
|
|
})
|
2023-06-27 12:39:51 +03:00
|
|
|
|
2023-11-18 02:27:14 +02:00
|
|
|
-- Exit terminal insert mode with esc
|
|
|
|
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
|
|
|
end,
|
|
|
|
}
|