" " vim-plug " call plug#begin('~/.vim/plugged') Plug 'tpope/vim-sensible' Plug 'justinmk/vim-dirvish' Plug 'vim-scripts/bufexplorer.zip' Plug 'ctrlpvim/ctrlp.vim' Plug 'airblade/vim-gitgutter' Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'tpope/vim-eunuch' Plug 'dense-analysis/ale' Plug 'https://gitlab.com/protesilaos/tempus-themes-vim.git' call plug#end() " " behavior " set nocompatible " use vim, not vi settings set wildignore=*.pyc,.git " ignore from autocomplete set showcmd " display incomplete commands set ignorecase " ignore case in search set smartcase " respect case in search if uppercase is used set nowrap " do not wrap lines set vb t_vb= " no beeping " " formatting " set tabstop=4 set softtabstop=4 set shiftwidth=4 set expandtab set shiftround set listchars=tab:»·,trail:· set list " " filetype-specific " if has("autocmd") au! au FileType text setlocal tw=80 ts=2 sw=2 sts=2 au FileType markdown setlocal tw=80 ts=2 sw=2 sts=2 au FileType html setlocal ts=2 sw=2 sts=2 au FileType xhtml setlocal ts=2 sw=2 sts=2 au FileType ruby setlocal ts=2 sw=2 sts=2 au FileType eruby setlocal ts=2 sw=2 sts=2 au FileType htmldjango setlocal ts=2 sw=2 sts=2 au FileType coffee setlocal ts=2 sw=2 sts=2 au FileType php setlocal ts=2 sw=2 sts=2 " text files au BufRead,BufNewFile *.txt setlocal filetype=text " markdown au BufRead,BufNewFile *.md setlocal filetype=markdown " html templates au BufRead,BufNewFile *.mako setlocal filetype=html au BufRead,BufNewFile *.ftl setlocal filetype=html au BufRead,BufNewFile *.handlebars setlocal filetype=html ts=4 sts=4 sw=4 " css templates au BufRead,BufNewFile *.less setlocal filetype=css " zsh configs and scripts au BufRead,BufNewFile *.zsh-overrides setlocal filetype=zsh au BufRead,BufNewFile *.zsh setlocal filetype=zsh " ruby files au BufRead,BufNewFile *.cap setlocal filetype=ruby " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler au BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif endif " " bindings " let mapleader = "," " convenience nnoremap x :source ~/.vimrc nnoremap nnoremap j nnoremap k nnoremap h nnoremap l " dirvish nnoremap e :Dirvish " bufexplore nnoremap fe :BufExplorer nnoremap fs :BufExplorerHorizontalSplit nnoremap fv :BufExplorerVerticalSplit " ctrlp let g:ctrlp_map ='a' " ale nnoremap r :ALEDetail " " visual " "Use 24-bit (true-color) mode in Vim/Neovim when outside tmux. "If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support "(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.) if (empty($TMUX)) if (has("nvim")) "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 > let $NVIM_TUI_ENABLE_TRUE_COLOR=1 endif "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 > if (has("termguicolors")) set termguicolors endif endif " kitty terminal doesn't support bg blanking " https://github.com/kovidgoyal/kitty/issues/108#issuecomment-320492663 if ($TERM == 'xterm-kitty') let &t_ut='' endif set background=light silent! colo tempus_dawn let g:airline_theme='papercolor' set hlsearch syntax enable " don't mess up gutter highlight with gitgutter highlight clear SignColumn hi! link SignColumn Background " Highlight non-ascii characters as the theme highlights errors hi clear nonascii hi link nonascii Error if has("autocmd") au BufReadPost * syntax match nonascii /[^\d0-\d127]/ endif " highlight trailing space and tab as the theme highlights errors hi clear SpecialKey hi link SpecialKey Error let g:airline_powerline_fonts = 1 let g:airline_left_sep="\uE0B4" let g:airline_right_sep = "\uE0B6" " set a font for gvim/macvim set guifont=SauceCodeProNerdFontComplete-Medium:h14 " " local additions " if filereadable($HOME."/.vimrc-local") source ~/.vimrc-local endif