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

22 lines
563 B
Lua
Raw Normal View History

2022-03-09 19:03:04 +01:00
local helpers = require("my.helpers")
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-03-09 19:03:04 +01:00
local options = helpers.mergeTables(opts, {noremap = true})
2022-02-01 00:06:48 +01:00
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-03-09 19:03:04 +01:00
local options = helpers.mergeTables(opts, {silent = true})
M.map(mode, lhs, rhs, options)
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-03-09 19:03:04 +01:00
M.map("n", "vv", "<C-w>v") -- Create vertical split
2022-01-30 20:19:35 +01:00
end
2022-02-01 00:06:48 +01:00
return M