├── .vimrc └── README.md /.vimrc: -------------------------------------------------------------------------------- 1 | " Modeline and Notes { 2 | " 3 | " This is the personal vim config of Matthew Setter (aka settermjd). 4 | " 5 | " Author: Matthew Setter, http://matthewsetter.com/ 6 | " URL: https://github.com/settermjd/vim-configuration 7 | " 8 | " Special thanks to: 9 | " 10 | " - Evan Coury (aka EvanDotPro), Tom Oram (aka TomPHP) for their configs and support 11 | " in getting used to vim and learning how to do the basic configuration which I've 12 | " made here. 13 | " - All of the authors of the other amazing Vim plugins I use every day. 14 | " 15 | " } 16 | set nocompatible 17 | filetype off 18 | 19 | set rtp+=~/.vim/bundle/Vundle.vim 20 | call vundle#begin() 21 | 22 | " Bundles { 23 | 24 | " Let Vundle manage Vundle 25 | Bundle 'gmarik/vundle' 26 | 27 | " My Bundles 28 | Bundle 'tpope/vim-sensible' 29 | Bundle 'tpope/vim-unimpaired' 30 | Bundle 'tpope/vim-surround' 31 | Bundle 'tpope/vim-fugitive' 32 | Bundle 'tpope/vim-repeat' 33 | Bundle 'scrooloose/nerdtree' 34 | Bundle 'kien/ctrlp.vim' 35 | Bundle 'rking/ag.vim' 36 | Bundle 'bling/vim-airline' 37 | Bundle 'vim-airline/vim-airline-themes' 38 | Bundle 'devnul1/heman' 39 | Bundle 'majutsushi/tagbar' 40 | Bundle 'godlygeek/tabular' 41 | Bundle 'sandeepcr529/Buffet.vim' 42 | Bundle 'rbgrouleff/bclose.vim' 43 | Bundle 'terryma/vim-multiple-cursors' 44 | Bundle 'marijnh/tern_for_vim' 45 | Bundle 'SirVer/ultisnips' 46 | Bundle 'sniphpets/sniphpets' 47 | Bundle 'sniphpets/sniphpets-common' 48 | 49 | " Generally helpful plugins 50 | Bundle 'mbbill/undotree' 51 | 52 | " Development 53 | Bundle 'sheerun/vim-polyglot' 54 | Bundle 'vim-syntastic/syntastic' 55 | Bundle 'vim-ruby/vim-ruby' 56 | Bundle 'hallettj/jslint.vim' 57 | Bundle 'walm/jshint.vim' 58 | Bundle 'digitaltoad/vim-jade' 59 | Bundle 'guileen/vim-node' 60 | Bundle 'maksimr/vim-jsbeautify' 61 | Bundle 'einars/js-beautify' 62 | Bundle 'jelera/vim-javascript-syntax' 63 | Bundle 'nathanaelkane/vim-indent-guides' 64 | Bundle 'Raimondi/delimitMate' 65 | Bundle 'scrooloose/nerdcommenter' 66 | Bundle 'editorconfig/editorconfig-vim' 67 | Bundle 'phpactor/phpactor' 68 | Bundle 'udalov/kotlin-vim' 69 | Bundle 'ntpeters/vim-better-whitespace' 70 | Bundle 'mustache/vim-mustache-handlebars' 71 | Bundle 'phan/phan' 72 | 73 | " C/C++ Development 74 | Bundle 'Rip-Rip/clang_complete' 75 | 76 | " Go Development 77 | Bundle 'fatih/vim-go' 78 | Bundle 'nsf/gocode', {'rtp': 'vim/'} 79 | 80 | " PHP Development 81 | Bundle 'sumpygump/php-documentor-vim' 82 | Bundle 'spf13/PIV' 83 | Bundle 'stephpy/vim-php-cs-fixer' 84 | Bundle 'vim-php/vim-php-refactoring' 85 | "Bundle 'm2mdas/phpcomplete-extended' 86 | Bundle 'arnaud-lb/vim-php-namespace' 87 | Bundle 'StanAngeloff/php.vim' 88 | Bundle 'tomphp/vim-phpdoc' 89 | Bundle 'mikehaertl/pdv-standalone' 90 | Bundle 'Shougo/vimproc.vim', { 91 | \ 'build' : { 92 | \ 'windows' : 'tools\\update-dll-mingw', 93 | \ 'cygwin' : 'make -f make_cygwin.mak', 94 | \ 'mac' : 'make -f make_mac.mak', 95 | \ 'linux' : 'make', 96 | \ 'unix' : 'gmake', 97 | \ }, 98 | \ } 99 | Bundle 'Shougo/unite.vim' 100 | Bundle 'docteurklein/php-getter-setter.vim' 101 | 102 | " Twig/Slim 103 | Bundle 'lunaru/vim-twig' 104 | Bundle 'slim-template/vim-slim' 105 | 106 | " Version Control 107 | Bundle 'airblade/vim-gitgutter' 108 | 109 | " Themes 110 | Bundle 'vim-scripts/Solarized' 111 | Bundle 'fatih/molokai' 112 | Bundle 'nanotech/jellybeans.vim' 113 | Bundle 'jpo/vim-railscasts-theme' 114 | Bundle 'lokaltog/vim-distinguished' 115 | Bundle 'chriskempson/vim-tomorrow-theme' 116 | Bundle 'jacekd/vim-iawriter' 117 | Bundle 'rakr/vim-two-firewatch' 118 | Bundle 'dracula/vim' 119 | Bundle 'kamwitsta/nordisk' 120 | Bundle 'joshdick/onedark.vim' 121 | Bundle 'skreek/skeletor' 122 | 123 | " Writing plugins 124 | Bundle 'plasticboy/vim-markdown' 125 | Bundle 'dahu/vim-asciidoc' 126 | Bundle 'nelstrom/vim-markdown-folding' 127 | Bundle 'mikewest/vimroom' 128 | Bundle 'reedes/vim-pencil' 129 | Bundle 'reedes/vim-colors-pencil' 130 | Bundle 'reedes/vim-wordy' 131 | Bundle 'reedes/vim-lexical' 132 | Bundle 'kana/vim-textobj-user' 133 | Bundle 'reedes/vim-textobj-quote' 134 | Bundle 'reedes/vim-textobj-sentence' 135 | Bundle 'reedes/vim-litecorrect' 136 | " Add proof-reading and grammar support https://www.languagetool.org 137 | Bundle 'vim-scripts/LanguageTool' 138 | Bundle 'rhysd/vim-grammarous' 139 | Bundle 'laktek/distraction-free-writing-vim' 140 | Bundle 'christoomey/vim-titlecase' 141 | Bundle 'vim-voom/VOoM' 142 | Bundle 'Rykka/riv.vim' 143 | Bundle 'matcatc/vim-asciidoc-folding' 144 | " } 145 | call vundle#end() 146 | 147 | filetype plugin indent on " Automatically detect file types. 148 | 149 | let mapleader="," 150 | 151 | " General Configuration Settings { 152 | 153 | " gvim { 154 | " Clean up the GUI in Gvim & MacVim 155 | if has("gui_running") 156 | set guifont=Monaco:h12 157 | set guioptions-=r " Remove right scrollbar 158 | set guioptions-=T " Remove toolbar 159 | set lines=40 columns=100 " UI size 160 | set linespace=2 161 | set background=dark 162 | colorscheme pencil 163 | set guicursor+=n-v-c:blinkon0 " disable blinking in the cursor 164 | set guicursor+=i:blinkwait10 165 | set guicursor+=a:blinkon0 " disable blinking cursor in all modes 166 | else 167 | set background=dark 168 | colorscheme Tomorrow-Night 169 | endif 170 | " } 171 | 172 | " Clear the search results using ESC 173 | nnoremap :noh 174 | 175 | " Automatically set the background based on the time of day 176 | " Thanks to Benjamin Tan: http://goo.gl/UcErBh 177 | let hour = strftime("%H") 178 | if 6 <= hour && hour < 18 179 | set background=light 180 | else 181 | set background=dark 182 | endif 183 | 184 | syntax on " syntax highlighting 185 | set mouse=a " automatically enable mouse usage 186 | "set virtualedit=all " allow for cursor beyond last character 187 | set history=1000 " Store a ton of history (default is 20) 188 | set hidden " allow buffer switching without saving 189 | set number " display line numbers 190 | set cursorline " highlight the current line 191 | set expandtab 192 | set modelines=0 193 | set shiftwidth=2 194 | set clipboard=unnamed 195 | set synmaxcol=128 196 | set ttyscroll=10 197 | set encoding=utf-8 " set file encoding to utf-8, the only encoding to use 198 | set tabstop=4 199 | set nowrap " Don't wrap text by default 200 | set nowritebackup 201 | set noswapfile 202 | set nobackup 203 | set hlsearch 204 | set ignorecase 205 | set smartcase 206 | set smarttab 207 | set tags=tags 208 | set expandtab 209 | set autoindent 210 | set showcmd 211 | scriptencoding utf-8 212 | set encoding=utf-8 213 | set autowrite " Save on buffer switch 214 | set autoread " Check when a file is edited by another program 215 | set visualbell " disable beeping and visual notification 216 | 217 | " } 218 | 219 | " Plugins { 220 | " pdv-standalone { 221 | " use "" as parameter to turn tag off 222 | let g:pdv_cfg_php4guess=0 223 | let g:pdv_cfg_Package=" " 224 | let g:pdv_cfg_Author=" " 225 | let g:pdv_cfg_Version=" " 226 | " } 227 | 228 | " phpactor Omni-completion { 229 | autocmd FileType php setlocal omnifunc=phpactor#Complete 230 | 231 | " Include use statement 232 | map u :call phpactor#UseAdd() 233 | map o :call phpactor#GotoType() 234 | map pd :call phpactor#OffsetTypeInfo() 235 | map i :call phpactor#ReflectAtOffset() 236 | map pfm :call phpactor#MoveFile() 237 | map pfc :call phpactor#CopyFile() 238 | map tt :call phpactor#Transform() 239 | 240 | " Show information about "type" under cursor including current frame 241 | nnoremap d :call phpactor#OffsetTypeInfo() 242 | " } 243 | 244 | " airline { 245 | " don't enable the tabline (seems a bit confusing) 246 | let g:airline#extensions#tabline#enabled = 0 247 | let g:airline_section_y = 'BN: %{bufnr("%")}' 248 | let g:airline#extensions#branch#enabled = 0 249 | let g:airline#extensions#hunks#enabled = 0 250 | " } 251 | 252 | " padawan { 253 | let $PATH=$PATH . ':' . expand('~/.composer/vendor/bin') 254 | let g:padawan#composer_command = "/usr/local/bin/composer" 255 | " } 256 | 257 | " CtrlP { 258 | let g:ctrlp_max_files=50000 259 | " } 260 | 261 | " UltiSnips { 262 | " Trigger configuration. Do not use if you use 263 | " https://github.com/Valloric/YouCompleteMe. 264 | let g:UltiSnipsExpandTrigger="" 265 | let g:UltiSnipsJumpForwardTrigger="" 266 | let g:UltiSnipsJumpBackwardTrigger=""" 267 | " } 268 | 269 | " NERDTree 270 | nmap n :NERDTreeToggle 271 | let NERDTreeHighlightCursorline=1 272 | let NERDTreeIgnore = ['tmp', '.yardoc', 'pkg'] 273 | " } 274 | 275 | " vim-markdown { 276 | " Highlight YAML frontmatter as used by Jekyll 277 | let g:vim_markdown_frontmatter=1 278 | " } 279 | 280 | " Syntastic 281 | "let g:syntastic_mode_map = { 'mode': 'passive' } 282 | "let g:syntastic_ruby_exec = '~/.rvm/rubies/ruby-2.0.0-p0/bin/ruby' 283 | " } 284 | 285 | " } 286 | 287 | " Automatic settings { 288 | " Remove whitespace at the end of the line for certain file extensions 289 | autocmd BufWritePre *.rb :%s/\s\+$//e 290 | autocmd BufWritePre *.go :%s/\s\+$//e 291 | autocmd BufWritePre *.haml :%s/\s\+$//e 292 | autocmd BufWritePre *.html :%s/\s\+$//e 293 | autocmd BufWritePre *.scss :%s/\s\+$//e 294 | autocmd BufWritePre *.slim :%s/\s\+$//e 295 | autocmd BufWritePre *.rst :%s/\s\+$//e 296 | autocmd BufWritePre *.php :%s/\s\+$//e 297 | "autocmd BufEnter *.md :call SetMarkdownOptions() 298 | 299 | au BufNewFile * set noeol 300 | au BufRead,BufNewFile *.go set filetype=go 301 | 302 | " Configurations for Markdown files 303 | autocmd BufNewFile,BufReadPost *.md set filetype=markdown 304 | " 305 | " Automatically remove trailing whitespace on Markdown files 306 | autocmd BufWritePre *.md :%s/\s\+$//e 307 | 308 | " Also setting text files as Markdown, effectively, as the same rules 309 | " largely apply 310 | autocmd BufNewFile,BufReadPost *.txt set filetype=markdown 311 | 312 | " Configurations for PHP files 313 | autocmd BufNewFile,BufReadPost *.php set filetype=php 314 | "autocmd BufEnter *.php :call SetPhpOptions() 315 | 316 | " No show command 317 | autocmd VimEnter * set nosc 318 | 319 | " enable spell checking in git commit messages 320 | autocmd FileType gitcommit setlocal spell 321 | 322 | " PHP settings { 323 | " PHP shortcuts 324 | "autocmd FileType php inoremap -> 325 | "autocmd FileType php inoremap > => 326 | 327 | " phpDoc 328 | autocmd FileType php inoremap d :call PhpDocSingle()i 329 | autocmd FileType php nnoremap d :call PhpDocSingle() 330 | autocmd FileType php vnoremap d :call PhpDocRange() 331 | autocmd FileType php nnoremap :!php -l % 332 | 333 | " PHP Namespace remaps 334 | autocmd FileType php noremap n :call PhpInsertUse() 335 | autocmd FileType php noremap e :call PhpExpandClass() 336 | 337 | " PHP Parsing & Checking commands 338 | autocmd FileType php noremap :w!:!php % 339 | autocmd FileType php noremap l :w!:!php -l % 340 | autocmd FileType php noremap b :w!:!vendor/bin/behat 341 | autocmd FileType php noremap u :w!:!vendor/bin/phpunit 342 | autocmd FileType php noremap s :w!:!vendor/bin/phpspec run -v 343 | 344 | " Cucumber 345 | autocmd FileType cucumber noremap b :w!:!vendor/bin/behat % 346 | 347 | autocmd FileType php nnoremap :exe ':!phpctags --flags="+aim" --exclude=".git" --exclude="vendor/pdepend" --exclude="composer.phar" --sort=yes --memory=-1 --recurse=yes -f "' . g:project_tags .'" .' 348 | autocmd FileType php nnoremap execute "set tags=" . g:project_tags 349 | 350 | autocmd FileType php setlocal ts=4 sts=4 sw=4 351 | 352 | " Strip trailing white space from .php files 353 | autocmd BufWritePre *.php :%s/\s\+$//e 354 | 355 | " Indentation rules 356 | autocmd FileType php set expandtab 357 | 358 | "autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP 359 | 360 | " PHPDoc settings 361 | if !exists("g:pdv_cfg_Author") 362 | let g:pdv_cfg_Author = "Matthew Setter " 363 | endif 364 | 365 | " Set up syntax checker 366 | let g:syntastic_php_checkers=['php', 'vendor/bin/phpcs', 'vendor/bin/phpmd'] 367 | 368 | " Refactoring 369 | let g:php_refactor_command='php ~/bin/refactor.phar' 370 | 371 | " CS Fixer 372 | let g:php_cs_fixer_path = "php-cs-fixer" 373 | let g:php_cs_fixer_level = "all" 374 | let g:php_cs_fixer_config = "default" 375 | let g:php_cs_fixer_php_path = "php" 376 | let g:php_cs_fixer_enable_default_mapping = 1 377 | let g:php_cs_fixer_dry_run = 0 378 | let g:php_cs_fixer_verbose = 1 379 | " } 380 | 381 | " Javascript { 382 | " 2 space indents 383 | autocmd FileType javascript setlocal ts=2 sts=2 sw=2 384 | " } 385 | 386 | " Coffeescript { 387 | " 2 space indents 388 | autocmd FileType coffee setlocal ts=2 sts=2 sw=2 389 | " } 390 | 391 | " HTML { 392 | " 2 space indents 393 | autocmd FileType html setlocal ts=2 sts=2 sw=2 394 | " } 395 | 396 | " GitGutter { 397 | " enable highlight of git changes 398 | let g:gitgutter_linehighlightseNable = 1 399 | " } 400 | 401 | " Go { 402 | au FileType go nmap s (go-implements) 403 | au FileType go nmap i (go-info) 404 | au FileType go nmap gd (go-doc) 405 | au FileType go nmap gv (go-doc-vertical) 406 | au FileType go nmap gb (go-doc-browser) 407 | au FileType go nmap r (go-run) 408 | au FileType go nmap b (go-build) 409 | au FileType go nmap t (go-test) 410 | au FileType go nmap c (go-coverage) 411 | au FileType go nmap ds (go-def-split) 412 | au FileType go nmap dv (go-def-vertical) 413 | au FileType go nmap dt (go-def-tab) 414 | let g:go_highlight_functions = 1 415 | let g:go_highlight_methods = 1 416 | let g:go_highlight_structs = 1 417 | let g:go_highlight_operators = 1 418 | let g:go_highlight_build_constraints = 1 419 | " } 420 | " } 421 | 422 | " Key (re)Mappings { 423 | 424 | " Quick ESC 425 | imap jj 426 | 427 | " Jump to the next row on long lines 428 | map gj 429 | map gk 430 | nnoremap j gj 431 | nnoremap k gk 432 | 433 | " Remove all trailing whitespace by pressing F9 434 | nnoremap :let _s=@/:%s/\s\+$//e:let @/=_s 435 | 436 | " Resize buffers 437 | if bufwinnr(1) 438 | nmap Ä << 439 | nmap Ö >> 440 | nmap ö -- 441 | nmap ä ++ 442 | endif 443 | 444 | " Map the space bar to open/close a fold 445 | nnoremap za 446 | 447 | " format the entire file 448 | nmap fef ggVG= 449 | 450 | " Map the buffer list 451 | nmap l :ls 452 | 453 | " Fast saves 454 | nmap w :w! 455 | 456 | " Edit todo list for project 457 | nmap ,todo :e todo.txt 458 | 459 | " Edit composer.json 460 | nmap lc :e composer.json 461 | 462 | "Load the current buffer in Chrome 463 | nmap ,c :!open -a Google\ Chrome 464 | 465 | " Open new buffers 466 | nmap s :leftabove vnew 467 | nmap s :rightbelow vnew 468 | nmap s :leftabove new 469 | nmap s :rightbelow new 470 | 471 | " Not quite working yet. 472 | nmap l Ysurroundiw]%a(*) 473 | vmap l Vsurroundiw]%a(*) 474 | 475 | " Tab between buffers 476 | noremap 477 | 478 | " Switch between last two buffers 479 | nnoremap 480 | 481 | " Toggle numbers.vim 482 | nnoremap :NumbersToggle 483 | 484 | " bind K to grep word under cursor 485 | nnoremap K :grep! "\b\b":cw 486 | 487 | " } 488 | 489 | " Go programming 490 | set rtp+=/usr/local/Cellar/go/1.0.3/misc/vim 491 | 492 | " Quit with :Q 493 | command -nargs=0 Quit :qa! 494 | 495 | " vim-pencil configuration 496 | " For further options see https://github.com/reedes/vim-pencil 497 | " let g:pencil#wrapModeDefault = 'soft' " default is 'hard' 498 | augroup pencil 499 | autocmd! 500 | " 501 | " Apply for Markdown and reStructuredText 502 | autocmd FileType markdown,mkd,md,rst,asciidoc call pencil#init({'wrap': 'soft'}) 503 | \ | call lexical#init() 504 | \ | call litecorrect#init() 505 | \ | call textobj#quote#init() 506 | \ | call textobj#sentence#init() 507 | autocmd FileType markdown,mkd,md call SetMarkdownOptions() 508 | autocmd FileType rst call SetRestructuredTextOptions() 509 | autocmd FileType c,h call SetCOptions() 510 | autocmd FileType go call SetGoOptions() 511 | autocmd FileType Makefile call SetMakefileOptions() 512 | autocmd FileType text call pencil#init({'wrap': 'soft'}) 513 | 514 | augroup END 515 | 516 | " Highlight words to avoid in tech writing 517 | " ======================================= 518 | " 519 | " obviously, basically, simply, of course, clearly, 520 | " just, everyone knows, However, So, easy 521 | 522 | " http://css-tricks.com/words-avoid-educational-writing/ 523 | 524 | highlight TechWordsToAvoid ctermbg=red ctermfg=white 525 | function! MatchTechWordsToAvoid() 526 | match TechWordsToAvoid /\c\<\(obviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however\|so,\|easy\)\>/ 527 | endfunction 528 | autocmd BufWinEnter * match TechWordsToAvoid /\cobviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however,\|so,\|easy/ 529 | autocmd InsertEnter * match TechWordsToAvoid /\cobviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however,\|so,\|easy/ 530 | autocmd InsertLeave * match TechWordsToAvoid /\cobviously\|basically\|simply\|of\scourse\|clearly\|just\|everyone\sknows\|however,\|so,\|easy/ 531 | autocmd BufWinLeave * call clearmatches() 532 | 533 | function SetGoOptions() 534 | if has("gui_running") 535 | colorscheme Tomorrow-Night-Eighties 536 | set guifont=InputMono:h14 537 | set guioptions-=r 538 | set guioptions-=T 539 | set linespace=2 540 | endif 541 | endfunction 542 | 543 | function SetCOptions() 544 | if has("gui_running") 545 | set background=dark 546 | colorscheme solarized 547 | set guifont=InputMono:h12 548 | set guioptions-=r 549 | set guioptions-=T 550 | set linespace=2 551 | endif 552 | let g:clang_library_path = '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libclang.dylib' 553 | let g:clang_use_library = 1 554 | let g:clang_auto_select = 0 555 | let g:clang_complete_auto = 1 556 | let g:clang_complete_copen = 1 557 | let g:clang_complete_macros = 1 558 | let g:clang_complete_patters = 1 559 | set completeopt=menu,longest 560 | let g:clang_auto_user_options = "-I/usr/include/c++/4.6, .clang_complete" 561 | let g:clang_snippets = 1 562 | let g:clang_snippets_engine = 'clang_complete' 563 | endfunction 564 | 565 | function SetIaWriterOptions() 566 | " 567 | " Last Change: 2011/12/11 568 | " Maintainer: Jacek Dominiak 569 | " 570 | " Description: Vim color file 571 | " 572 | 573 | set background=light 574 | hi clear 575 | if exists("syntax_on") 576 | syntax reset 577 | endif 578 | 579 | let g:colors_name="iawriter" 580 | 581 | hi Cursor guifg=fg guibg=#54D4FF 582 | hi Normal guifg=#424242 guibg=#f5f6f6 ctermfg=black ctermbg=white 583 | hi DiffAdd guibg=#c0ffe0 ctermbg=3 584 | hi DiffDelete guifg=#ff8097 guibg=#ffe0f7 ctermfg=4 ctermbg=5 585 | hi DiffChange guibg=#cfefff ctermbg=9 586 | hi DiffText guibg=#bfdfff gui=NONE ctermbg=6 cterm=NONE 587 | hi NonText guifg=bg guibg=bg gui=NONE ctermfg=darkblue 588 | hi SpecialKey guifg=grey50 guibg=grey86 gui=NONE ctermfg=darkblue 589 | hi LineNr guifg=bg guibg=bg ctermfg=darkblue 590 | hi Search guibg=#fff999 591 | hi StatusLine guifg=bg guibg=#333333 gui=NONE ctermfg=bg ctermbg=black cterm=NONE 592 | hi StatusLineNC guifg=bg guibg=grey40 gui=NONE ctermfg=bg ctermbg=black cterm=NONE 593 | hi Visual guifg=fg guibg=#ccccdd gui=NONE 594 | hi VisualNOS guifg=bg guibg=#ccccdd gui=NONE 595 | 596 | " syntax highlighting groups 597 | hi Comment guifg=#000099 guibg=bg ctermfg=darkblue 598 | hi String guifg=fg guibg=#e0e4cc ctermfg=darkred 599 | hi Constant guifg=#c033ff guibg=bg ctermfg=darkmagenta 600 | hi Statement guifg=#737373 guibg=bg ctermfg=black cterm=NONE 601 | hi PreProc guifg=#335588 guibg=bg gui=NONE ctermfg=blue 602 | hi Type guifg=#338855 guibg=bg gui=NONE ctermfg=darkgreen 603 | hi StorageClass guifg=#990000 guibg=bg ctermfg=red 604 | hi Special guifg=#6688ff guibg=bg ctermfg=darkcyan 605 | hi Function guifg=#117777 guibg=bg ctermfg=red 606 | hi Title guifg=black guibg=bg ctermfg=black cterm=bold 607 | 608 | " showpairs plugin 609 | " for cursor on paren 610 | hi ShowPairsHL guibg=#c4ffc4 ctermbg=lightgreen 611 | " for cursor between parens 612 | hi ShowPairsHLp guibg=#c4f0c4 ctermbg=lightgreen 613 | " unmatched paren 614 | hi ShowPairsHLe guibg=#ff5555 ctermbg=red 615 | 616 | " settings for Vim7 617 | if version >= 700 618 | hi MatchParen guibg=#c4ffc4 ctermbg=lightgreen 619 | " Spell 620 | hi SpellBad guifg=fg gui=undercurl ctermfg=red cterm=underline 621 | hi SpellRare guifg=magenta gui=undercurl ctermfg=magenta cterm=underline 622 | hi SpellCap guifg=fg gui=undercurl guisp=#22cc22 cterm=underline 623 | " Completion menu 624 | hi Pmenu guibg=#ffffcc ctermbg=yellow 625 | hi PmenuSel guibg=#ddddaa ctermbg=lightcyan cterm=NONE 626 | hi PmenuSbar guibg=#999966 ctermbg=lightcyan 627 | " Tab line 628 | hi TabLine guibg=grey70 cterm=underline 629 | hi TabLineSel gui=NONE cterm=NONE 630 | hi TabLineFill guifg=black guibg=grey80 cterm=underline 631 | endif 632 | endfunction 633 | 634 | function SetRestructuredTextOptions() 635 | au BufRead,BufNewFile *.rst setlocal textwidth=80 636 | autocmd FileType gitcommit setlocal spell 637 | setlocal spell spelllang=en_us 638 | endfunction 639 | 640 | function SetMarkdownOptions() 641 | setlocal spell spelllang=en_us 642 | nmap l Ysurroundiw]%a(*) 643 | endfunction 644 | 645 | function SetPhpOptions() 646 | colorscheme Tomorrow-Night 647 | endfunction 648 | 649 | function SetMakefileOptions() 650 | colorscheme Tomorrow-Night 651 | set noexpandtab shiftwidth=4 softtabstop=0 652 | endfunction 653 | 654 | " Override grip with The Silver Searcher 655 | if executable('ag') 656 | " Use ag over grep 657 | set grepprg=ag\ --nogroup\ --nocolor 658 | 659 | " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore 660 | let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""' 661 | 662 | " ag is fast enough that CtrlP doesn't need to cache 663 | let g:ctrlp_use_caching = 0 664 | endif 665 | 666 | " virtual tabstops using spaces 667 | " link: http://vim.wikia.com/wiki/Toggle_between_tabs_and_spaces 668 | let my_tab=4 669 | execute "set shiftwidth=".my_tab 670 | execute "set softtabstop=".my_tab 671 | set expandtab 672 | " allow toggling between local and default mode 673 | function! TabToggle() 674 | if &expandtab 675 | set shiftwidth=4 676 | set softtabstop=0 677 | set noexpandtab 678 | else 679 | execute "set shiftwidth=".g:my_tab 680 | execute "set softtabstop=".g:my_tab 681 | set expandtab 682 | endif 683 | endfunction 684 | nmap mz:execute TabToggle()'z 685 | 686 | let $PYTHONHOME="/Library/Frameworks/Python.framework/Versions/3.6" 687 | set pythonthreedll=/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6m.dylib 688 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | Welcome to Vim for Technical Writers. The aim of this project is to provide a professional Vim configuration which is just what technical writers, specifically those who specialise around software development, web application development, need. 4 | 5 | ## What Does It Do? 6 | 7 | [Vim](http://vim.org) is an incredibly powerful tool, one which is extremely customisable for virtually any and every need. But by default it has quite a limited configuration. So to save you a lot of time setting it up to suit your needs, this project will give you, the technical writer, a near-perfect setup for two primary tasks: 8 | 9 | 1. To be able to develop code as you're researching the topic you're writing, whether it's a blog post, talk, presentation, or something else entirely 10 | 2. A great working environment for writing, editing, and proof-reading 11 | 12 | ## The Setup - In a Nutshell 13 | 14 | I could go on at length, but that's not likely going to help you. So here's the key features of the project: 15 | 16 | - **Writing:** Spelling, Grammar, and Proofing Tools 17 | - **Software Development:** Whether you're developing in PHP, JavaScript, Go, or Bash (more languages to come), you'll have a fully configured "IDE", which gives you proper indentation, brace completion, code completion, syntax highlighting, linting, intent checking, and more. Some languages have more and less of these features than others. To see the full support provided, see the table below. 18 | - **Themes:** A Range of Professional Themes with a classy looking default 19 | - Keyboard Shortcuts: A Range of Keyboard Shortcuts (mappings) to save you time and effort remembering long commands 20 | - Git Version Control Integration 21 | - Markdown Support: Markdown is the format I see used most often, so it's been embraced here 100% 22 | - A Beautiful UI Configuration 23 | 24 | ## Installation 25 | 26 | At this stage, the entire configuration is stored in a single .vimrc file. In time I'm planning to change that. But for now, all you need to do is to clone the repository, then copy the .vimrc file to your home directory (Windows instructions to come). 27 | 28 | As the setup uses [Vundle](https://github.com/gmarik/Vundle.vim), you need to firstly clone that repository, using the following command: 29 | 30 | ```bash 31 | git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim 32 | ``` 33 | 34 | When that's done, start Vim and run `BundleInstall`. This will bring in all the required plugins. When that's done, restart Vim and you're ready to go. 35 | 36 | ## Software Language Support 37 | 38 | |Language|Support| 39 | |---|---| 40 | |PHP|Partial Support| 41 | |JavaScript|Partial Support| 42 | |Go|Full Support| 43 | |Ruby|Partial Support| 44 | |Python|Not supported yet| 45 | 46 | ## Follow Development 47 | 48 | If you're keen to watch the development unfold, follow @vim4techwriters, or subscribe to the repository feed. 49 | 50 | ## Contribute to Development 51 | 52 | If there's something that you see is missing, broken, or not done correctly let me know. Either [create an issue](https://github.com/settermjd/vim-for-technial-writers/issues), or fork the repository, make a patch, and submit a [pull request](https://help.github.com/articles/using-pull-requests/). 53 | --------------------------------------------------------------------------------