" " Vim settings for @mscoutermarsh " " Settings in this file may depend on plugins, so let's install them first. " Not to be confused with the contents of ~/.vim/plugin/* which are " configuration options for each plugin and automatically loaded by Vim. source ~/.vim/plugin/plugins.vim " Set leader let mapleader = "," " Leader Mappings map w :update map q :qall map gs :Gstatus " Recently edited files map h :History " CtrlP use FZF (faster!) nnoremap :Files syntax on filetype plugin on autocmd Filetype scss if getfsize(@%) > 300 | setlocal syntax=OFF | endif augroup twig_ft au! autocmd BufNewFile,BufRead *.html.inky set syntax=eruby augroup END set autoread " Auto reload changed files set wildmenu " Tab autocomplete in command mode set backspace=indent,eol,start " http://vi.stackexchange.com/a/2163 set laststatus=2 " Show status line on startup set splitright " Open new splits to the right set splitbelow " Open new splits to the bottom set lazyredraw " Reduce the redraw frequency set ttyfast " Send more characters in fast terminals set nowrap " Don't wrap long lines set listchars=extends:→ " Show arrow if line continues rightwards set listchars+=precedes:← " Show arrow if line continues leftwards set nobackup nowritebackup noswapfile " Turn off backup files set noerrorbells novisualbell " Turn off visual and audible bells set expandtab shiftwidth=2 tabstop=2 " Two spaces for tabs everywhere set history=500 set hlsearch " Highlight search results set ignorecase smartcase " Search queries intelligently set case set incsearch " Show search results as you type set timeoutlen=1000 ttimeoutlen=0 " Remove timeout when hitting escape set showcmd " Show size of visual selection set termguicolors " Persistent undo set undodir=~/.vim/undo/ set undofile set undolevels=1000 set undoreload=10000 " Ignored files/directories from autocomplete (and CtrlP) set wildignore+=*/tmp/* set wildignore+=*.so set wildignore+=*.zip set wildignore+=*/vendor/bundle/* set wildignore+=*/node_modules/ "------------------------------------------------------------------------------- " Interface "------------------------------------------------------------------------------- set number " Enable line numbers set scrolloff=5 " Leave 5 lines of buffer when scrolling set sidescrolloff=10 " Leave 10 characters of horizontal buffer when scrolling "------------------------------------------------------------------------------- " Colors & Formatting "------------------------------------------------------------------------------- let g:material_style='oceanic' set background=dark colorscheme vim-material let g:airline_theme='material' " Showcase comments in italics highlight Comment cterm=italic gui=italic " Open most recently used files on start " autocmd VimEnter * Mru . " Easy tab navigation nnoremap :tabprevious nnoremap :tabnext " Golang specific settings let g:go_highlight_build_constraints = 1 let g:go_highlight_extra_types = 1 let g:go_highlight_fields = 1 let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_operators = 1 let g:go_highlight_structs = 1 let g:go_highlight_types = 1 let g:go_auto_type_info = 1 let g:go_fmt_command = "goimports" " Find/replace vnoremap "hy:%s/h//g nnoremap e :noh " let g:auto_save = 1 " enable AutoSave on Vim startup " let g:auto_save_in_insert_mode = 0 " do not save in insert mode " Get off my lawn - helpful when learning Vim :) nnoremap :echoe "Use Esc" nnoremap :echoe "Use h" nnoremap :echoe "Use l" nnoremap :echoe "Use k" nnoremap :echoe "Use j" nnoremap + :exe "resize " . (winheight(0) * 3/2) nnoremap - :exe "resize " . (winheight(0) * 2/3) let g:Tlist_WinWidth = 40 " "------------------------------------------------------------------------------- " Neovim-specific configurations "------------------------------------------------------------------------------- if has('nvim') let $NVIM_TUI_ENABLE_TRUE_COLOR=1 set termguicolors " Fix vim-tmux-navigator https://git.io/viGRU nmap h " Fix vim-tmux-navigator https://git.io/vS5QH nmap :TmuxNavigateLeft endif