syntax on " syntax highlighting set nocompatible " disable compatibility to old-time vi set mouse=v " middle-click paste with set number set nocompatible set hlsearch " highlight search set incsearch " incremental search set tabstop=4 " number of columns occupied by a tab set softtabstop=4 " see multiple spaces as tab stops so does the right thing set expandtab " converts tabs to white space set shiftwidth=4 " width for auto indents set autoindent " indent a new line the same amount as the line just typed set number " add line numbers set wildmode=longest,list " get bash-like tab completions set cc=100 " set an 100 column border for good coding style set mouse=a " enable mouse click set cursorline " highlight current cursorline set ttyfast " Speed up scrolling in Vim set fdm=indent " foldingmethod syntax set foldlevel=10 " only fold when a certain complexity is reached by default. This applies only at startup. set numberwidth=4 set timeout timeoutlen=400 set ttimeoutlen=0 " Avoid showing message extra message when using completion" set shortmess+=c filetype plugin indent on "allow auto-indenting depending on file type filetype plugin on let g:indentLine_char = '│' " add lines with double o noremap oo o noremap OO O " H and L for end and beginning nmap H ^ nmap L $ vmap H ^ vmap L $ " usefull functions for arrow keys " (and force the user to use hjkl) " right/left to add/remove a tab in the beginning of the line. nmap << nmap >> " same for visual mode (plus reselecting stuff for visual mode) vmap >gv " up and down move lines up and down nmap :m -2 nmap :m +1 " same for visual mode (plus reselecting stuff for visual mode) vmap :m -2 vmap :m +1 " hit f3 to toggle search highlighting" nnoremap :set hlsearch! nnoremap let mapleader=" " map t :echo "leader tested!" map h :noh " copy to Wayland clipboard when leader is used. (note, install gvim for this) vnoremap wy y :call system("wl-copy", @") nnoremap wY Y :call system("wl-copy", @") nnoremap wy y :call system("wl-copy", @") nnoremap wyy yy :call system("wl-copy", @") " copy to system clipboard when leader is used. (note, install gvim for this) vnoremap y "+y nnoremap Y "+Y nnoremap y "+y nnoremap yy "+yy " dont write the pasted upon stuff in visual mode into the register vnoremap p pgvy " open terminal with F12 nnoremap :terminal " vsplit with , then " map " :vsplit " split with , then %" map % :split " resize windows nnoremap :vertical resize +1 nnoremap :vertical resize -1 nnoremap :resize -1 nnoremap :resize +1 " spell checking set spell spelllang=en " go to last or next misspelled word nnoremap zn ]s nnoremap zN [s " same as above but only with bad words (unrecognized) nnoremap Zn ]S nnoremap ZN [S " mark correct with zg, mark bad with zw, undo with zug/zuw " correct with zc, default is z= but that sucks for qwertz keyboards nnoremap zc z=