18 lines
700 B
Lua
18 lines
700 B
Lua
function map(mode, lhs, rhs, opts)
|
||
local options = { noremap = true, silent = true }
|
||
if opts then
|
||
options = vim.tbl_extend("force", options, opts)
|
||
end
|
||
vim.keymap.set(mode, lhs, rhs, options)
|
||
end
|
||
--This code just maps vim.keymap.set() to something easier to type. Also, typing { noremap = true, silent = true } won’t be needed, because that is also implemented in the function.
|
||
|
||
vim.g.mapleader = " "
|
||
|
||
map("i", "jk", "<esc>") -- remap escape
|
||
|
||
map("n", "<leader>+", ":bNext<cr>") --switch tabs
|
||
map("n", "<leader>n", ":Neotree toggle<cr>") --open Nerdtree
|
||
map("n", "<leader>z", ":ZenMode<cr>") --open ZenMode (distraction-free)
|
||
map("n", "<leader>d", ":ToggleDiag<cr>") -- toggle all diagnostics
|