set nocompatible " required filetype off " required """" VIM-PLUG call plug#begin('~/.vim/plugged') Plug 'tpope/vim-sensible' Plug 'nanotech/jellybeans.vim' Plug 'pangloss/vim-javascript' Plug 'kchmck/vim-coffee-script' Plug 'mtscout6/vim-cjsx' Plug 'mxw/vim-jsx' Plug 'elixir-lang/vim-elixir' Plug 'vim-ruby/vim-ruby' Plug 'lambdatoast/elm.vim' Plug 'tpope/vim-rails' Plug 'bling/vim-airline' Plug 'myusuf3/numbers.vim' Plug 'mhinz/vim-signify' Plug 'nathanaelkane/vim-indent-guides' Plug 'danro/rename.vim' Plug 'pbrisbin/vim-mkdir' Plug 'Lokaltog/vim-easymotion' Plug 'tpope/vim-characterize' Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'tpope/vim-eunuch' Plug 'majutsushi/tagbar' Plug 'honza/vim-snippets' Plug 'zhaocai/GoldenView.Vim' Plug 'tpope/vim-fugitive' Plug 'tpope/vim-vinegar' Plug 'ctrlpvim/ctrlp.vim' Plug 'simnalamburt/vim-mundo' Plug 'vim-ruby/vim-ruby' Plug 'tpope/vim-bundler' Plug 'tpope/vim-rails' Plug 'janko-m/vim-test' Plug 'tpope/vim-endwise' Plug 'benekastah/neomake' Plug 'Valloric/YouCompleteMe', { 'do': 'yes \| ./install.py --tern-completer' } Plug 'luochen1990/rainbow' call plug#end() filetype plugin indent on " required """ end vim-plug """" PLUGIN SETTINGS " YouCompleteMe nnoremap K :YcmCompleter GoTo nnoremap ˚ :YcmCompleter GoToDeclaration let g:ycm_goto_buffer_command = 'horizontal-split' let g:ycm_autoclose_preview_window_after_insertion = 1 " Easymotion map / (easymotion-sn) omap / (easymotion-tn) map n (easymotion-next) map N (easymotion-prev) let g:EasyMotion_landing_highlight = 0 " CtrlP " Use The Silver Searcher https://github.com/ggreer/the_silver_searcher if executable('ag') " Use Ag over Grep set grepprg=ag\ --nogroup\ --nocolor " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' " ag is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 endif let g:ctrlp_custom_ignore="node_modules\|\.git\|_build" " Mundo map u :MundoToggle " Indent guides let g:indent_guides_start_level = 2 " Syntastic let g:syntastic_quiet_messages = {'level': []} " do NOT silence warnings let g:syntastic_aggregate_errors = 1 " Neomake " elixir maker executes code, jesus let g:neomake_elixir_enabled_makers = [] autocmd! BufWritePost * Neomake " NERDTree / netrw let g:netrw_liststyle = 3 " let netrw look like NERDTree " Rainbow parentheses let g:rainbow_conf = { \ 'guifgs': ['RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3'], \ 'ctermfgs': ['red', 'brown', 'blue', 'gray', 'green', 'magenta', 'cyan', 'darkred', 'brown', 'darkblue', 'gray', 'darkgreen', 'darkmagenta', 'darkcyan', 'red'], \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'] \} let g:rainbow_active = 1 " Vim-Test nmap t :TestNearest nmap T :TestFile nmap a :TestSuite nmap l :TestLast nmap g :TestVisit if has('nvim') let test#strategy = "neovim" endif " UltiSnips let g:UltiSnipsUsePythonVersion = 2 " required for YCM compat let g:ulti_expand_or_jump_res = 0 function! ExpandSnippetOrCarriageReturn() let snippet = UltiSnips#ExpandSnippetOrJump() if g:ulti_expand_or_jump_res > 0 return snippet else return "\" endif endfunction " IndentGuides let g:indent_guides_enable_on_vim_startup = 1 " GoldenView autocmd BufRead * EnableGoldenViewAutoResize let g:goldenview__enable_default_mapping = 0 """" END PLUGIN SETTINGS let mapleader="," set nobackup set noswapfile set pastetoggle= set nowrap syntax on filetype on filetype plugin indent on try colorscheme jellybeans catch " deal with it endtry set t_Co=256 if &term =~ 'xterm-color' set t_ut= endif set nocompatible set laststatus=2 if v:version >= 703 "undo settings set undodir=~/.vim/undofiles set undofile let &colorcolumn="80,".join(range(120,999), ",") endif set hidden set showmode set number set numberwidth=1 set background=dark set cursorline set cursorcolumn set ruler " do not redraw while macroing set lazyredraw set matchpairs+=<:> set list set listchars=tab:>-,trail:-,extends:>,precedes:<,nbsp:+,eol:$ set ts=2 set shiftwidth=2 set expandtab " Open new split panes to right and bottom, which feels more natural set splitbelow set splitright " Use the OS clipboard by default (on versions compiled with `+clipboard`) set clipboard=unnamed """ Searching and Patterns set ignorecase set smartcase set smarttab set hlsearch " Add the g flag to search/replace by default set gdefault """ Folding set nofoldenable "recalculate the trailing whitespace warning when idle, and after saving autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning " strip trailing whitespace autocmd BufWritePre * :%s/\s\+$//e """ Handy remaps noremap ; : inoremap jj map V :source ~/.vimrc:filetype detect:exe ":echo 'vimrc reloaded'" map \q :q map \w :w noremap Q "terminal remaps if has('nvim') tnoremap nnoremap o :below 10sp term://$SHELLi endif " Quicker window movement nnoremap j nnoremap k nnoremap h nnoremap l " Don’t reset cursor to start of line when moving around. set nostartofline " minimal number of lines to keep above/below cursorline set scrolloff=10 """ Use the mouse set mouse=a """ smart path set path=.,,** " Local overrides? if filereadable($HOME . "/.vimrc.local") source ~/.vimrc.local endif