if $TERM == "screen-256color" set termguicolors end call plug#begin('~/.config/nvim/plugged') " Plug 'craigemery/vim-autotag' " Plug 'klen/python-mode', {'for' : 'python'} Plug 'MarcWeber/vim-addon-mw-utils' " required lib Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " autocomplete async Plug 'SirVer/ultisnips' " snippets Plug 'airblade/vim-gitgutter', {'on' : 'GitGutterToggle'} " highlights git line status Plug 'alfredodeza/coveragepy.vim', {'for' : 'python'} " highlights code coverage Plug 'bling/vim-airline' " fancy statusline Plug 'christoomey/vim-tmux-navigator' " C-h,j,k,l navigation between tmux and vim Plug 'dietsche/vim-lastplace' " reopen a file the last place we were Plug 'fatih/vim-hclfmt' Plug 'fidian/hexmode' " view/edit binary as hex Plug 'fishbullet/deoplete-ruby', {'for' : 'ruby'} " autocomplete for ruby Plug 'honza/vim-snippets' " snippets Plug 'janko-m/vim-test', {'for' : ['python', 'ruby']} " runs tests Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " fuzzy file search Plug 'junegunn/fzf.vim' " fuzzy file search Plug 'junegunn/vader.vim' " test vimscript Plug 'kassio/neoterm' " terminal in neovim Plug 'majutsushi/tagbar' , {'on': 'TagbarToggle'} " a module map Plug 'mitsuhiko/vim-python-combined' " improved python syntax Plug 'morhetz/gruvbox' " colorscheme Plug 'nathanaelkane/vim-indent-guides' " highlight indent level Plug 'neomake/neomake' " async linter and highlighter Plug 'tomtom/tlib_vim', {'for' : ['python', 'ruby', 'html', 'css']} " library FIXME: document what requires Plug 'tpope/vim-commentary' " idiomatic line comment toggling vim syntax Plug 'tpope/vim-endwise' " better xml tag support Plug 'tpope/vim-fugitive' " git integration Plug 'tpope/vim-rails', {'for' : 'ruby'} " rails Plug 'tpope/vim-repeat' " repeat tpope vim syntax extensions Plug 'tpope/vim-surround' " idiomatic matching surrounding character vim syntax Plug 'tpope/vim-unimpaired' " pairs of extra key bindings Plug 'tpope/vim-vinegar' " better vim file browser Plug 'vim-scripts/AutoTag', {'on' : 'TagbarToggle'} " auto update local tags file call plug#end() " Colorscheme set background=dark let g:gruvbox_italic = 1 colorscheme gruvbox " Visual behavior set foldlevelstart=99 " show all folds set list listchars=tab:·\ ,trail:≁,nbsp:∝ " show whitespace and tabs as unicode set number " show linenumbers " set noautoindent " don't indent for me set showmatch matchtime=2 " show matching brackets set splitbelow " open vertical splits below the current pane set splitright " open horizontal splits right of the current pane set ttimeoutlen=10 " timeout to wait for followup keycodes set visualbell " use visual bell instead of beeping set wildmode=list:longest " when more than one match, list, match longest string " Tabs set expandtab shiftwidth=2 softtabstop=2 " Search set ignorecase " you MUST set this to get smart case search set smartcase " Together this means that searches are " case insensitive until you specify a capital " no magic nnoremap / /\M vnoremap / /\M " Normal mode bindings " `H` moves to first non-whitespace character on a line " `L` moves to the last non-blank character of the line " `Y` yanks from cursor to end of line nnoremap H ^ nnoremap L g_ nnoremap Y y$ " `C-h,j,k,l` switch pane focus nnoremap h nnoremap j nnoremap k nnoremap l " `C-p` runs FZF fuzzy file searcher nnoremap :FZF " `` shows syntax highlighting group under cursor nnoremap :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" " Terminal mode bindings " Allow switching from vim terminals tnoremap h tnoremap j tnoremap k tnoremap l " `` switches to Normal mode in terminal tnoremap " Insert mode binding " `` sends `` inoremap " Command mode binding " `:w!!` saves file as root cmap w!! w !sudo tee % " Leader bindings " as leader, shown here as " let mapleader = " " " `2` send line or selection to terminal vnoremap 2 :TREPLSendSelection nnoremap 2 :TREPLSendLine " `"'` switch " for ' nnoremap "' :s/\"/\'/g :nohls " `'"` switch ' for " nnoremap '" :s/\'/\"/g :nohls " `` clear search highlighting nnoremap :nohls " `H` convert selection ruby hashes to hash rockets (incomplete) nnoremap H :'<,'>s/:\(\w\+\)\s\+=>\s\+/\1: /g " `L` close location list nnoremap L :lclose " `M` close all folds nnoremap M zM " `R` open all folds nnoremap R zR " `T` open Tagbar, close on selection nnoremap T :TagbarOpenAutoClose " `W` strip trailing whitespace nnoremap W :%s/\s\+$//:let @/='' " `b` insert an IPython embed as breakpoint nnoremap b i__import__('IPython').embed() " `c` vim-test run nearest test to cursor nnoremap c :TestNearest " `ev` open vim config for editing in vertical split nnoremap ev :e $MYVIMRC " `f` vim-test run file as tests nnoremap f :TestFile " `g` toggle git status gutter nnoremap g :GitGutterToggle " `h` convert all ruby hashes to hash rockets (incomplete) nnoremap h :s/:\(\w\+\)\s\+=>\s\+/\1: /g " `ii` toggle vim-indent-guides nnoremap ii :IndentGuidesToggle " `l` show location list, usually populated with syntax checkers nnoremap l :lwindow " `m` fold more (increase) nnoremap m zm " `p` toggle paste mode nnoremap p :set paste! " `r` fold less (reduce) nnoremap r zr " `s` show coverage nnoremap s :Cov " `t` toggle Tagbar nnoremap t :TagbarToggle " `v` re-select previous paste nnoremap v `[v`] " `w` create vertical split nnoremap w v " Python language tab settings augroup python autocmd Filetype python setlocal expandtab shiftwidth=4 softtabstop=4 augroup END " vim-airline function! NeotermStatus() if exists("g:neoterm_statusline") return g:neoterm_statusline endif endfunc function! AirlineInit() call airline#parts#define_function('neoterm', 'NeotermStatus') let g:airline_section_warning = airline#section#create_right(['whitespace', 'neoterm']) endfunction " Python-mode settings " FIXME: cleanup or remove " let g:python_host_prog='/usr/bin/python' let g:python3_host_prog='/home/swoodworth/.local/share/virtualenvs/nvim-V95aoDmf/bin/python' " let g:python_host_prog='/home/seth/.local/share/virtualenvs/cg-analyticswarehouse-dDTs--V4/bin/python' let g:pymode_folding = 0 " vaC, vaM -- select class, method " b insert breakpoint let g:pymode_breakpoint_cmd = 'import ipdb; ipdb.set_trace() # XXX: breakpoint' let g:pymode_complete_on_dot = 0 let g:pymode_lint_ignore = "E501,E221,E302,E701" let g:pymode_virtualenv = 0 " completion via C-Space " g for jump to definition " FZF " CTRL-T open in new tab " CTRL-X open in horizontal split " CTRL-V open in vertical split let g:fzf_buffers_jump = 0 " Git gutter " ]c - next change, [c - prev change " hs - stage hunk " hs - stage hunk let g:gitgutter_enabled = 0 " Neomake autocmd! BufWritePost *.py Neomake pylint autocmd! BufWritePost *.rb Neomake let g:neomake_ruby_enabled_makers = ['rubocop'] let g:neomake_python_enabled_markers = ['pylint', 'python'] " Vim-rails " :A & :R jump to Alternate and Related files see: rails-alternate let ruby_fold = 1 let ruby_minlines = 500 let ruby_no_comment_fold = 1 let ruby_operators = 1 let ruby_space_errors = 1 " Neoterm let g:neoterm_size = 80 let g:neoterm_position = 'vertical' " let g:neoterm_autoscroll = 1 " command! -nargs=+ TT Topen | Ts let g:neoterm_repl_python = 'ipython --no-autoindent --simple-prompt' " Deoplete let g:deoplete#sources = {} let g:deoplete#sources.python = ['ultisnips' , 'buffer', 'tag' , 'member', 'omni'] let g:deoplete#sources.ruby = ['buffer', 'tag'] ", 'member', 'omni'] let g:deoplete#auto_completion_start_length = 3 let g:deoplete#max_list = 50 let g:deoplete#enable_at_startup = 1 " Ultisnips let g:UltiSnipsSnippetsDir='/home/seth/.config/nvim/snippets/' " Tagbar let g:tagbar_show_visibility = 1 " Universal Ctags rspec support let g:tagbar_type_ruby = { \ 'kinds' : [ \ 'm:modules', \ 'c:classes', \ 'd:describes', \ 'C:contexts', \ 'f:methods', \ 'F:singleton methods' \ ] \ } " Vim-test configuration let test#strategy = 'neoterm'