Better split resize mappings
This commit is contained in:
parent
8c5d2bc36e
commit
3cee875f97
|
@ -1,5 +1,7 @@
|
||||||
-- [[ General Keymaps ]]
|
-- [[ General Keymaps ]]
|
||||||
|
|
||||||
|
local nmap = require 'core.utils'.createNmap()
|
||||||
|
|
||||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||||
|
|
||||||
-- Remap for dealing with word wrap
|
-- Remap for dealing with word wrap
|
||||||
|
@ -30,8 +32,16 @@ vim.keymap.set("n", "<Esc>", function()
|
||||||
vim.cmd(':silent! Neotree cancel<cr>')
|
vim.cmd(':silent! Neotree cancel<cr>')
|
||||||
end, { silent = true })
|
end, { silent = true })
|
||||||
|
|
||||||
|
--[[
|
||||||
|
NOTE To use Meta key as Option in mac inside iterm
|
||||||
|
it should be set to work as +ESC in iterm settings
|
||||||
|
--]]
|
||||||
|
|
||||||
-- Split resize
|
-- Split resize
|
||||||
vim.keymap.set('n', '<C-j>', ':res +1<cr>', { desc = 'Resize split' })
|
nmap('<M-j>', ':res +1<cr>', 'Resize split')
|
||||||
vim.keymap.set('n', '<C-k>', ':res -1<cr>', { desc = 'Resize split' })
|
nmap('<M-k>', ':res -1<cr>', 'Resize split')
|
||||||
vim.keymap.set('n', '<C-h>', ':vertical res -1<cr>', { desc = 'Resize split vertically' })
|
nmap('<M-h>', ':vertical res -1<cr>', 'Resize split vertically')
|
||||||
vim.keymap.set('n', '<C-l>', ':vertical res +1<cr>', { desc = 'Resize split vertically' })
|
nmap('<M-l>', ':vertical res +1<cr>', 'Resize split vertically')
|
||||||
|
nmap('<M-v>', '<C-w>|<cr>', 'Maximize Split Vertically')
|
||||||
|
nmap('<M-s>', '<C-w>_<cr>', 'Maximize Split Horizontally')
|
||||||
|
nmap('<M-e>', '<C-w>=<cr>', 'Reset Split Size')
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
local createImporter = function(path)
|
local createImporter = function(path)
|
||||||
|
path = path or ""
|
||||||
return function(module)
|
return function(module)
|
||||||
require(path .. "." .. module)
|
require(path .. "." .. module)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local createNmap = function(opts)
|
local createNmap = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
return function(keys, func, _desc)
|
return function(keys, func, _desc)
|
||||||
if opts.desc then
|
if opts.desc then
|
||||||
_desc = opts.desc .. _desc
|
_desc = opts.desc .. _desc
|
||||||
|
|
Loading…
Reference in New Issue