1
Fork 0
satellite/dotfiles/neovim/lua/my/keymaps.lua

21 lines
551 B
Lua
Raw Normal View History

2022-01-30 19:10:57 +01:00
local M = {}
2022-01-31 21:41:13 +01:00
function M.map(mode, lhs, rhs, opts)
2022-02-01 00:06:48 +01:00
local options = {noremap = true}
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
2022-01-30 19:10:57 +01:00
end
2022-01-31 21:54:22 +01:00
function M.mapSilent(mode, lhs, rhs, opts)
2022-02-01 00:06:48 +01:00
local options = {silent = true}
if opts then options = vim.tbl_extend('force', options, opts) end
M.map(mode, lhs, rhs, opts)
2022-01-31 21:54:22 +01:00
end
2022-01-30 19:10:57 +01:00
function M.setup()
2022-02-01 00:06:48 +01:00
M.map("i", "jj", "<Esc>") -- Remap Esc to jj
M.map("n", "<Space><Space>", ":w<cr>") -- Double space to sace
2022-01-30 20:19:35 +01:00
end
2022-02-01 00:06:48 +01:00
return M