basics
This commit is contained in:
40
plugin/keymap.lua
Normal file
40
plugin/keymap.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
-- define common options
|
||||
local opts = {
|
||||
noremap = true, -- non-recursive
|
||||
silent = true, -- do not show message
|
||||
}
|
||||
local map = vim.keymap.set
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
-----------------
|
||||
-- Normal mode --
|
||||
-----------------
|
||||
|
||||
-- Hint: see `:h vim.map.set()`
|
||||
-- Better window navigation
|
||||
map('n', '<leader>wh', '<C-w>h', opts)
|
||||
map('n', '<leader>wj', '<C-w>j', opts)
|
||||
map('n', '<leader>wk', '<C-w>k', opts)
|
||||
map('n', '<leader>wl', '<C-w>l', opts)
|
||||
|
||||
local step_size = 4
|
||||
map('n', '<leader>wJ', ':resize -'.. step_size ..'<CR>', opts)
|
||||
map('n', '<leader>wK', ':resize +'.. step_size ..'<CR>', opts)
|
||||
map('n', '<leader>wH', ':vertical resize -'.. step_size ..'<CR>', opts)
|
||||
map('n', '<leader>wL', ':vertical resize +'.. step_size ..'<CR>', opts)
|
||||
|
||||
map('n', '<leader>wn', ':windo new<CR>', opts)
|
||||
map('n', '<leader>wc', ':close<CR>', opts)
|
||||
|
||||
-- tab management
|
||||
map('n', '<tab>', ':tabnext<CR>', opts)
|
||||
map('n', '<leader>x', ':tabclose<CR>', opts)
|
||||
map('n', '<leader>s', ':$tab split<CR>', opts)
|
||||
|
||||
|
||||
-----------------
|
||||
-- Visual mode --
|
||||
-----------------
|
||||
|
||||
--vim.keymap.set('v', '<', '<gv', opts)
|
||||
--vim.keymap.set('v', '>', '>gv', opts)
|
||||
Reference in New Issue
Block a user