" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just " /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime " you can find below. If you wish to change any of those settings, you should " do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten " everytime an upgrade of the vim packages is performed. It is recommended to " make changes after sourcing debian.vim since it alters the value of the " 'compatible' option. " This line should not be removed as it ensures that various options are " properly set to work with the Vim-related packages available in Debian. runtime! debian.vim " Uncomment the next line to make Vim more Vi-compatible " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous " options, so any other options should be set AFTER setting 'compatible'. "set compatible " Vim5 and later versions support syntax highlighting. Uncommenting the next " line enables syntax highlighting by default. if has("syntax") syntax on endif " If using a dark background within the editing area and syntax highlighting " turn on this option as well set background=dark " Uncomment the following to have Vim jump to the last position when " reopening a file if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif " Uncomment the following to have Vim load indentation rules and plugins " according to the detected filetype. filetype plugin indent on " The following are commented out as they cause vim to behave a lot " differently from regular Vi. They are highly recommended though. set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set ignorecase " Do case insensitive matching set smartcase " Do smart case matching set incsearch " Incremental search set autowrite " Automatically save before commands like :next and :make set hidden " Hide buffers when they are abandoned set mouse=a " Enable mouse usage (all modes) set autoread set number set fileencodings=utf-8 set encoding=utf-8 " Fast saving nmap w :w! " Configure backspace so it acts as it should act set backspace=eol,start,indent set whichwrap+=<,>,h,l " Show matching brackets when text indicator is over them set showmatch " Enable syntax highlighting syntax enable "Highlight all search results set hlsearch " For paste text set pastetoggle= " Wrap lines set wrap " And treat log lones as break lines map j gj map k gk """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Files, backups and undo """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Turn backup off, since most stuff is in SVN, git et.c anyway... set nobackup set nowb set noswapfile " Set to auto read when a file is changed from the outside set autoread """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " => Text, tab and indent related """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Use spaces instead of tabs set expandtab " Be smart when using tabs ;) set smarttab set nofoldenable " 1 tab == 4 spaces set shiftwidth=2 set tabstop=2 set softtabstop=2 " Use 4 in python """""""""""""""""""""""""""""""" " => Map """""""""""""""""""""""" "Disable arrows" map map map map "" Map space to \ let mapleader = "\" "move between splits" nnoremap nnoremap nnoremap nnoremap " Switch to alternate file map :bnext map :bprevious " This replaces :tabnew which I used to bind to this mapping nmap T :enew " " " Move to the next buffer nmap l :bnext " " " Move to the previous buffer nmap h :bprevious " " " Close the current buffer and move to the previous one " " This replicates the idea of closing a tab nmap bq :bp bd # " " " Show all open buffers and their status nmap bl :ls "Copy with mouse visual" ":noremap "+y" "" OPen file nnoremap o :CtrlP "" Savefile nnoremap w :w "" Duplicate line nnoremap t :t. "" quit nnoremap q :q "" Save and quit nnoremap wq :wq map I# nmap "+gP imap i vmap "+y " Find trailing whitspace match ErrorMsg '\s\+$' "Remove trailing spaces with \rt nmap rt :%s/\s\+$// " CTRL-T and CTRL-D indent and unindent blocks inoremap nnoremap vnoremap > vnoremap " To save, ctrl-s. nmap :w imap :wa " Remove ctrl q" nnoremap Q ZZ " source $MYVIMRC reloads the saved $MYVIMRC nmap s :source $MYVIMRC " opens $MYVIMRC for editing, or use :tabedit $MYVIMRC nmap v :e $MYVIMRC set clipboard=unnamedplus " """""""""""""""""""""""""""""""" " => NeoBUndle """""""""""""""""""""""" "NeoBundle Scripts----------------------------- if has('vim_starting') set nocompatible " Be iMproved " Required: set runtimepath+=~/.vim/bundle/neobundle.vim/ endif " Required: call neobundle#begin(expand('~/.vim/bundle')) " Let NeoBundle manage NeoBundle " Required: NeoBundleFetch 'Shougo/neobundle.vim' " My Bundles here: NeoBundle 'terryma/vim-expand-region' vmap v (expand_region_expand) vmap (expand_region_shrink) NeoBundle 'Shougo/neosnippet.vim' NeoBundle 'Shougo/neosnippet-snippets' NeoBundle 'tpope/vim-git' NeoBundle 'tpope/vim-fugitive' NeoBundle 'kien/ctrlp.vim' NeoBundle 'flazz/vim-colorschemes' NeoBundleLazy 'nathanaelkane/vim-indent-guides' " color indentation NeoBundle 'scrooloose/nerdtree' "NeoBundle 'Valloric/YouCompleteMe', { "" \ 'build' : { "" \ 'mac' : './install.sh --clang-completer --system-libclang --omnisharp-completer', "" \ 'unix' : './install.sh --clang-completer --system-libclang --omnisharp-completer', "" \ 'windows' : './install.sh --clang-completer --system-libclang --omnisharp-completer', "" \ 'cygwin' : './install.sh --clang-completer --system-libclang --omnisharp-completer' "" \ } "" \ } "NeoBundle 'Valloric/YouCompleteMe', { " \ 'build' : { " \ 'mac' : './install.sh', " \ }, " \ } " Syntax checker NeoBundle 'scrooloose/syntastic' NeoBundle 'vim-ruby/vim-ruby' "Ruby NeoBundle 'tpope/vim-endwise' "Add endif, end and other stuff ""NeoBundleLazy 'masudaK/vim-python' NeoBundle 'klen/python-mode' " Show gitdiff NeoBundle 'airblade/vim-gitgutter' " Disable plugins for LargeFile NeoBundle 'vim-scripts/LargeFile' NeoBundle 'vim-scripts/DoxygenToolkit.vim' "Generate doxygen NeoBundle 'davidhalter/jedi-vim' "Generate doxygen NeoBundle 'ervandew/supertab' "SuperTab NeoBundle 'sukima/xmledit.git' "xmledit NeoBundle 'yuroyoro/vim-autoclose' NeoBundle 'tpope/vim-endwise' NeoBundle 'scrooloose/nerdcommenter' "Comment out lines or blocks NeoBundle 'nathanaelkane/vim-indent-guides' "Shows indents NeoBundle 'nelstrom/vim-visual-star-search' "Search for visual with * NeoBundle 'vim-airline/vim-airline' "For the status line NeoBundle 'vim-airline/vim-airline-themes' "For the status line NeoBundle 'bling/vim-bufferline' "NeoBundle 'fholgado/minibufexpl.vim' NeoBundle 'altercation/vim-colors-solarized' NeoBundle 'ujihisa/unite-colorscheme' NeoBundle 'docunext/closetag.vim.git' NeoBundle 'skammer/vim-css-color' NeoBundle 'StanAngeloff/php.vim' NeoBundle 'mattn/emmet-vim/' NeoBundle 'vim-scripts/keepcase.vim' " Javascript NeoBundle 'othree/yajs.vim' NeoBundle 'othree/javascript-libraries-syntax.vim' NeoBundle 'bigfish/vim-js-context-coloring' NeoBundle 'vim-scripts/SyntaxComplete' " Arduino NeoBundle 'sudar/vim-arduino-syntax' ""NeoBundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'} " For the line in the bottom " You can specify revision/branch/tag. NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' } " Ctags" NeoBundle 'xolox/vim-easytags' NeoBundle 'majutsushi/tagbar' NeoBundle 'xolox/vim-misc' " Required: call neobundle#end() " Required: filetype plugin indent on " If there are uninstalled bundles found on startup, " this will conveniently prompt you to install them. NeoBundleCheck "End NeoBundle Scripts------------------------- "let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict' nnoremap :exec '!python' shellescape(@%, 1) """""""""""""""""""""""""""""""" " => Javascript """""""""""""""""""""""" let g:used_javascript_libs = 'angularjs,angularui,underscore' """""""""""""""""""""""""""""""" " => Easytags """""""""""""""""""""""" set tags=./tags;,tags; let g:easytags_file = '~/.vim/tags' let g:easytags_dynamic_files = 0 let g:easytags_always_enabled = 0 """""""""""""""""""""""""""""""" " => Tagbar """""""""""""""""""""""" nmap :TagbarToggle """""""""""""""""""""""""""""""" " => GitGutter """""""""""""""""""""""" """ IF SLOW """ "let g:gitgutter_realtime = 0 "let g:gitgutter_eager = 0 """""""""""""""""""""""""""""""" " => Emmet """""""""""""""""""""""" let g:user_emmet_install_global = 0 autocmd FileType html,css EmmetInstall """""""""""""""""""""""""""""""" " => php.vim """""""""""""""""""""""" function! PhpSyntaxOverride() hi! def link phpDocTags phpDefine hi! def link phpDocParam phpType endfunction augroup phpSyntaxOverride autocmd! autocmd FileType php call PhpSyntaxOverride() augroup END """""""""""""""""""""""""""""""" " => closetag """""""""""""""""""""""" autocmd FileType html,htmldjango,jinjahtml,eruby,mako let b:closetag_html_style=1 autocmd FileType html,htmldjango,jinjahtml,eruby,mako source ~/.vim/bundle/closetag.vim/plugin/closetag.vim """""""""""""""""""""""""""""""" " => xmledit """""""""""""""""""""""" autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags noci """""""""""""""""""""""""""""""" " => vim-airline """""""""""""""""""""""" let g:airline_theme='wombat' let g:airline#extensions#tabline#enabled = 1 " Show just the filename let g:airline#extensions#tabline#fnamemod = ':t' let g:airline#extensions#tabline#left_sep = ' ' let g:airline#extensions#tabline#left_alt_sep = '|' let g:airline#extensions#syntastic#enabled = 1 """""""""""""""""""""""""""""""" " => vim-indent_guides """""""""""""""""""""""" colorscheme railscasts set t_Co=256 let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_guide_size = 1 let g:indent_guides_start_level = 2 """""""""""""""""""""""""""""""" " => ctrl-p """""""""""""""""""""""" let g:ctrlp_map = '' let g:ctrlp_cmd = 'CtrlPMixed' let g:ctrlp_working_path_mode = 'c' noremap :CtrlP /yourdir/ set wildignore+=*/tmp/*,*.so,*.swp,*.zip " Try to ignore virtualenv, maybe to much :) let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/](lib|htmlcov|bin|include|local|share|test|unittest)|(\.(git|hg|svn))$', \ 'file': '\v\.(exe|so|dll)$', \ 'link': 'some_bad_symbolic_links', \ } """""""""""""""""""""""""""""""" " => LatexBox """""""""""""""""""""""" "let g:LatexBox_latexmk_options = "-pvc -pdfps" """""""""""""""""""""""""""""""" " => Vim-Ruby """""""""""""""""""""""" imap end-cc autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 """""""""""""""""""""""""""""""" " => Jedi-vim """""""""""""""""""""""" let g:jedi#goto_assignments_command = "g" let g:jedi#goto_definitions_command = "d" let g:jedi#documentation_command = "K" let g:jedi#usages_command = "n" let g:jedi#completions_command = "" let g:jedi#rename_command = "r" let g:jedi#show_call_signatures = "1" let g:jedi#popup_on_dot = 0 """""""""""""""""""""""""""""""" " => Syntatstic """""""""""""""""""""""" "E111 = Indention is not a mulitple of four let g:syntastic_sh_checkers = ['shellcheck', 'sh'] let g:syntastic_python_checkers = ['flake8'] let g:syntastic_python_flake8_args = '--ignore="E501,E302,E261,E701,E241,E126,E127,E128,W801,E111,E206"' let g:syntastic_always_populate_loc_list = 1 let g:syntastic_auto_loc_list = 1 """""""""""""""""""""""""""""""" " => NERDTree """""""""""""""""""""""" "Autostart Nerdtree "autocmd vimenter * NERDTree autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif map :NERDTree """""""""""""""""""""""""""""""" " => YouComplteMe """""""""""""""""""""""" let g:ycm_autoclose_preview_window_after_completion=1 let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/arduino/.ycm_extra_conf.py' nnoremap g :YcmCompleter GoToDefinitionElseDeclaration """""""""""""""""""""""""""""""" " => easymotion """""""""""""""""""""""" let g:EasyMotion_do_mapping = 0 " Disable default mappings " Bi-directional find motion " Jump to anywhere you want with minimal keystrokes, with just one key binding. " `s{char}{label}` nmap s (easymotion-s) " or " `s{char}{char}{label}` " Need one more keystroke, but on average, it may be more comfortable. nmap s (easymotion-s2) " Turn on case sensitive feature let g:EasyMotion_smartcase = 1 " JK motions: Line motions map j (easymotion-j) map k (easymotion-k) """""""""""""""""""""""""""""" " => Status line """""""""""""""""""""""""""""" " Always show the status line set laststatus=2 " Format the status line "set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l if has('gui_running') set guioptions-=T " no toolbar colorscheme elflord endif " Source a global configuration file if available if filereadable("/etc/vim/vimrc.local") source /etc/vim/vimrc.local endif