" *** *** *** Global Settings *** *** *** " *************************************** set expandtab set autowrite set showbreak=↪ set ignorecase set smartcase set list set listchars=tab:▸\ ,trail:·,nbsp:.,extends:❯,precedes:❮ set visualbell set number set relativenumber set backspace=indent,eol,start " Intuitive backspacing set hidden set iskeyword+=- " Add dashes to words set cpoptions+=$ " Don't delete the word, but put a $ to the end till exit the mode set title set shortmess=caoOtI " Welcome screen set tabstop=2 set shiftwidth=2 set softtabstop=2 set expandtab set copyindent set shiftround set mouse=a set clipboard=unnamedplus set nowrap set confirm set spelllang=de_de,en_us set timeoutlen=500 set signcolumn=yes:2 set foldmethod=syntax set splitbelow set splitright set scrolloff=8 set sidescrolloff=8 set virtualedit=all set cursorline set path+=** set nobackup set nowritebackup set noswapfile set undofile set redrawtime=10000 " Allow more time for loading syntax on large files set complete+=i,k,s,kspell set wildmode=longest:full,full " Spell Checker set spellfile+=~/.config/nvim/spell/de.utf-8.add " (1)zg, (1)zw set spellfile+=~/.vim/spell/en.utf-8.add " 2zg, 2zw " Custom Dictionaries ( ) set dictionary+=~/.config/nvim/dictionary/de_user.txt set dictionary+=~/.config/nvim/dictionary/de_neu.txt set dictionary+=~/.config/nvim/dictionary/en_us.txt " Custom Thesauri (Synonyms) ( ) set thesaurus+=~/.config/nvim/thesaurus/de_user.txt set thesaurus+=~/.config/nvim/thesaurus/de_openthesaurus.txt " *** *** *** Key Mappings *** *** *** " ************************************ let mapleader = "\" " Quick toggle between buffers noremap j :b# " Add semicolon or comma to the end of the line nnoremap ; A; nnoremap , A, " Delete last character of line nnoremap x $x " Open vim config in a new buffer, reload vim config nnoremap ve :e $MYVIMRC nnoremap vr :source $MYVIMRC " Delete all buffers nnoremap da :exec "1," . bufnr('$') . "bd" " Set spell checker to `s` " zg (good), zG (good temp), zw (wrong), zW (wrong temp) nnoremap s :set spell! " Switch off highlighting nnoremap h :nohlsearch " Toogle list nnoremap l :set list! " Indent the whole source code nnoremap ff gg=G'' " Reverse the mark mapping nnoremap ' ` nnoremap ` ' " Visuall select of just pasted content nnoremap gp `[v`] nnoremap gy `[v`]y " Open a quickfix window for the last search nnoremap ? :execute 'vimgrep /'.@/.'/g %':copen " Faster linewise scrolling noremap 3 noremap 3 " Keep the window centered noremap G Gzzzv noremap n nzzzv noremap N Nzzzv noremap } }zzzv noremap { {zzzv " Close all buffers nnoremap XX :qa " Add lines in NORMAL Mode nnoremap gn ok nnoremap gN Oj " Change to the folder of the current file nnoremap cf :cd %:p:h:pwd " Quickfix Window nnoremap qo :copen nnoremap qc :cclose " Navigation of buffers nnoremap n :bnext nnoremap p :bprev " Exit INSERT MODE with 'jk' inoremap jk " Reformat a line into a block nnoremap q gqip " Reformat a block into a line nnoremap qq vipJ " Easier split navigation nnoremap nnoremap nnoremap nnoremap " *** *** *** Functions *** *** *** " ********************************* " Toggle between soft wrap and no wrap nnoremap tw :call ToggleWrap() function! ToggleWrap() if &wrap echo "Wrap OFF" set nowrap set nolinebreak set virtualedit=all else echo "Wrap ON" set wrap set linebreak set virtualedit= setlocal display+=lastline endif endfunction