" " Vim configuration file (~/.vimrc) " 2009-2014, kolter " " This file is distributed in the hope that it will be useful, " but WITHOUT ANY WARRANTY " " {{{ Load Plugins call plug#begin('~/.vim/plugged') Plug 'junegunn/indentLine' Plug 'sjl/gundo.vim' Plug 'scrooloose/syntastic' Plug 'preservim/tagbar' Plug 'scrooloose/nerdtree' Plug 'bling/vim-airline' Plug 'kien/ctrlp.vim' Plug 'tpope/vim-fugitive' Plug 'airblade/vim-gitgutter' Plug 'gregsexton/gitv' Plug 'terryma/vim-multiple-cursors' Plug 'jlanzarotta/bufexplorer' Plug 'flazz/vim-colorschemes' Plug 'vim-scripts/comments.vim' Plug 'ervandew/supertab' Plug 'rstacruz/sparkup' Plug 'Lokaltog/vim-easymotion' Plug 'editorconfig/editorconfig-vim' Plug 'godlygeek/tabular' "Plug 'plasticboy/vim-markdown' Plug 'pearofducks/ansible-vim' Plug 'LaTeX-Box-Team/LaTeX-Box' Plug 'SirVer/ultisnips' Plug 'honza/vim-snippets' Plug 'rkitover/vimpager' Plug 'ryanoasis/vim-devicons' Plug 'rust-lang/rust.vim' Plug 'https://git.openics.org/kolter/vim-bindzone.git' call plug#end() " }}} " {{{ General Settings " Leader key let mapleader = "," " Filetypes Settings if has('autocmd') filetype plugin indent on "reload Vim config file after saving "autocmd BufWritePost $MYVIMRC :source $MYVIMRC "always limit the width for text files autocmd BufRead *.txt set tw=78 autocmd QuickFixCmdPre * botright cwindow 5 endif "Term settings (under tmux) if &term =~ '^screen' "tmux will send xterm-style keys when its xterm-keys option is on execute "set =\e[1;*A" execute "set =\e[1;*B" execute "set =\e[1;*C" execute "set =\e[1;*D" endif set nocompatible "no vi compatibility set history=1000 "command history size set undolevels=120 "undo levels count set autoread "notify file changes set autochdir "switch to the current file directory set clipboard+=unnamed "share system clipboard set backup "enable backups set backupdir=~/.vim/backups "backup directory set directory=~/.vim/tmp "directory to place swap files in "Encoding settings if has("multi_byte") if &termencoding == "" let &termencoding = &encoding endif set encoding=utf-8 setglobal fileencoding=utf-8 set fileencodings=utf-8,default,latin1,ucs-bom endif "Syntax highlight syntax on set t_Co=256 set bg=dark colorscheme nord " }}} " {{{ Interface Settings set title "show title set number "show line numbers set ruler "statusline for each window set visualbell t_vb= "visual beep set showcmd "show incomplete commands set confirm "raise a dialog asking what to do instead of failing "set mouse=a "enable mouse support set lazyredraw "do not redraw when running macros set ttyfast "fast terminal connection support set ttimeout set ttimeoutlen=100 set scrolloff=999 set sidescrolloff=5 set shortmess=a "abbreviations on status line set laststatus=2 "always statusline set wildmenu "display completion menu set wildmode=list:longest,list:full "content of completion menu "ignore some extensions while completing filename "set wildignore=*.o,*.so,,*.gz,*.bz2,*.tar,*.tgz,*.tbz2,*.png,*.jpg,*.jpeg,*.gif set wildchar= "wildcar expansion character set modeline "allow last lines of documents set vim mode set modelines=3 "number of lines to check for modelines " }}} " {{{ Keyboard Settings " fix home and end keys with some terminals if $TERM =~ '^screen-256color' map OH map! OH map OF map! OF endif " keep ctrl-a/ctrl-e for begining/end of line nmap I imap I vmap I nmap A imap A vmap A "reopen current file map :e! "using redraw to disable highlighted search patterns nnoremap :nohl "map F1 to open previous buffer nmap :bp imap :bpa "map F2 to open next buffer nmap :bn imap :bna imap nmap :tabprevious nmap :tabnext nmap :tabnew nmap :tabclose nmap :bw nmap :vsplit nmap :split "ctrl-$arrow to cycle around splitted windows map h map l map k map j "ident in visual mode keep selection vmap > >gv vmap <