set nocompatible filetype off " Plugins set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' " Tags Plugin 'xolox/vim-misc' Plugin 'xolox/vim-easytags' Plugin 'majutsushi/tagbar' " Templates Plugin 'aperezdc/vim-template' " Selection expand Plugin 'terryma/vim-expand-region' Plugin 'kana/vim-textobj-user' Plugin 'kana/vim-textobj-line' Plugin 'kana/vim-submode' " Better Pasting Plugin 'ConradIrwin/vim-bracketed-paste' " Tmux navigation Plugin 'christoomey/vim-tmux-navigator' " YouCompleteMe Plugin 'Valloric/YouCompleteMe' Plugin 'rdnetto/YCM-Generator' " Git Plugin 'tpope/vim-fugitive' " Comments Plugin 'scrooloose/nerdcommenter' " Surround Plugin 'tpope/vim-surround' " Snippets " Track the engine. Plugin 'SirVer/ultisnips' " Snippets are separated from the engine. Add this if you want them: Plugin 'honza/vim-snippets' Plugin 'ervandew/supertab' "Buftabeline "Plugin 'ap/vim-buftabline' " Highlight matching xml tags Plugin 'Valloric/MatchTagAlways' "Javascript Plugin 'pangloss/vim-javascript' " Tex Plugin 'lervag/vimtex' "Go Plugin 'fatih/vim-go' call vundle#end() filetype plugin indent on set cinkeys-=0# " Terminal emulator settings set t_Co=256 set term=screen-256color " Color configuration colorscheme badwolf " some color .. syntax enable " enable syntax processing " Disable annoying bell set noerrorbells " Allow modelines at the beginning and end of a file set modeline " Key configuration let mapleader = "\" " Make space the leader key nnoremap w :w| " Write file nnoremap q :q| " Close file nnoremap s :w !sudo tee %L nmap V| " Change to visual line mode map q: :q| " No command history nmap O | " Add line above nmap o| " Add line below nmap f gq}| " Format paragraph " Window management nmap mt :tab sp | " maximize window to new tab nmap . = | " Split windows equally map gb :bnext map gB :bNext call submode#enter_with('grow/shrink', 'n', '', 'r', '') call submode#map('grow/shrink', 'n', '', '+', '+') call submode#map('grow/shrink', 'n', '', '-', '-') call submode#map('grow/shrink', 'n', '', '<', '<') call submode#map('grow/shrink', 'n', '', '>', '>') set splitbelow set splitright "disable submode timeouts: let g:submode_timeout = 0 " don't consume submode-leaving key let g:submode_keep_leaving_key = 1 " Configuration of spaces and tabs set tabstop=4 " show 4 spaces per TAB set softtabstop=4 " insert 4 spaces per TAB set smarttab set expandtab " tabs are spaces set shiftwidth=4 " UI set number " show line numbers set relativenumber "relative line numbers set showcmd " show last command in bottom bar set cursorline " highlight current line " Statusline set statusline+=%f\ " show Filepath set statusline+=[%{strlen(&fenc)?&fenc:'none'}] "file encoding set statusline+=%m%r " Modified and read only flag set statusline+=%= " align left set statusline+=%y " show Filetype set statusline+=[%{&fo}] " Show format options set laststatus=2 " always show statusline " Filetypes filetype on " filetype detection on filetype indent on " filetype-specific indent .vim/indent/ filetype plugin on " filteype plugins in .vim/ftplugins set smartindent set wildmenu " visual autocomplete for command menu set lazyredraw " redraw only when necessary set showmatch " highlight matching brackets set mouse=a " Mouse control " Searching set incsearch " search while entering set hlsearch " highlight matches nnoremap h :set hlsearch! set ignorecase set smartcase " Line wrapping set tw=79 " set textwidth of 80 characters set formatoptions-=t " Don't wrap code set formatoptions+=c " Wrap comments set formatoptions+=mB " Don't break multibyte characters set formatoptions+=j " Remove multiple comment markers function TextWrapToggle() if &fo =~'t' setlocal fo-=t else setlocal fo+=t endif let formatoptions = &formatoptions echom formatoptions endfunction nmap t :call TextWrapToggle() " Highlight characters past 80 "augroup vimrc_autocmds "autocmd BufEnter * highlight OverLength ctermbg=88 guibg=#592929 "autocmd BufEnter * match OverLength /\%81v.*/ "augroup END "Copying set clipboard=unnamedplus,unnamed " Copy/Paste " TagBar nmap :TagbarToggle imap :TagbarTogglegi nmap T " YouCompleteMe let g:ycm_collect_identifiers_from_tags_files = 1 " Read from tag files let g:ycm_global_ycm_extra_conf = '~/.vim/.ycm_extra_conf.py' " Standard conf let g:ycm_enable_diagnostic_signs = 0 " Do not show semantic error bar let g:ycm_server_python_interpreter = '/usr/bin/python' let g:ycm_key_list_select_completion = ['', '', ''] let g:ycm_key_list_previous_completion = ['', '', ''] "Tags let g:easytags_async = 1 " make autocmd QuickFixCmdPre make set cmdheight=2 "autocmd QuickFixCmdPost make nested cwindow "Open the quickfix window "autocmd QuickFixCmdPost make nested lwindow "Change to the quickfix window set switchbuf=split nmap :silent! make:redraw! nmap m :silent! make:redraw! nmap x :silent! make ex:redraw! imap :make:redraw!i " vim-templates config-file try source ~/.vim/.vimrc_config_template catch " Ignore non existing file endtry " Expand region vmap v (expand_region_expand) vmap (expand_region_shrink) " Snippets let g:SuperTabDefaultCompletionType = '' let g:SuperTabCrMapping = 0 let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" let g:UltiSnipsEditSplit="vertical" set rtp+=~/.vim/my-snippets try source ~/.vim/.vimrc_config_expand_region catch " Ignore non existing file endtry " Powerline try source ~/.vim/.vimrc_config_powerline catch " Ignore non existing file endtry " Extra stuff try source ~/.vim/.vimrc_config_extra_stuff catch " Ignore non existing file endtry