From 780dcce32c622ad5b0027fe0931ee90d9a59073c Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Fri, 31 Jul 2020 18:02:13 +0200 Subject: [PATCH] Vim keybindings Set leader key. Add bindings for jumping on the same indentation level. Add bindings for more comfortable split view navigation. --- .config/vim/vimrc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.config/vim/vimrc b/.config/vim/vimrc index b40f190..d83221b 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -1,4 +1,6 @@ " Keybinds ########################################################################## +" Set leader key +let mapleader = "\" " Disable arrow keys noremap "" noremap! @@ -11,6 +13,17 @@ noremap! " Stop highlighting search result when pressing Return nnoremap :nohlsearch +" Indentation jump +" https://vim.fandom.com/wiki/Move_to_next/previous_line_with_same_indentation +noremap :call search('^'. matchstr(getline('.'), '\(^\s*\)') .'\%<' . line('.') . 'l\S', 'be') +noremap :call search('^'. matchstr(getline('.'), '\(^\s*\)') .'\%>' . line('.') . 'l\S', 'e') + +" Split view navigation +nnoremap h +nnoremap j +nnoremap k +nnoremap l + " Settings ########################################################################## " hybrid linenumbers set number relativenumber