" Visual settings set t_Co=16 set bg=dark highlight LineNr ctermfg=darkgrey " Disable beeping on console set belloff=all " Mouse settings set mouse=a " Line numbers set number set relativenumber " Amount of screen lines that should be visible above/below the cursor set scrolloff=5 " Wrap lines at word boundaries set linebreak " Syntax highlighting syntax on set hlsearch " Case insensitive search (except for when explicitly using uppercase letters) set ignorecase set smartcase " Indentation settings set smartindent set expandtab set shiftwidth=4 set softtabstop=-1 " Activate filetype plugin (e.g. for automatically using tabs instead of spaces in Makefiles) filetype plugin on " Syntax rules for custom file extensions/patterns autocmd BufNewFile,BufRead *.gitconfig set syntax=gitconfig autocmd BufNewFile,BufRead *.rasi set syntax=scss " Indentation for YAML (use 2 spaces) autocmd FileType yml,yaml setlocal sts=2 sw=2 " Do not insert comment leader when entering insert mode with 'o'/'O' in comment line autocmd BufNewFile,BufRead * set formatoptions-=o " Keyboard mappings " ----------------- nnoremap :nohl:diffupdate set pastetoggle= " Exit insert mode with jk inoremap jk " Quick exit with Ctrl-q nnoremap :q nnoremap Q " Quick save all open buffers with Ctrl-S nnoremap :wall inoremap :wall " Simple copy and paste to/from system clipboard with Ctrl-c in visual mode " and Ctrl-v in insert mode vnoremap "+y inoremap "+P " sudo-write with :w!! cnoremap w!! w !sudo tee >/dev/null % " Tab movement noremap :-tabmove noremap :+tabmove " Use comma (,) as a "modifier prefix" for alternative functions of regular " commands (e.g. yank to system clipboard) or for random shortcuts. noremap , " Prefix yank/delete/change/paste commands with "," to use system clipboard noremap ,y "+y noremap ,Y "+y$ noremap ,d "+d noremap ,D "+D noremap ,c "+c noremap ,C "+C noremap ,p "+p noremap ,P "+P