mirror of
https://git.korhonen.cc/FunctionalHacker/dotfiles.git
synced 2024-11-01 03:20:29 +00:00
5561023ea8
Also remapped some nvim and zsh keybinds to not conflict with zellij
35 lines
924 B
Lua
35 lines
924 B
Lua
-- Display possible keybinds
|
|
-- Here I have also defined some generic keybinds
|
|
-- Plugin specific keybinds are set up in plugin configuration file
|
|
|
|
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
|
|
|
|
--- @type LazyPluginSpec
|
|
return {
|
|
"folke/which-key.nvim",
|
|
config = function()
|
|
local wk = require("which-key")
|
|
wk.setup()
|
|
|
|
wk.register({
|
|
h = { "<cmd>nohlsearch<cr>", "Turn off search highlight" },
|
|
b = { toggle_theme, "Toggle background between dark and light" },
|
|
}, { prefix = "<leader>" })
|
|
|
|
wk.register({
|
|
["<Tab>"] = { "<cmd>bnext<cr>", "Next buffer" },
|
|
["<S-Tab>"] = { "<cmd>bprevious<cr>", "Previous buffer" },
|
|
})
|
|
|
|
-- Exit terminal insert mode with esc
|
|
vim.keymap.set("t", "<Esc>", "<C-\\><C-n>", {})
|
|
end,
|
|
}
|