diff options
| author | cafebabe <77344710+yuzu-eva@users.noreply.github.com> | 2022-05-21 23:33:01 +0200 |
|---|---|---|
| committer | cafebabe <77344710+yuzu-eva@users.noreply.github.com> | 2022-05-21 23:33:01 +0200 |
| commit | 16d566da938b049dda8998beec43e3cd85c4ed47 (patch) | |
| tree | e138daaf0e6496f2f72659766f54544cda9c1245 /.config/nvim/lua/user/keymaps.lua | |
| parent | 5825759403e9f316c03c771f64a89ac89547b4de (diff) | |
Add nvim configuration
Diffstat (limited to '.config/nvim/lua/user/keymaps.lua')
| -rw-r--r-- | .config/nvim/lua/user/keymaps.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.config/nvim/lua/user/keymaps.lua b/.config/nvim/lua/user/keymaps.lua new file mode 100644 index 0000000..14c4b2c --- /dev/null +++ b/.config/nvim/lua/user/keymaps.lua @@ -0,0 +1,35 @@ +local keymap = require 'lib.utils'.keymap + +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +keymap('n', '<leader>Q', ':bufdo bdelete<CR>') + +-- Allow gf to open non-existant files +keymap('n', 'gf', ':edit <cfile><CR>') + +-- Quick navigation between splits +keymap('n', '<c-h>', '<c-w>h') +keymap('n', '<c-j>', '<c-w>j') +keymap('n', '<c-k>', '<c-w>k') +keymap('n', '<c-l>', '<c-w>l') + +-- Insert trailing ; or , from insert mode +keymap('i', ';;', '<Esc>A;<Esc>') +keymap('i', ',,', '<Esc>A,<Esc>') + +-- Open the current file in the default program +keymap('n', '<leader>x', ':!xdg-open %<CR><CR>') + +-- Resize with arrows +keymap('n', '<C-Up>', ':resize +2<CR>') +keymap('n', '<C-Down>', ':resize -2<CR>') +keymap('n', '<C-Left>', ':vertical resize -2<CR>') +keymap('n', '<C-Right>', ':vertical resize +2<CR>') + +-- Quickly escape to normal mode +keymap('i', 'jj', '<Esc>') + +keymap('n', '<leader>cd', ':cd %:p:h<CR>:pwd<CR>') + +keymap('n', '<leader>E', ':EslintFixAll<CR>') |
