1
Fork 0

feat: vimux

This commit is contained in:
Matei Adriel 2022-03-09 20:03:04 +02:00
parent 3b0950e88b
commit 68f807ecf2
11 changed files with 118 additions and 65 deletions
dotfiles/neovim/lua/my

View file

@ -1,20 +1,21 @@
local helpers = require("my.helpers")
local M = {}
function M.map(mode, lhs, rhs, opts)
local options = {noremap = true}
if opts then options = vim.tbl_extend('force', options, opts) end
local options = helpers.mergeTables(opts, {noremap = true})
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
function M.mapSilent(mode, lhs, rhs, opts)
local options = {silent = true}
if opts then options = vim.tbl_extend('force', options, opts) end
M.map(mode, lhs, rhs, opts)
local options = helpers.mergeTables(opts, {silent = true})
M.map(mode, lhs, rhs, options)
end
function M.setup()
M.map("i", "jj", "<Esc>") -- Remap Esc to jj
M.map("n", "<Space><Space>", ":w<cr>") -- Double space to sace
M.map("n", "vv", "<C-w>v") -- Create vertical split
end
return M