etc/nvim/lua/maps.lua

43 lines
1.2 KiB
Lua
Raw Normal View History

2023-08-26 11:47:29 +03:00
2023-08-27 13:31:42 +03:00
vim.o.timeout = false
2023-08-26 11:47:29 +03:00
-- Key mapping
local map = vim.api.nvim_set_keymap
-- Configuration fast editing.
local opts = {noremap = true, silent = true}
2023-08-26 15:09:08 +03:00
map('n', '\\rconf', ':source $HOME/lib/nvim/init.lua\n', opts)
map('n', '\\econf', ':e $HOME/lib/nvim/init.lua\n', opts)
2023-08-26 12:20:56 +03:00
map('n', '\\rmap', ':source $HOME/lib/nvim/lua/maps.lua\n', opts)
map('n', '\\emap', ':e $HOME/lib/nvim/lua/maps.lua\n', opts)
2023-08-27 13:31:42 +03:00
map('n', '\\rcolor', ':colorscheme jien\n', opts)
map('n', '\\ecolor', ':e $HOME/lib/nvim/colors/jien.vim\n', opts)
2023-08-26 12:20:56 +03:00
2023-08-29 13:42:38 +03:00
-- Moving around.
2023-08-28 13:47:12 +03:00
map('n', '\\home', ":cd $HOME\n", opts)
2023-08-29 13:42:38 +03:00
-- Search
map('n', '\\noh', ':noh\n', opts)
2023-08-26 11:47:29 +03:00
2023-08-26 12:20:56 +03:00
-- Tabs.
map('n', '\\tn', ':tabnew\n', opts)
2023-08-26 11:47:29 +03:00
2023-08-26 15:09:08 +03:00
-- Line
2023-08-27 13:31:42 +03:00
-- map('n', '\\nl', ':if &cursorline==1<enter>set nocursorline<enter>else set cursoreline<enter>endif<enter><enter>', opts)
2023-08-26 15:09:08 +03:00
2023-08-26 11:47:29 +03:00
-- Windows
-- Moving
opts = {silent = true}
2023-08-26 12:20:56 +03:00
map('n', '<A-l>', '<C-w>l', opts)
map('n', '<A-h>', '<C-w>h', opts)
map('n', '<A-k>', '<C-w>k', opts)
map('n', '<A-j>', '<C-w>j', opts)
-- Resizing
map('n', '<C-k>', '<C-w>+', opts)
map('n', '<C-j>', '<C-w>-', opts)
2023-08-27 13:31:42 +03:00
map('n', '<C-h>', '3<C-w><', opts)
2023-08-26 12:20:56 +03:00
map('n', '<C-l>', '3<C-w>>', opts)
2023-08-26 11:47:29 +03:00
-- Splitting
map('n', '\\|', '<C-w>v', opts)
map('n', '\\-', '<C-w>s', opts)