From 16d566da938b049dda8998beec43e3cd85c4ed47 Mon Sep 17 00:00:00 2001 From: cafebabe <77344710+yuzu-eva@users.noreply.github.com> Date: Sat, 21 May 2022 23:33:01 +0200 Subject: Add nvim configuration --- .config/nvim/lua/user/keymaps.lua | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .config/nvim/lua/user/keymaps.lua (limited to '.config/nvim/lua/user/keymaps.lua') 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', 'Q', ':bufdo bdelete') + +-- Allow gf to open non-existant files +keymap('n', 'gf', ':edit ') + +-- Quick navigation between splits +keymap('n', '', 'h') +keymap('n', '', 'j') +keymap('n', '', 'k') +keymap('n', '', 'l') + +-- Insert trailing ; or , from insert mode +keymap('i', ';;', 'A;') +keymap('i', ',,', 'A,') + +-- Open the current file in the default program +keymap('n', 'x', ':!xdg-open %') + +-- Resize with arrows +keymap('n', '', ':resize +2') +keymap('n', '', ':resize -2') +keymap('n', '', ':vertical resize -2') +keymap('n', '', ':vertical resize +2') + +-- Quickly escape to normal mode +keymap('i', 'jj', '') + +keymap('n', 'cd', ':cd %:p:h:pwd') + +keymap('n', 'E', ':EslintFixAll') -- cgit v1.2.3