""" " -- keymapping that uses functionality of default Neovim " universal mappings {{{ " leader - space masterrace let g:mapleader = "\" " don't use arrows! noremap noremap noremap noremap " reload .vimrc nnoremap r :so $MYVIMRC " use to move between splits " using vim-tmux-navigator instead, see .tmux.conf " this way we can move between tmux splits and Neovim splits " nmap :wincmd h " nmap :wincmd j " nmap :wincmd k " nmap :wincmd l " }}} " normal mappings {{{ " open last buffer by double tapping " matches nicely with tmux which has the same effect by double tapping nnoremap " yank the whole line with Y nnoremap Y 0y$ " show and hide listchars nnoremap lch :set listchars=:set listchars+=tab:»\ ,trail:·,nbsp:× nnoremap lcs :set listchars+=tab:»\ ,trail:·,nbsp:×,eol:¬ " repeat last macro if in a Normal buffer nnoremap empty(&buftype) ? '@@' : '' " quit, quit!, write and xit quicker nnoremap q :quit nnoremap Q :quit! nnoremap w :write nnoremap x :xit " clear search nnoremap / :nohl " replace spaces with tabs or the other way around " :nohl because NERDTree bugs after replacing as of now nnoremap rt :%s/ /\t/g:nohl nnoremap rt :%s/\t/ /g:nohl nnoremap 9 :%s/\t/ /g:write " store relative line number jumps in the jumplist if they exceed a threshold " make j and k use strict linewise movements " nnoremap j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj' " nnoremap k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk' " f10 prints the current highlight rules for cursor selection nnoremap :echo 'hi<' . synIDattr(synID(line('.'),col('.'),1),'name') . '> trans<' \ . synIDattr(synID(line('.'),col('.'),0),'name') . '> lo<' \ . synIDattr(synIDtrans(synID(line('.'),col('.'),1)),'name') . '>' " location-list nnoremap o :lopen " quickfix nnoremap o :copen " }}} " visual mappings {{{ vnoremap :s/\%V'/ä/g:s/\%V[/å/g:s/\%V;/ö/g " }}} " terminal mappings {{{ if has('nvim') tnoremap tnoremap endif " }}}