Files
nvim/lua/keymaps.lua
Norm Rasmussen e1984cbb56 plugins
2022-07-07 16:45:13 -04:00

48 lines
1.8 KiB
Lua

-----------------------------------------------------------
-- Keymaps of Neovim and installed plugins.
-----------------------------------------------------------
local map = vim.api.nvim_set_keymap
local default_opts = { noremap = true, silent = true }
-- Fast saving with <leader> and s
map('n', '<leader>s', ':w<CR>', default_opts)
map('n', '<leader>a', ':w|:luafile %<CR>', default_opts)
map('i', '<leader>s', '<C-c>:w<CR>', default_opts)
-- Move around splits using Ctrl + {h,j,k,l}
map('n', '<C-h>', '<C-w>h', default_opts)
map('n', '<C-j>', '<C-w>j', default_opts)
map('n', '<C-k>', '<C-w>k', default_opts)
map('n', '<C-l>', '<C-w>l', default_opts)
-- Neovim Tab Navigation
map('n', '<leader>t', ':tabnew<CR>', default_opts)
map('n', '<leader>w', ':-tabnext<CR>', default_opts)
map('n', '<leader>e', ':+tabnext<CR>', default_opts)
map('n', '<leader>r', ':tabclose<CR>', default_opts)
-----------------------------------------------------------
-- Applications and Plugins shortcuts
-----------------------------------------------------------
-- Vista Shortcuts
map('n', '<leader>v', ':Vista!!<CR>', default_opts) -- show Vista panel
-- nvim-tree
map('n', '<C-n>', ':NvimTreeToggle<CR>', default_opts) -- open/close
map('n', '<leader>q', ':NvimTreeRefresh<CR>', default_opts) -- refresh
-- Vista tag-viewer
map('n', '<C-m>', ':Vista!!<CR>', default_opts) -- open/close
-- Place Check box for To-Do style Lists
map('i','<C-z>', '- [ ] ', default_opts)
map('n', '<C-z>', '- [ ] ', default_opts)
--map('n','<C-x>', '<Esc>rX<Esc>', default_opts)
--map('n','<leader>x', '~~~', default_opts)
-- Vim Tmux Navigator
--map('n', '<leader>-', ':TmuxNavigateDown', default_opts)
map('n', '<leader>[', ':TmuxNavigateLeft', default_opts)
map('n', '<leader>]', ':TmuxNavigateRight', default_opts)