Last active
September 30, 2016 19:59
-
-
Save amonks/95fe76e4f843c2355736 to your computer and use it in GitHub Desktop.
vimrc, using plug.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Andrew Monks' .vimrc | |
| " current version at https://gist.github.com/amonks/95fe76e4f843c2355736 | |
| " 9/30/16 | |
| set nocompatible | |
| " " " " " " " " " " " " " " " " " " " " " " " | |
| " plugins | |
| " | |
| " first do this: | |
| " $ curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| " | |
| " " " " " " " " " " " " " " " " " " " " " " " " | |
| call plug#begin('~/.vim/bundle') | |
| " Plug 'amonks/vim-coffee-script' | |
| " Plug 'berdandy/ansiesc.vim' | |
| " Plug 'godlygeek/tabular' " required for vim-markdown | |
| " Plug 'guns/vim-clojure-static' | |
| " Plug 'jelera/vim-javascript-syntax' | |
| " Plug 'othree/html5.vim' | |
| " Plug 'rkneufeld/vim-boot' | |
| " Plug 'sheerun/vim-polyglot' | |
| " Plug 'slim-template/vim-slim' | |
| " Plug 'tpope/vim-classpath' | |
| " Plug 'venantius/vim-eastwood' | |
| " Plug 'vim-pandoc/vim-pandoc' | |
| " Plug 'vim-pandoc/vim-pandoc-syntax' | |
| " Plug 'wavded/vim-stylus' | |
| Plug 'SirVer/ultisnips' | |
| Plug 'Valloric/YouCompleteMe' | |
| Plug 'Xuyuanp/nerdtree-git-plugin' | |
| Plug 'airblade/vim-gitgutter' | |
| Plug 'altercation/vim-colors-solarized' | |
| Plug 'amonks/vim-parinfer' | |
| Plug 'amperser/proselint', {'rtp': 'plugins/vim/syntastic_proselint/'} | |
| Plug 'ctrlpvim/ctrlp.vim' | |
| Plug 'dermusikman/sonicpi.vim' | |
| Plug 'digitaltoad/vim-jade' | |
| Plug 'easymotion/vim-easymotion' | |
| Plug 'editorconfig/editorconfig-vim' | |
| Plug 'flazz/vim-colorschemes' | |
| Plug 'hashivim/vim-terraform' | |
| Plug 'honza/vim-snippets' | |
| Plug 'isRuslan/vim-es6' | |
| Plug 'jlanzarotta/bufexplorer' | |
| Plug 'jplaut/vim-arduino-ino' | |
| Plug 'ledger/vim-ledger' | |
| Plug 'luochen1990/rainbow' | |
| Plug 'majutsushi/tagbar' | |
| Plug 'mattn/emmet-vim' | |
| Plug 'mxw/vim-jsx' | |
| Plug 'pangloss/vim-javascript' | |
| Plug 'plasticboy/vim-markdown' | |
| Plug 'rizzatti/dash.vim' | |
| Plug 'ryanoasis/vim-devicons' | |
| Plug 'scrooloose/nerdtree' | |
| Plug 'scrooloose/syntastic' | |
| Plug 'sudar/vim-arduino-syntax' | |
| Plug 'svermeulen/vim-easyclip' | |
| Plug 'tiagofumo/vim-nerdtree-syntax-highlight' | |
| Plug 'tpope/vim-commentary' | |
| Plug 'tpope/vim-eunuch' | |
| Plug 'tpope/vim-fireplace' | |
| Plug 'tpope/vim-rails' | |
| Plug 'tpope/vim-repeat' | |
| Plug 'tpope/vim-rsi' | |
| Plug 'tpope/vim-salve' | |
| Plug 'tpope/vim-sensible' | |
| Plug 'tpope/vim-speeddating' | |
| Plug 'tpope/vim-surround' | |
| Plug 'tpope/vim-unimpaired' | |
| Plug 'tpope/vim-vinegar' | |
| Plug 'venantius/vim-cljfmt' | |
| Plug 'vim-airline/vim-airline' | |
| Plug 'vim-airline/vim-airline-themes' | |
| Plug 'vim-ruby/vim-ruby' | |
| Plug 'wilsaj/chuck.vim' | |
| call plug#end() | |
| " " " " " " " " " " " " " " " " " " " " " " " " | |
| " editor | |
| " | |
| " " " " " " " " " " " " " " " " " " " " " " " " | |
| " I think this has to come before any mappings that use leader | |
| " tbh I don't think I've ever known the default leader key | |
| let mapleader = "," | |
| " enable syntax highlighting | |
| syntax enable | |
| " enable scrolling | |
| set mouse=a | |
| " save swp in ~/.vim-tmp | |
| set backup | |
| set swapfile | |
| set backupdir=~/.vim-tmp | |
| set directory=~/.vim-tmp | |
| " highlight the selected line | |
| set cursorline | |
| " show line numbers | |
| set number | |
| " be more verbose about stuff generally | |
| set showcmd | |
| " briefly highlight matching brackets on close/open | |
| set showmatch | |
| " Allow scrolling past the bottom of the document | |
| set scrolloff=1 | |
| " tabs! | |
| nnoremap th :tabfirst<CR> | |
| nnoremap tj :tabnext<CR> | |
| nnoremap tk :tabprev<CR> | |
| nnoremap tl :tablast<CR> | |
| nnoremap tt :tabedit<Space> | |
| nnoremap tn :tabnext<Space> | |
| nnoremap tm :tabm<Space> | |
| nnoremap td :tabclose<CR> | |
| nnoremap te :tabedit<Space>%<CR> | |
| " " set color for folded text, see chart | |
| " " https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg | |
| " hi Folded ctermbg=236 | |
| " make vim use bash for it's scripting stuff, fish isn't compatible | |
| set shell=/bin/bash | |
| " use spaces | |
| set shiftwidth=2 | |
| set softtabstop=2 | |
| " don't break mid word | |
| set linebreak | |
| "autoload vimrc changes | |
| augroup myvimrc | |
| au! | |
| au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif | |
| augroup END | |
| " ,f to format | |
| autocmd FileType clojure map <leader>f :Cljfmt<ENTER> | |
| " Use control-t to toggle the sidebar | |
| map <C-t> :NERDTreeToggle<CR> | |
| " dash | |
| nmap <silent> <leader>0 <Plug>DashSearch | |
| " Allow saving of files as sudo when I forgot to start vim using sudo. | |
| cmap w!! w !sudo tee > /dev/null % | |
| " no shift to enter commands, use semicolon | |
| nnoremap ; : | |
| vnoremap ; : | |
| "edit vimrc | |
| nnoremap rc :tabedit<Space>~/.vimrc<CR> | |
| " macvim font stuff | |
| set guifont=InconsolataForPowerline\ Nerd\ Font:h18 | |
| set linespace=10 | |
| " use gitignore for ctrlp | |
| let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] | |
| " use powerline in airline bar | |
| let g:airline_powerline_fonts = 1 | |
| " EASYCLIP CLIPBOARD MANAGER | |
| " I forget what this does | |
| let g:EasyClipUsePasteToggleDefaults = 0 | |
| " MAPPINGS | |
| nmap <c-t> <plug>EasyClipSwapPasteForward | |
| nmap <c-n> <plug>EasyClipSwapPasteBackwards | |
| " USE 'Reg' RATHER THAN 'Yanks' TO SHOW THE CLIPBOARD HISTORY | |
| " BECAUSE IT'S MORE LIKE NORMAL-VIM-WITHOUT-EASYCLIP | |
| :command Reg Yanks | |
| " or use "X" | |
| nnoremap X :Yanks<CR> | |
| " LOL IDK | |
| let g:EasyClipShareYanksFile = '.easyclip' | |
| " ALLOW PASTE OUTSIDE NORMAL MODE | |
| imap <c-v> <plug>EasyClipInsertModePaste | |
| cmap <c-v> <plug>EasyClipCommandModePaste | |
| " RAINBOW PARENTHESES | |
| " TODO set this automatically based on language. | |
| " or at least map a shortcut... | |
| " let g:rainbow_active = 1 | |
| " Colors I got off the internet somewhere | |
| let g:rainbow_conf = { 'ctermfgs': ['cyan', 'magenta', 'yellow', 'grey', 'red', 'green', 'blue'], 'guifgs': ['#FF0000', '#FF00FF', '#FFFF00', '#000000', '#FF0000', '#00FF00', '#0000FF'] } | |
| " ULTISNIPS SNIPPETS | |
| " Use ctrl-j to insert a snippet | |
| let g:UltiSnipsExpandTrigger="<c-j>" | |
| let g:UltiSnipsEditSplit="vertical" | |
| " SYNTASTIC LINTING | |
| " I'm not sure what any of these settings do, | |
| " I pasted them from somewhere | |
| set statusline+=%#warningmsg# | |
| set statusline+=%{SyntasticStatuslineFlag()} | |
| set statusline+=%* | |
| let g:syntastic_always_populate_loc_list = 1 | |
| let g:syntastic_auto_loc_list = 1 | |
| " When to check (always checks on save) | |
| " (or not if I type the shortcut '[[' to toggle) | |
| let g:syntastic_check_on_open = 1 | |
| let g:syntastic_check_on_wq = 1 | |
| nnoremap [[ :SyntasticToggleMode<CR> | |
| " Set gutter symbols | |
| let g:syntastic_error_symbol = '‚ùå' | |
| let g:syntastic_style_error_symbol = 'üö´' | |
| let g:syntastic_warning_symbol = '❗️' | |
| let g:syntastic_style_warning_symbol = 'üí©' | |
| " idk tbh | |
| highlight link SyntasticErrorSign SignColumn | |
| highlight link SyntasticWarningSign SignColumn | |
| highlight link SyntasticStyleErrorSign SignColumn | |
| highlight link SyntasticStyleWarningSign SignColumn | |
| " SyntasticToggle | |
| nnoremap [[ :SyntasticToggleMode<CR> | |
| " Lanugage-specific lint settings | |
| " Javascript | |
| let g:syntastic_javascript_checkers = ['standard'] | |
| let g:syntastic_javascript_standard_args = "--parser babel-eslint" | |
| " Markdown | |
| let g:syntastic_markdown_checkers = ['proselint'] | |
| " Html | |
| let g:syntastic_html_checkers = ['tidy'] | |
| let g:syntastic_html_exec = '/usr/local/bin/tidy' | |
| " Scss | |
| let g:syntastic_scss_checkers = ['scss_lint'] | |
| " Prose | |
| let g:syntastic_text_proselint_quiet_messages = { | |
| \ 'regex': [ | |
| \ 'curly_quotes', | |
| \ ] } | |
| " LANGUAGE STUFF | |
| " clojure | |
| au BufRead,BufNewFile build.boot setfiletype clojure | |
| let g:clj_fmt_autosave = 0 | |
| " Markdown | |
| " disable annoying code folding with vim-markdown | |
| " let g:vim_markdown_folding_disabled=1 | |
| " enable yaml front matter highlighting in vim-markdown | |
| let g:vim_markdown_frontmatter=1 | |
| " JSX | |
| " highlight jsx in regular .js files | |
| let g:jsx_ext_required = 0 | |
| " NERDTree | |
| " Highlight Everything | |
| let g:NERDTreeFileExtensionHighlightFullName = 1 | |
| let g:NERDTreeExactMatchHighlightFullName = 1 | |
| let g:NERDTreePatternMatchHighlightFullName = 1 | |
| " Show hidden files | |
| let NERDTreeShowHidden=1 | |
| " " Automatically open nerdrtee when I just type `vim` (rather than `vim .`) | |
| " " (This works poorly) | |
| " autocmd StdinReadPre * let s:std_in = 1 | |
| " autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif | |
| " COLOR SCHEME | |
| let g:airline_theme = 'solarized' | |
| set background=dark | |
| colorscheme solarized | |
| " enable ToggleBG command (which is mapped to 'cob' by vim-unimpaired) | |
| call togglebg#map("") | |
| " CUSTOM COMMANDS | |
| " titleize line | |
| :command TitleizeLine s/\<\(\w\)\(\S*\)/\u\1\L\2/g | |
| " titleize headers | |
| :command TitleizeHeader g/^#\+\s.*/TitleizeLine | |
| " detab | |
| :command Detab %s/\t/ /g | |
| " pandoc formatter | |
| :command Pando ! pando % /tmp/preview.pdf ; reattach-to-user-namespace open -a "Preview" /tmp/preview.pdf | |
| " marked 2 | |
| :command Mark ! reattach-to-user-namespace pando % | open -f -a "Marked 2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment