Repository: spf13/spf13-vim Branch: 3.0 Commit: 1ce5f23997f6 Files: 12 Total size: 107.7 KB Directory structure: gitextract_dqyoy5dg/ ├── .gitignore ├── .vimrc ├── .vimrc.before ├── .vimrc.bundles ├── .vimrc.bundles.default ├── LICENSE.txt ├── README.markdown ├── bootstrap.sh ├── config-dependencies.gv ├── spf13-vim-windows-install.cmd ├── spf13-vim-windows-xp-install.cmd └── uninstall.sh ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ .DS_Store *.pyc *._* .vim/ ================================================ FILE: .vimrc ================================================ " Modeline and Notes { " vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell: " " __ _ _____ _ " ___ _ __ / _/ |___ / __ __(_)_ __ ___ " / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \ " \__ \ |_) | _| |___) |_____|\ V / | | | | | | | " |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_| " |_| " " This is the personal .vimrc file of Steve Francia. " While much of it is beneficial for general use, I would " recommend picking out the parts you want and understand. " " You can find me at http://spf13.com " " Copyright 2014 Steve Francia " " Licensed under the Apache License, Version 2.0 (the "License"); " you may not use this file except in compliance with the License. " You may obtain a copy of the License at " " http://www.apache.org/licenses/LICENSE-2.0 " " Unless required by applicable law or agreed to in writing, software " distributed under the License is distributed on an "AS IS" BASIS, " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. " See the License for the specific language governing permissions and " limitations under the License. " } " Environment { " Identify platform { silent function! OSX() return has('macunix') endfunction silent function! LINUX() return has('unix') && !has('macunix') && !has('win32unix') endfunction silent function! WINDOWS() return (has('win32') || has('win64')) endfunction " } " Basics { set nocompatible " Must be first line if !WINDOWS() set shell=/bin/sh endif " } " Windows Compatible { " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization " across (heterogeneous) systems easier. if WINDOWS() set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after endif " } " Arrow Key Fix { " https://github.com/spf13/spf13-vim/issues/780 if &term[:4] == "xterm" || &term[:5] == 'screen' || &term[:3] == 'rxvt' inoremap OC endif " } " } " Use before config if available { if filereadable(expand("~/.vimrc.before")) source ~/.vimrc.before endif " } " Use bundles config { if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles endif " } " General { set background=dark " Assume a dark background " Allow to trigger background function! ToggleBG() let s:tbg = &background " Inversion if s:tbg == "dark" set background=light else set background=dark endif endfunction noremap bg :call ToggleBG() " if !has('gui') "set term=$TERM " Make arrow and other keys work " endif filetype plugin indent on " Automatically detect file types. syntax on " Syntax highlighting set mouse=a " Automatically enable mouse usage set mousehide " Hide the mouse cursor while typing scriptencoding utf-8 if has('clipboard') if has('unnamedplus') " When possible use + register for copy-paste set clipboard=unnamed,unnamedplus else " On mac and Windows, use * register for copy-paste set clipboard=unnamed endif endif " Most prefer to automatically switch to the current file directory when " a new buffer is opened; to prevent this behavior, add the following to " your .vimrc.before.local file: " let g:spf13_no_autochdir = 1 if !exists('g:spf13_no_autochdir') autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif " Always switch to the current file directory endif "set autowrite " Automatically write a file when leaving a modified buffer set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter') set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility set virtualedit=onemore " Allow for cursor beyond last character set history=1000 " Store a ton of history (default is 20) set spell " Spell checking on set hidden " Allow buffer switching without saving set iskeyword-=. " '.' is an end of word designator set iskeyword-=# " '#' is an end of word designator set iskeyword-=- " '-' is an end of word designator " Instead of reverting the cursor to the last position in the buffer, we " set it to the first line when editing a git commit message au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0]) " http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session " Restore cursor to file position in previous editing session " To disable this, add the following to your .vimrc.before.local file: " let g:spf13_no_restore_cursor = 1 if !exists('g:spf13_no_restore_cursor') function! ResCur() if line("'\"") <= line("$") silent! normal! g`" return 1 endif endfunction augroup resCur autocmd! autocmd BufWinEnter * call ResCur() augroup END endif " Setting up the directories { set backup " Backups are nice ... if has('persistent_undo') set undofile " So is persistent undo ... set undolevels=1000 " Maximum number of changes that can be undone set undoreload=10000 " Maximum number lines to save for undo on a buffer reload endif " To disable views add the following to your .vimrc.before.local file: " let g:spf13_no_views = 1 if !exists('g:spf13_no_views') " Add exclusions to mkview and loadview " eg: *.*, svn-commit.tmp let g:skipview_files = [ \ '\[example pattern\]' \ ] endif " } " } " Vim UI { if !exists('g:override_spf13_bundles') && filereadable(expand("~/.vim/bundle/vim-colors-solarized/colors/solarized.vim")) let g:solarized_termcolors=256 let g:solarized_termtrans=1 let g:solarized_contrast="normal" let g:solarized_visibility="normal" color solarized " Load a colorscheme endif set tabpagemax=15 " Only show 15 tabs set showmode " Display the current mode set cursorline " Highlight current line highlight clear SignColumn " SignColumn should match background highlight clear LineNr " Current line number row will have same background color in relative mode "highlight clear CursorLineNr " Remove highlight color from current line number if has('cmdline_info') set ruler " Show the ruler set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids set showcmd " Show partial commands in status line and " Selected characters/lines in visual mode endif if has('statusline') set laststatus=2 " Broken down into easily includeable segments set statusline=%<%f\ " Filename set statusline+=%w%h%m%r " Options if !exists('g:override_spf13_bundles') set statusline+=%{fugitive#statusline()} " Git Hotness endif set statusline+=\ [%{&ff}/%Y] " Filetype set statusline+=\ [%{getcwd()}] " Current dir set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info endif set backspace=indent,eol,start " Backspace for dummies set linespace=0 " No extra spaces between rows set number " Line numbers on set showmatch " Show matching brackets/parenthesis set incsearch " Find as you type search set hlsearch " Highlight search terms set winminheight=0 " Windows can be 0 line high set ignorecase " Case insensitive search set smartcase " Case sensitive when uc present set wildmenu " Show list instead of just completing set wildmode=list:longest,full " Command completion, list matches, then longest common part, then all. set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too set scrolljump=5 " Lines to scroll when cursor leaves screen set scrolloff=3 " Minimum lines to keep above and below cursor set foldenable " Auto fold code set list set listchars=tab:›\ ,trail:•,extends:#,nbsp:. " Highlight problematic whitespace " } " Formatting { set nowrap " Do not wrap long lines set autoindent " Indent at the same level of the previous line set shiftwidth=4 " Use indents of 4 spaces set expandtab " Tabs are spaces, not tabs set tabstop=4 " An indentation every four columns set softtabstop=4 " Let backspace delete indent set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) set splitright " Puts new vsplit windows to the right of the current set splitbelow " Puts new split windows to the bottom of the current "set matchpairs+=<:> " Match, to be used with % set pastetoggle= " pastetoggle (sane indentation on pastes) "set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks " Remove trailing whitespaces and ^M chars " To disable the stripping of whitespace, add the following to your " .vimrc.before.local file: " let g:spf13_keep_trailing_whitespace = 1 autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif "autocmd FileType go autocmd BufWritePre Fmt autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig autocmd FileType haskell,puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2 " preceding line best in a plugin but here for now. autocmd BufNewFile,BufRead *.coffee set filetype=coffee " Workaround vim-commentary for Haskell autocmd FileType haskell setlocal commentstring=--\ %s " Workaround broken colour highlighting in Haskell autocmd FileType haskell,rust setlocal nospell " } " Key (re)Mappings { " The default leader is '\', but many people prefer ',' as it's in a standard " location. To override this behavior and set it back to '\' (or any other " character) add the following to your .vimrc.before.local file: " let g:spf13_leader='\' if !exists('g:spf13_leader') let mapleader = ',' else let mapleader=g:spf13_leader endif if !exists('g:spf13_localleader') let maplocalleader = '_' else let maplocalleader=g:spf13_localleader endif " The default mappings for editing and applying the spf13 configuration " are ev and sv respectively. Change them to your preference " by adding the following to your .vimrc.before.local file: " let g:spf13_edit_config_mapping='ec' " let g:spf13_apply_config_mapping='sc' if !exists('g:spf13_edit_config_mapping') let s:spf13_edit_config_mapping = 'ev' else let s:spf13_edit_config_mapping = g:spf13_edit_config_mapping endif if !exists('g:spf13_apply_config_mapping') let s:spf13_apply_config_mapping = 'sv' else let s:spf13_apply_config_mapping = g:spf13_apply_config_mapping endif " Easier moving in tabs and windows " The lines conflict with the default digraph mapping of " If you prefer that functionality, add the following to your " .vimrc.before.local file: " let g:spf13_no_easyWindows = 1 if !exists('g:spf13_no_easyWindows') map j_ map k_ map l_ map h_ endif " Wrapped lines goes down/up to next row, rather than next line in file. noremap j gj noremap k gk " End/Start of line motion keys act relative to row/wrap width in the " presence of `:set wrap`, and relative to line for `:set nowrap`. " Default vim behaviour is to act relative to text line in both cases " If you prefer the default behaviour, add the following to your " .vimrc.before.local file: " let g:spf13_no_wrapRelMotion = 1 if !exists('g:spf13_no_wrapRelMotion') " Same for 0, home, end, etc function! WrapRelativeMotion(key, ...) let vis_sel="" if a:0 let vis_sel="gv" endif if &wrap execute "normal!" vis_sel . "g" . a:key else execute "normal!" vis_sel . a:key endif endfunction " Map g* keys in Normal, Operator-pending, and Visual+select noremap $ :call WrapRelativeMotion("$") noremap :call WrapRelativeMotion("$") noremap 0 :call WrapRelativeMotion("0") noremap :call WrapRelativeMotion("0") noremap ^ :call WrapRelativeMotion("^") " Overwrite the operator pending $/ mappings from above " to force inclusive motion with :execute normal! onoremap $ v:call WrapRelativeMotion("$") onoremap v:call WrapRelativeMotion("$") " Overwrite the Visual+select mode mappings from above " to ensure the correct vis_sel flag is passed to function vnoremap $ :call WrapRelativeMotion("$", 1) vnoremap :call WrapRelativeMotion("$", 1) vnoremap 0 :call WrapRelativeMotion("0", 1) vnoremap :call WrapRelativeMotion("0", 1) vnoremap ^ :call WrapRelativeMotion("^", 1) endif " The following two lines conflict with moving to top and " bottom of the screen " If you prefer that functionality, add the following to your " .vimrc.before.local file: " let g:spf13_no_fastTabs = 1 if !exists('g:spf13_no_fastTabs') map gT map gt endif " Stupid shift key fixes if !exists('g:spf13_no_keyfixes') if has("user_commands") command! -bang -nargs=* -complete=file E e command! -bang -nargs=* -complete=file W w command! -bang -nargs=* -complete=file Wq wq command! -bang -nargs=* -complete=file WQ wq command! -bang Wa wa command! -bang WA wa command! -bang Q q command! -bang QA qa command! -bang Qa qa endif cmap Tabe tabe endif " Yank from the cursor to the end of the line, to be consistent with C and D. nnoremap Y y$ " Code folding options nmap f0 :set foldlevel=0 nmap f1 :set foldlevel=1 nmap f2 :set foldlevel=2 nmap f3 :set foldlevel=3 nmap f4 :set foldlevel=4 nmap f5 :set foldlevel=5 nmap f6 :set foldlevel=6 nmap f7 :set foldlevel=7 nmap f8 :set foldlevel=8 nmap f9 :set foldlevel=9 " Most prefer to toggle search highlighting rather than clear the current " search results. To clear search highlighting rather than toggle it on " and off, add the following to your .vimrc.before.local file: " let g:spf13_clear_search_highlight = 1 if exists('g:spf13_clear_search_highlight') nmap / :nohlsearch else nmap / :set invhlsearch endif " Find merge conflict markers map fc /\v^[<\|=>]{7}( .*\|$) " Shortcuts " Change Working Directory to that of the current file cmap cwd lcd %:p:h cmap cd. lcd %:p:h " Visual shifting (does not exit Visual mode) vnoremap < >gv " Allow using the repeat operator with a visual selection (!) " http://stackoverflow.com/a/8064607/127816 vnoremap . :normal . " For when you forget to sudo.. Really Write the file. cmap w!! w !sudo tee % >/dev/null " Some helpers to edit mode " http://vimcasts.org/e/14 cnoremap %% =fnameescape(expand('%:h')).'/' map ew :e %% map es :sp %% map ev :vsp %% map et :tabe %% " Adjust viewports to the same size map = = " Map ff to display all lines with keyword under cursor " and ask which one to jump to nmap ff [I:let nr = input("Which one: ")exe "normal " . nr ."[\t" " Easier horizontal scrolling map zl zL map zh zH " Easier formatting nnoremap q gwip " FIXME: Revert this f70be548 " fullscreen mode for GVIM and Terminal, need 'wmctrl' in you PATH map :call system("wmctrl -ir " . v:windowid . " -b toggle,fullscreen") " } " Plugins { " GoLang { if count(g:spf13_bundle_groups, 'go') let g:go_highlight_functions = 1 let g:go_highlight_methods = 1 let g:go_highlight_structs = 1 let g:go_highlight_operators = 1 let g:go_highlight_build_constraints = 1 let g:go_fmt_command = "goimports" let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck'] let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] } au FileType go nmap s (go-implements) au FileType go nmap i (go-info) au FileType go nmap e (go-rename) au FileType go nmap r (go-run) au FileType go nmap b (go-build) au FileType go nmap t (go-test) au FileType go nmap gd (go-doc) au FileType go nmap gv (go-doc-vertical) au FileType go nmap co (go-coverage) endif " } " TextObj Sentence { if count(g:spf13_bundle_groups, 'writing') augroup textobj_sentence autocmd! autocmd FileType markdown call textobj#sentence#init() autocmd FileType textile call textobj#sentence#init() autocmd FileType text call textobj#sentence#init() augroup END endif " } " TextObj Quote { if count(g:spf13_bundle_groups, 'writing') augroup textobj_quote autocmd! autocmd FileType markdown call textobj#quote#init() autocmd FileType textile call textobj#quote#init() autocmd FileType text call textobj#quote#init({'educate': 0}) augroup END endif " } " PIV { if isdirectory(expand("~/.vim/bundle/PIV")) let g:DisableAutoPHPFolding = 0 let g:PIVAutoClose = 0 endif " } " Misc { if isdirectory(expand("~/.vim/bundle/nerdtree")) let g:NERDShutUp=1 endif if isdirectory(expand("~/.vim/bundle/matchit.zip")) let b:match_ignorecase = 1 endif " } " OmniComplete { " To disable omni complete, add the following to your .vimrc.before.local file: " let g:spf13_no_omni_complete = 1 if !exists('g:spf13_no_omni_complete') if has("autocmd") && exists("+omnifunc") autocmd Filetype * \if &omnifunc == "" | \setlocal omnifunc=syntaxcomplete#Complete | \endif endif hi Pmenu guifg=#000000 guibg=#F8F8F8 ctermfg=black ctermbg=Lightgray hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE " Some convenient mappings "inoremap pumvisible() ? "\" : "\" if exists('g:spf13_map_cr_omni_complete') inoremap pumvisible() ? "\" : "\" endif inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\\\" : "\" inoremap pumvisible() ? "\\\" : "\" " Automatically open and close the popup menu / preview window au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif set completeopt=menu,preview,longest endif " } " Ctags { set tags=./tags;/,~/.vimtags " Make tags placed in .git/tags file available in all levels of a repository let gitroot = substitute(system('git rev-parse --show-toplevel'), '[\n\r]', '', 'g') if gitroot != '' let &tags = &tags . ',' . gitroot . '/.git/tags' endif " } " AutoCloseTag { " Make it so AutoCloseTag works for xml and xhtml files as well au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim nmap ac ToggleAutoCloseMappings " } " SnipMate { " Setting the author var " If forking, please overwrite in your .vimrc.local file let g:snips_author = 'Steve Francia ' " } " NerdTree { if isdirectory(expand("~/.vim/bundle/nerdtree")) map NERDTreeTabsToggle map e :NERDTreeFind nmap nt :NERDTreeFind let NERDTreeShowBookmarks=1 let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$'] let NERDTreeChDirMode=0 let NERDTreeQuitOnOpen=1 let NERDTreeMouseMode=2 let NERDTreeShowHidden=1 let NERDTreeKeepTreeInNewTab=1 let g:nerdtree_tabs_open_on_gui_startup=0 endif " } " Tabularize { if isdirectory(expand("~/.vim/bundle/tabular")) nmap a& :Tabularize /& vmap a& :Tabularize /& nmap a= :Tabularize /^[^=]*\zs= vmap a= :Tabularize /^[^=]*\zs= nmap a=> :Tabularize /=> vmap a=> :Tabularize /=> nmap a: :Tabularize /: vmap a: :Tabularize /: nmap a:: :Tabularize /:\zs vmap a:: :Tabularize /:\zs nmap a, :Tabularize /, vmap a, :Tabularize /, nmap a,, :Tabularize /,\zs vmap a,, :Tabularize /,\zs nmap a :Tabularize / vmap a :Tabularize / endif " } " Session List { set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize if isdirectory(expand("~/.vim/bundle/sessionman.vim/")) nmap sl :SessionList nmap ss :SessionSave nmap sc :SessionClose endif " } " JSON { nmap jt :%!python -m json.tool:set filetype=json let g:vim_json_syntax_conceal = 0 " } " PyMode { " Disable if python support not present if !has('python') && !has('python3') let g:pymode = 0 endif if isdirectory(expand("~/.vim/bundle/python-mode")) let g:pymode_lint_checkers = ['pyflakes'] let g:pymode_trim_whitespaces = 0 let g:pymode_options = 0 let g:pymode_rope = 0 endif " } " ctrlp { if isdirectory(expand("~/.vim/bundle/ctrlp.vim/")) let g:ctrlp_working_path_mode = 'ra' nnoremap :CtrlP nnoremap :CtrlPMRU let g:ctrlp_custom_ignore = { \ 'dir': '\.git$\|\.hg$\|\.svn$', \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' } if executable('ag') let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""' elseif executable('ack-grep') let s:ctrlp_fallback = 'ack-grep %s --nocolor -f' elseif executable('ack') let s:ctrlp_fallback = 'ack %s --nocolor -f' " On Windows use "dir" as fallback command. elseif WINDOWS() let s:ctrlp_fallback = 'dir %s /-n /b /s /a-d' else let s:ctrlp_fallback = 'find %s -type f' endif if exists("g:ctrlp_user_command") unlet g:ctrlp_user_command endif let g:ctrlp_user_command = { \ 'types': { \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'], \ 2: ['.hg', 'hg --cwd %s locate -I .'], \ }, \ 'fallback': s:ctrlp_fallback \ } if isdirectory(expand("~/.vim/bundle/ctrlp-funky/")) " CtrlP extensions let g:ctrlp_extensions = ['funky'] "funky nnoremap fu :CtrlPFunky endif endif "} " TagBar { if isdirectory(expand("~/.vim/bundle/tagbar/")) nnoremap tt :TagbarToggle endif "} " Rainbow { if isdirectory(expand("~/.vim/bundle/rainbow/")) let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle endif "} " Fugitive { if isdirectory(expand("~/.vim/bundle/vim-fugitive/")) nnoremap gs :Gstatus nnoremap gd :Gdiff nnoremap gc :Gcommit nnoremap gb :Gblame nnoremap gl :Glog nnoremap gp :Git push nnoremap gr :Gread nnoremap gw :Gwrite nnoremap ge :Gedit " Mnemonic _i_nteractive nnoremap gi :Git add -p % nnoremap gg :SignifyToggle endif "} " YouCompleteMe { if count(g:spf13_bundle_groups, 'youcompleteme') let g:acp_enableAtStartup = 0 " enable completion from tags let g:ycm_collect_identifiers_from_tags_files = 1 " remap Ultisnips for compatibility for YCM let g:UltiSnipsExpandTrigger = '' let g:UltiSnipsJumpForwardTrigger = '' let g:UltiSnipsJumpBackwardTrigger = '' " Enable omni completion. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc " Haskell post write lint and check with ghcmod " $ `cabal install ghcmod` if missing and ensure " ~/.cabal/bin is in your $PATH. if !executable("ghcmod") autocmd BufWritePost *.hs GhcModCheckAndLintAsync endif " For snippet_complete marker. if !exists("g:spf13_no_conceal") if has('conceal') set conceallevel=2 concealcursor=i endif endif " Disable the neosnippet preview candidate window " When enabled, there can be too much visual noise " especially when splits are used. set completeopt-=preview endif " } " neocomplete { if count(g:spf13_bundle_groups, 'neocomplete') let g:acp_enableAtStartup = 0 let g:neocomplete#enable_at_startup = 1 let g:neocomplete#enable_smart_case = 1 let g:neocomplete#enable_auto_delimiter = 1 let g:neocomplete#max_list = 15 let g:neocomplete#force_overwrite_completefunc = 1 " Define dictionary. let g:neocomplete#sources#dictionary#dictionaries = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } " Define keyword. if !exists('g:neocomplete#keyword_patterns') let g:neocomplete#keyword_patterns = {} endif let g:neocomplete#keyword_patterns['default'] = '\h\w*' " Plugin key-mappings { " These two lines conflict with the default digraph mapping of if !exists('g:spf13_no_neosnippet_expand') imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) endif if exists('g:spf13_noninvasive_completion') inoremap " takes you out of insert mode inoremap pumvisible() ? "\\" : "\" " accepts first, then sends the inoremap pumvisible() ? "\\" : "\" " and cycle like and inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" " Jump up and down the list inoremap pumvisible() ? "\\\" : "\" inoremap pumvisible() ? "\\\" : "\" else " Complete Snippet " Jump to next snippet point imap neosnippet#expandable() ? \ "\(neosnippet_expand_or_jump)" : (pumvisible() ? \ "\" : "\(neosnippet_expand_or_jump)") smap (neosnippet_jump_or_expand) inoremap neocomplete#undo_completion() inoremap neocomplete#complete_common_string() "inoremap neocomplete#complete_common_string() " : close popup " : close popup and save indent. inoremap pumvisible() ? neocomplete#smart_close_popup()."\" : "\" function! CleverCr() if pumvisible() if neosnippet#expandable() let exp = "\(neosnippet_expand)" return exp . neocomplete#smart_close_popup() else return neocomplete#smart_close_popup() endif else return "\" endif endfunction " close popup and save indent or expand snippet imap CleverCr() " , : close popup and delete backword char. inoremap neocomplete#smart_close_popup()."\" inoremap neocomplete#smart_close_popup() endif " : completion. inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" " Courtesy of Matteo Cavalleri function! CleverTab() if pumvisible() return "\" endif let substr = strpart(getline('.'), 0, col('.') - 1) let substr = matchstr(substr, '[^ \t]*$') if strlen(substr) == 0 " nothing to match on empty string return "\" else " existing text matching if neosnippet#expandable_or_jumpable() return "\(neosnippet_expand_or_jump)" else return neocomplete#start_manual_complete() endif endif endfunction imap CleverTab() " } " Enable heavy omni completion. if !exists('g:neocomplete#sources#omni#input_patterns') let g:neocomplete#sources#omni#input_patterns = {} endif let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::' let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' let g:neocomplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::' " } " neocomplcache { elseif count(g:spf13_bundle_groups, 'neocomplcache') let g:acp_enableAtStartup = 0 let g:neocomplcache_enable_at_startup = 1 let g:neocomplcache_enable_camel_case_completion = 1 let g:neocomplcache_enable_smart_case = 1 let g:neocomplcache_enable_underbar_completion = 1 let g:neocomplcache_enable_auto_delimiter = 1 let g:neocomplcache_max_list = 15 let g:neocomplcache_force_overwrite_completefunc = 1 " Define dictionary. let g:neocomplcache_dictionary_filetype_lists = { \ 'default' : '', \ 'vimshell' : $HOME.'/.vimshell_hist', \ 'scheme' : $HOME.'/.gosh_completions' \ } " Define keyword. if !exists('g:neocomplcache_keyword_patterns') let g:neocomplcache_keyword_patterns = {} endif let g:neocomplcache_keyword_patterns._ = '\h\w*' " Plugin key-mappings { " These two lines conflict with the default digraph mapping of imap (neosnippet_expand_or_jump) smap (neosnippet_expand_or_jump) if exists('g:spf13_noninvasive_completion') inoremap " takes you out of insert mode inoremap pumvisible() ? "\\" : "\" " accepts first, then sends the inoremap pumvisible() ? "\\" : "\" " and cycle like and inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" " Jump up and down the list inoremap pumvisible() ? "\\\" : "\" inoremap pumvisible() ? "\\\" : "\" else imap neosnippet#expandable() ? \ "\(neosnippet_expand_or_jump)" : (pumvisible() ? \ "\" : "\(neosnippet_expand_or_jump)") smap (neosnippet_jump_or_expand) inoremap neocomplcache#undo_completion() inoremap neocomplcache#complete_common_string() "inoremap neocomplcache#complete_common_string() function! CleverCr() if pumvisible() if neosnippet#expandable() let exp = "\(neosnippet_expand)" return exp . neocomplcache#close_popup() else return neocomplcache#close_popup() endif else return "\" endif endfunction " close popup and save indent or expand snippet imap CleverCr() " : close popup " : close popup and save indent. inoremap pumvisible() ? neocomplcache#close_popup()."\" : "\" "inoremap pumvisible() ? neocomplcache#close_popup() : "\" " , : close popup and delete backword char. inoremap neocomplcache#smart_close_popup()."\" inoremap neocomplcache#close_popup() endif " : completion. inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" " } " Enable omni completion. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc " Enable heavy omni completion. if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif let g:neocomplcache_omni_patterns.php = '[^. \t]->\h\w*\|\h\w*::' let g:neocomplcache_omni_patterns.perl = '\h\w*->\h\w*\|\h\w*::' let g:neocomplcache_omni_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)' let g:neocomplcache_omni_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::' let g:neocomplcache_omni_patterns.go = '\h\w*\.\?' " } " Normal Vim omni-completion { " To disable omni complete, add the following to your .vimrc.before.local file: " let g:spf13_no_omni_complete = 1 elseif !exists('g:spf13_no_omni_complete') " Enable omni-completion. autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags autocmd FileType ruby setlocal omnifunc=rubycomplete#Complete autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc endif " } " Snippets { if count(g:spf13_bundle_groups, 'neocomplcache') || \ count(g:spf13_bundle_groups, 'neocomplete') " Use honza's snippets. let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets' " Enable neosnippet snipmate compatibility mode let g:neosnippet#enable_snipmate_compatibility = 1 " For snippet_complete marker. if !exists("g:spf13_no_conceal") if has('conceal') set conceallevel=2 concealcursor=i endif endif " Enable neosnippets when using go let g:go_snippet_engine = "neosnippet" " Disable the neosnippet preview candidate window " When enabled, there can be too much visual noise " especially when splits are used. set completeopt-=preview endif " } " FIXME: Isn't this for Syntastic to handle? " Haskell post write lint and check with ghcmod " $ `cabal install ghcmod` if missing and ensure " ~/.cabal/bin is in your $PATH. if !executable("ghcmod") autocmd BufWritePost *.hs GhcModCheckAndLintAsync endif " UndoTree { if isdirectory(expand("~/.vim/bundle/undotree/")) nnoremap u :UndotreeToggle " If undotree is opened, it is likely one wants to interact with it. let g:undotree_SetFocusWhenToggle=1 endif " } " indent_guides { if isdirectory(expand("~/.vim/bundle/vim-indent-guides/")) let g:indent_guides_start_level = 2 let g:indent_guides_guide_size = 1 let g:indent_guides_enable_on_vim_startup = 1 endif " } " Wildfire { let g:wildfire_objects = { \ "*" : ["i'", 'i"', "i)", "i]", "i}", "ip"], \ "html,xml" : ["at"], \ } " } " vim-airline { " Set configuration options for the statusline plugin vim-airline. " Use the powerline theme and optionally enable powerline symbols. " To use the symbols , , , , , , and .in the statusline " segments add the following to your .vimrc.before.local file: " let g:airline_powerline_fonts=1 " If the previous symbols do not render for you then install a " powerline enabled font. " See `:echo g:airline_theme_map` for some more choices " Default in terminal vim is 'dark' if isdirectory(expand("~/.vim/bundle/vim-airline-themes/")) if !exists('g:airline_theme') let g:airline_theme = 'solarized' endif if !exists('g:airline_powerline_fonts') " Use the default set of separators with a few customizations let g:airline_left_sep='›' " Slightly fancier than '>' let g:airline_right_sep='‹' " Slightly fancier than '<' endif endif " } " } " GUI Settings { " GVIM- (here instead of .gvimrc) if has('gui_running') set guioptions-=T " Remove the toolbar set lines=40 " 40 lines of text instead of 24 if !exists("g:spf13_no_big_font") if LINUX() && has("gui_running") set guifont=Andale\ Mono\ Regular\ 12,Menlo\ Regular\ 11,Consolas\ Regular\ 12,Courier\ New\ Regular\ 14 elseif OSX() && has("gui_running") set guifont=Andale\ Mono\ Regular:h12,Menlo\ Regular:h11,Consolas\ Regular:h12,Courier\ New\ Regular:h14 elseif WINDOWS() && has("gui_running") set guifont=Andale_Mono:h10,Menlo:h10,Consolas:h10,Courier_New:h10 endif endif else if &term == 'xterm' || &term == 'screen' set t_Co=256 " Enable 256 colors to stop the CSApprox warning and make xterm vim shine endif "set term=builtin_ansi " Make arrow and other keys work endif " } " Functions { " Initialize directories { function! InitializeDirectories() let parent = $HOME let prefix = 'vim' let dir_list = { \ 'backup': 'backupdir', \ 'views': 'viewdir', \ 'swap': 'directory' } if has('persistent_undo') let dir_list['undo'] = 'undodir' endif " To specify a different directory in which to place the vimbackup, " vimviews, vimundo, and vimswap files/directories, add the following to " your .vimrc.before.local file: " let g:spf13_consolidated_directory = " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/' if exists('g:spf13_consolidated_directory') let common_dir = g:spf13_consolidated_directory . prefix else let common_dir = parent . '/.' . prefix endif for [dirname, settingname] in items(dir_list) let directory = common_dir . dirname . '/' if exists("*mkdir") if !isdirectory(directory) call mkdir(directory) endif endif if !isdirectory(directory) echo "Warning: Unable to create backup directory: " . directory echo "Try: mkdir -p " . directory else let directory = substitute(directory, " ", "\\\\ ", "g") exec "set " . settingname . "=" . directory endif endfor endfunction call InitializeDirectories() " } " Initialize NERDTree as needed { function! NERDTreeInitAsNeeded() redir => bufoutput buffers! redir END let idx = stridx(bufoutput, "NERD_tree") if idx > -1 NERDTreeMirror NERDTreeFind wincmd l endif endfunction " } " Strip whitespace { function! StripTrailingWhitespace() " Preparation: save last search, and cursor position. let _s=@/ let l = line(".") let c = col(".") " do the business: %s/\s\+$//e " clean up: restore previous search history, and cursor position let @/=_s call cursor(l, c) endfunction " } " Shell command { function! s:RunShellCommand(cmdline) botright new setlocal buftype=nofile setlocal bufhidden=delete setlocal nobuflisted setlocal noswapfile setlocal nowrap setlocal filetype=shell setlocal syntax=shell call setline(1, a:cmdline) call setline(2, substitute(a:cmdline, '.', '=', 'g')) execute 'silent $read !' . escape(a:cmdline, '%#') setlocal nomodifiable 1 endfunction command! -complete=file -nargs=+ Shell call s:RunShellCommand() " e.g. Grep current file for : Shell grep -Hn % " } function! s:IsSpf13Fork() let s:is_fork = 0 let s:fork_files = ["~/.vimrc.fork", "~/.vimrc.before.fork", "~/.vimrc.bundles.fork"] for fork_file in s:fork_files if filereadable(expand(fork_file, ":p")) let s:is_fork = 1 break endif endfor return s:is_fork endfunction function! s:ExpandFilenameAndExecute(command, file) execute a:command . " " . expand(a:file, ":p") endfunction function! s:EditSpf13Config() call ExpandFilenameAndExecute("tabedit", "~/.vimrc") call ExpandFilenameAndExecute("vsplit", "~/.vimrc.before") call ExpandFilenameAndExecute("vsplit", "~/.vimrc.bundles") execute bufwinnr(".vimrc") . "wincmd w" call ExpandFilenameAndExecute("split", "~/.vimrc.local") wincmd l call ExpandFilenameAndExecute("split", "~/.vimrc.before.local") wincmd l call ExpandFilenameAndExecute("split", "~/.vimrc.bundles.local") if IsSpf13Fork() execute bufwinnr(".vimrc") . "wincmd w" call ExpandFilenameAndExecute("split", "~/.vimrc.fork") wincmd l call ExpandFilenameAndExecute("split", "~/.vimrc.before.fork") wincmd l call ExpandFilenameAndExecute("split", "~/.vimrc.bundles.fork") endif execute bufwinnr(".vimrc.local") . "wincmd w" endfunction execute "noremap " . s:spf13_edit_config_mapping " :call EditSpf13Config()" execute "noremap " . s:spf13_apply_config_mapping . " :source ~/.vimrc" " } " Use fork vimrc if available { if filereadable(expand("~/.vimrc.fork")) source ~/.vimrc.fork endif " } " Use local vimrc if available { if filereadable(expand("~/.vimrc.local")) source ~/.vimrc.local endif " } " Use local gvimrc if available and gui is running { if has('gui_running') if filereadable(expand("~/.gvimrc.local")) source ~/.gvimrc.local endif endif " } ================================================ FILE: .vimrc.before ================================================ " Modeline and Notes { " vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker: " " __ _ _____ _ " ___ _ __ / _/ |___ / __ __(_)_ __ ___ " / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \ " \__ \ |_) | _| |___) |_____|\ V / | | | | | | | " |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_| " |_| " " This is the personal .vimrc.before file of Steve Francia. " While much of it is beneficial for general use, I would " recommend picking out the parts you want and understand. " " This file is for options which must be set *before* plugins " are loaded and the main .vimrc config is run. Most of these " are for preventing mappings or commands from being created. " " You can find me at http://spf13.com " } " spf13 options { " Prevent automatically changing to open file directory " let g:spf13_no_autochdir = 1 " Disable views " let g:spf13_no_views = 1 " Leader keys " let g:spf13_leader='\' " let g:spf13_localleader='_' " Disable easier moving in tabs and windows " let g:spf13_no_easyWindows = 1 " Disable wrap relative motion for start/end line motions " let g:spf13_no_wrapRelMotion = 1 " Disable fast tab navigation " let g:spf13_no_fastTabs = 1 " Clear search highlighting " let g:spf13_clear_search_highlight = 1 " Disable neosnippet expansion " This maps over and does some Supertab " emulation with snippets " let g:spf13_no_neosnippet_expand = 1 " Disable whitespace stripping " let g:spf13_keep_trailing_whitespace = 1 " Enable powerline symbols " let g:airline_powerline_fonts = 1 " vim files directory " let g:spf13_consolidated_directory = " eg: let g:spf13_consolidated_directory = $HOME . '/.vim/' " This makes the completion popup strictly passive. " Keypresses acts normally. takes you of insert mode, words don't " automatically complete, pressing inserts a newline, etc. Iff the " menu is open, tab will cycle through it. If a snippet is selected, " expands it and jumps between fields. " let g:spf13_noninvasive_completion = 1 " Don't turn conceallevel or concealcursor " let g:spf13_no_conceal = 1 " For some colorschemes, autocolor will not work (eg: 'desert', 'ir_black') " Indent guides will attempt to set your colors smartly. If you " want to control them yourself, do it here. " let g:indent_guides_auto_colors = 0 " autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#212121 ctermbg=233 " autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#404040 ctermbg=234 " Leave the default font and size in GVim " To set your own font, do it from ~/.vimrc.local " let g:spf13_no_big_font = 1 " Disable omni complete " let g:spf13_no_omni_complete = 1 " Don't create default mappings for multicursors " See :help multiple-cursors-mappings " let g:multi_cursor_use_default_mapping=0 " let g:multi_cursor_next_key='' " let g:multi_cursor_prev_key='' " let g:multi_cursor_skip_key='' " let g:multi_cursor_quit_key='' " Require a special keypress to enter multiple cursors mode " let g:multi_cursor_start_key='+' " Mappings for editing/applying spf13 config " let g:spf13_edit_config_mapping='ev' " let g:spf13_apply_config_mapping='sv' " } " Use fork before if available { if filereadable(expand("~/.vimrc.before.fork")) source ~/.vimrc.before.fork endif " } " Use local before if available { if filereadable(expand("~/.vimrc.before.local")) source ~/.vimrc.before.local endif " } ================================================ FILE: .vimrc.bundles ================================================ " Modeline and Notes { " vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell: " " __ _ _____ _ " ___ _ __ / _/ |___ / __ __(_)_ __ ___ " / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \ " \__ \ |_) | _| |___) |_____|\ V / | | | | | | | " |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_| " |_| " " This is the personal .vimrc.bundles file of Steve Francia. " While much of it is beneficial for general use, I would " recommend picking out the parts you want and understand. " " This file imports the various plugins of spf13. If you " wish to alter which groups are imported, see vimrc.before. " If you wish to add or remove individual bundles, create " ~/.vimrc.bundles.local and `Bundle` or `UnBundle` as needed " from there. " " You can find me at http://spf13.com " } " Environment { " Basics { set nocompatible " Must be first line set background=dark " Assume a dark background " } " Windows Compatible { " On Windows, also use '.vim' instead of 'vimfiles'; this makes synchronization " across (heterogeneous) systems easier. if has('win32') || has('win64') set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after " Be nice and check for multi_byte even if the config requires " multi_byte support most of the time if has("multi_byte") " Windows cmd.exe still uses cp850. If Windows ever moved to " Powershell as the primary terminal, this would be utf-8 set termencoding=cp850 " Let Vim use utf-8 internally, because many scripts require this set encoding=utf-8 setglobal fileencoding=utf-8 " Windows has traditionally used cp1252, so it's probably wise to " fallback into cp1252 instead of eg. iso-8859-15. " Newer Windows files might contain utf-8 or utf-16 LE so we might " want to try them first. set fileencodings=ucs-bom,utf-8,utf-16le,cp1252,iso-8859-15 endif endif " } " Setup Bundle Support { " The next three lines ensure that the ~/.vim/bundle/ system works filetype off set rtp+=~/.vim/bundle/vundle call vundle#rc() " } " Add an UnBundle command { function! UnBundle(arg, ...) let bundle = vundle#config#init_bundle(a:arg, a:000) call filter(g:vundle#bundles, 'v:val["name_spec"] != "' . a:arg . '"') endfunction com! -nargs=+ UnBundle \ call UnBundle() " } " } " Bundles { " Deps { Bundle 'gmarik/vundle' Bundle 'MarcWeber/vim-addon-mw-utils' Bundle 'tomtom/tlib_vim' if executable('ag') Bundle 'mileszs/ack.vim' let g:ackprg = 'ag --nogroup --nocolor --column --smart-case' elseif executable('ack-grep') let g:ackprg="ack-grep -H --nocolor --nogroup --column" Bundle 'mileszs/ack.vim' elseif executable('ack') Bundle 'mileszs/ack.vim' endif " } " In your .vimrc.before.local file " list only the plugin groups you will use if !exists('g:spf13_bundle_groups') let g:spf13_bundle_groups=['general', 'writing', 'neocomplete', 'programming', 'php', 'ruby', 'python', 'javascript', 'html', 'misc',] endif " To override all the included bundles, add the following to your " .vimrc.bundles.local file: " let g:override_spf13_bundles = 1 if !exists("g:override_spf13_bundles") " General { if count(g:spf13_bundle_groups, 'general') Bundle 'scrooloose/nerdtree' Bundle 'altercation/vim-colors-solarized' Bundle 'spf13/vim-colors' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-repeat' Bundle 'rhysd/conflict-marker.vim' Bundle 'jiangmiao/auto-pairs' Bundle 'ctrlpvim/ctrlp.vim' Bundle 'tacahiroy/ctrlp-funky' Bundle 'terryma/vim-multiple-cursors' Bundle 'vim-scripts/sessionman.vim' Bundle 'matchit.zip' if (has("python") || has("python3")) && exists('g:spf13_use_powerline') && !exists('g:spf13_use_old_powerline') Bundle 'Lokaltog/powerline', {'rtp':'/powerline/bindings/vim'} elseif exists('g:spf13_use_powerline') && exists('g:spf13_use_old_powerline') Bundle 'Lokaltog/vim-powerline' else Bundle 'vim-airline/vim-airline' Bundle 'vim-airline/vim-airline-themes' endif Bundle 'powerline/fonts' Bundle 'bling/vim-bufferline' Bundle 'easymotion/vim-easymotion' Bundle 'jistr/vim-nerdtree-tabs' Bundle 'flazz/vim-colorschemes' Bundle 'mbbill/undotree' Bundle 'nathanaelkane/vim-indent-guides' if !exists('g:spf13_no_views') Bundle 'vim-scripts/restore_view.vim' endif Bundle 'mhinz/vim-signify' Bundle 'tpope/vim-abolish.git' Bundle 'osyo-manga/vim-over' Bundle 'kana/vim-textobj-user' Bundle 'kana/vim-textobj-indent' Bundle 'gcmt/wildfire.vim' endif " } " Writing { if count(g:spf13_bundle_groups, 'writing') Bundle 'reedes/vim-litecorrect' Bundle 'reedes/vim-textobj-sentence' Bundle 'reedes/vim-textobj-quote' Bundle 'reedes/vim-wordy' endif " } " General Programming { if count(g:spf13_bundle_groups, 'programming') " Pick one of the checksyntax, jslint, or syntastic Bundle 'scrooloose/syntastic' Bundle 'tpope/vim-fugitive' Bundle 'mattn/webapi-vim' Bundle 'mattn/gist-vim' Bundle 'scrooloose/nerdcommenter' Bundle 'tpope/vim-commentary' Bundle 'godlygeek/tabular' Bundle 'luochen1990/rainbow' if executable('ctags') Bundle 'majutsushi/tagbar' endif endif " } " Snippets & AutoComplete { if count(g:spf13_bundle_groups, 'snipmate') Bundle 'garbas/vim-snipmate' Bundle 'honza/vim-snippets' " Source support_function.vim to support vim-snippets. if filereadable(expand("~/.vim/bundle/vim-snippets/snippets/support_functions.vim")) source ~/.vim/bundle/vim-snippets/snippets/support_functions.vim endif elseif count(g:spf13_bundle_groups, 'youcompleteme') Bundle 'Valloric/YouCompleteMe' Bundle 'SirVer/ultisnips' Bundle 'honza/vim-snippets' elseif count(g:spf13_bundle_groups, 'neocomplcache') Bundle 'Shougo/neocomplcache' Bundle 'Shougo/neosnippet' Bundle 'Shougo/neosnippet-snippets' Bundle 'honza/vim-snippets' elseif count(g:spf13_bundle_groups, 'neocomplete') Bundle 'Shougo/neocomplete.vim.git' Bundle 'Shougo/neosnippet' Bundle 'Shougo/neosnippet-snippets' Bundle 'honza/vim-snippets' endif " } " PHP { if count(g:spf13_bundle_groups, 'php') Bundle 'spf13/PIV' Bundle 'arnaud-lb/vim-php-namespace' Bundle 'beyondwords/vim-twig' endif " } " Python { if count(g:spf13_bundle_groups, 'python') " Pick either python-mode or pyflakes & pydoc Bundle 'klen/python-mode' Bundle 'yssource/python.vim' Bundle 'python_match.vim' Bundle 'pythoncomplete' endif " } " Javascript { if count(g:spf13_bundle_groups, 'javascript') Bundle 'elzr/vim-json' Bundle 'groenewege/vim-less' Bundle 'pangloss/vim-javascript' Bundle 'briancollins/vim-jst' Bundle 'kchmck/vim-coffee-script' endif " } " Scala { if count(g:spf13_bundle_groups, 'scala') Bundle 'derekwyatt/vim-scala' Bundle 'derekwyatt/vim-sbt' Bundle 'xptemplate' endif " } " Haskell { if count(g:spf13_bundle_groups, 'haskell') Bundle 'travitch/hasksyn' Bundle 'dag/vim2hs' Bundle 'Twinside/vim-haskellConceal' Bundle 'Twinside/vim-haskellFold' Bundle 'lukerandall/haskellmode-vim' Bundle 'eagletmt/neco-ghc' Bundle 'eagletmt/ghcmod-vim' Bundle 'Shougo/vimproc.vim' Bundle 'adinapoli/cumino' Bundle 'bitc/vim-hdevtools' endif " } " HTML { if count(g:spf13_bundle_groups, 'html') Bundle 'amirh/HTML-AutoCloseTag' Bundle 'hail2u/vim-css3-syntax' Bundle 'gorodinskiy/vim-coloresque' Bundle 'tpope/vim-haml' Bundle 'mattn/emmet-vim' endif " } " Ruby { if count(g:spf13_bundle_groups, 'ruby') Bundle 'tpope/vim-rails' let g:rubycomplete_buffer_loading = 1 "let g:rubycomplete_classes_in_global = 1 "let g:rubycomplete_rails = 1 endif " } " Puppet { if count(g:spf13_bundle_groups, 'puppet') Bundle 'rodjek/vim-puppet' endif " } " Go Lang { if count(g:spf13_bundle_groups, 'go') "Bundle 'Blackrush/vim-gocode' Bundle 'fatih/vim-go' endif " } " Elixir { if count(g:spf13_bundle_groups, 'elixir') Bundle 'elixir-lang/vim-elixir' Bundle 'carlosgaldino/elixir-snippets' Bundle 'mattreduce/vim-mix' endif " } " Misc { if count(g:spf13_bundle_groups, 'misc') Bundle 'rust-lang/rust.vim' Bundle 'tpope/vim-markdown' Bundle 'spf13/vim-preview' Bundle 'tpope/vim-cucumber' Bundle 'cespare/vim-toml' Bundle 'quentindecock/vim-cucumber-align-pipes' Bundle 'saltstack/salt-vim' endif " } endif " } " Use fork bundles config if available { if filereadable(expand("~/.vimrc.bundles.fork")) source ~/.vimrc.bundles.fork endif " } " Use local bundles config if available { if filereadable(expand("~/.vimrc.bundles.local")) source ~/.vimrc.bundles.local endif " } ================================================ FILE: .vimrc.bundles.default ================================================ " Default Bundles { " Use before config if available { if filereadable(expand("~/.vimrc.before")) source ~/.vimrc.before endif " } " Use bundles config { if filereadable(expand("~/.vimrc.bundles")) source ~/.vimrc.bundles endif " } " } ================================================ FILE: LICENSE.txt ================================================ Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2014 Steve Francia Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ================================================ FILE: README.markdown ================================================ # spf13-vim : Steve Francia's Vim Distribution __ _ _____ _ ___ _ __ / _/ |___ / __ __(_)_ __ ___ / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \ \__ \ |_) | _| |___) |_____|\ V / | | | | | | | |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_| |_| spf13-vim is a distribution of vim plugins and resources for Vim, Gvim and [MacVim]. It is a good starting point for anyone intending to use VIM for development running equally well on Windows, Linux, \*nix and Mac. The distribution is completely customisable using a `~/.vimrc.local`, `~/.vimrc.bundles.local`, and `~/.vimrc.before.local` Vim RC files. ![spf13-vim image][spf13-vim-img] Unlike traditional VIM plugin structure, which similar to UNIX throws all files into common directories, making updating or disabling plugins a real mess, spf13-vim 3 uses the [Vundle] plugin management system to have a well organized vim directory (Similar to mac's app folders). Vundle also ensures that the latest versions of your plugins are installed and makes it easy to keep them up to date. Great care has been taken to ensure that each plugin plays nicely with others, and optional configuration has been provided for what we believe is the most efficient use. Lastly (and perhaps, most importantly) It is completely cross platform. It works well on Windows, Linux and OSX without any modifications or additional configurations. If you are using [MacVim] or Gvim additional features are enabled. So regardless of your environment just clone and run. # Installation ## Requirements To make all the plugins work, specifically [neocomplete](https://github.com/Shougo/neocomplete.vim), you need [vim with lua](https://github.com/Shougo/neocomplete.vim#requirements). ## Linux, \*nix, Mac OSX Installation The easiest way to install spf13-vim is to use our [automatic installer](https://j.mp/spf13-vim3) by simply copying and pasting the following line into a terminal. This will install spf13-vim and backup your existing vim configuration. If you are upgrading from a prior version (before 3.0) this is also the recommended installation. *Requires Git 1.7+ and Vim 7.3+* ```bash curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh ``` If you have a bash-compatible shell you can run the script directly: ```bash sh <(curl https://j.mp/spf13-vim3 -L) ``` ## Installing on Windows On Windows and \*nix [Git] and [Curl] are required. Also, if you haven't done so already, you'll need to install [Vim]. The quickest option to install all three dependencies ([Git], [Curl], [Vim] and [spf13-vim]) is via [Chocolatey] NuGet. After installing [Chocolatey], execute the following commands on the _command prompt_: C:\> choco install spf13-vim _Note: The [spf13-vim package] will install Vim also!_ If you want to install [msysgit], [Curl] and [spf13-vim] individually, follow the directions below. ### Installing dependencies #### Install [Vim] After the installation of Vim you must add a new directory to your environment variables path to make it work with the script installation of spf13. Open Vim and write the following command, it will show the installed directory: :echo $VIMRUNTIME C:\Program Files (X86)\Vim\vim74 Then you need to add it to your environment variable path. After that try execute `vim` within command prompt (press Win-R, type `cmd`, press Enter) and you’ll see the default vim page. #### Install [msysgit] After installation try running `git --version` within _command prompt_ (press Win-R, type `cmd`, press Enter) to make sure all good: C:\> git --version git version 1.7.4.msysgit.0 #### Setup [Curl] _Instructions blatently copied from vundle readme_ Installing Curl on Windows is easy as [Curl] is bundled with [msysgit]! But before it can be used with [Vundle] it's required make `curl` run in _command prompt_. The easiest way is to create `curl.cmd` with [this content](https://gist.github.com/912993) @rem Do not use "echo off" to not affect any child calls. @setlocal @rem Get the abolute path to the parent directory, which is assumed to be the @rem Git installation root. @for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI @set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH% @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @curl.exe %* And copy it to `C:\Program Files\Git\cmd\curl.cmd`, assuming [msysgit] was installed to `c:\Program Files\Git` to verify all good, run: C:\> curl --version curl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k zlib/1.2.3 Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp Features: Largefile NTLM SSL SSPI libz #### Installing spf13-vim on Windows The easiest way is to download and run the spf13-vim-windows-install.cmd file. Remember to run this file in **Administrator Mode** if you want the symlinks to be created successfully. ## Updating to the latest version The simpliest (and safest) way to update is to simply rerun the installer. It will completely and non destructively upgrade to the latest version. ```bash curl https://j.mp/spf13-vim3 -L -o - | sh ``` Alternatively you can manually perform the following steps. If anything has changed with the structure of the configuration you will need to create the appropriate symlinks. ```bash cd $HOME/to/spf13-vim/ git pull vim +BundleInstall! +BundleClean +q ``` ### Fork me on GitHub I'm always happy to take pull requests from others. A good number of people are already [contributors] to [spf13-vim]. Go ahead and fork me. # A highly optimized .vimrc config file ![spf13-vimrc image][spf13-vimrc-img] The .vimrc file is suited to programming. It is extremely well organized and folds in sections. Each section is labeled and each option is commented. It fixes many of the inconveniences of vanilla vim including * A single config can be used across Windows, Mac and linux * Eliminates swap and backup files from littering directories, preferring to store in a central location. * Fixes common typos like :W, :Q, etc * Setup a solid set of settings for Formatting (change to meet your needs) * Setup the interface to take advantage of vim's features including * omnicomplete * line numbers * syntax highlighting * A better ruler & status line * & more * Configuring included plugins ## Customization Create `~/.vimrc.local` and `~/.gvimrc.local` for any local customizations. For example, to override the default color schemes: ```bash echo colorscheme ir_black >> ~/.vimrc.local ``` ### Before File Create a `~/.vimrc.before.local` file to define any customizations that get loaded *before* the spf13-vim `.vimrc`. For example, to prevent autocd into a file directory: ```bash echo let g:spf13_no_autochdir = 1 >> ~/.vimrc.before.local ``` For a list of available spf13-vim specific customization options, look at the `~/.vimrc.before` file. ### Fork Customization There is an additional tier of customization available to those who want to maintain a fork of spf13-vim specialized for a particular group. These users can create `.vimrc.fork` and `.vimrc.bundles.fork` files in the root of their fork. The load order for the configuration is: 1. `.vimrc.before` - spf13-vim before configuration 2. `.vimrc.before.fork` - fork before configuration 3. `.vimrc.before.local` - before user configuration 4. `.vimrc.bundles` - spf13-vim bundle configuration 5. `.vimrc.bundles.fork` - fork bundle configuration 6. `.vimrc.bundles.local` - local user bundle configuration 6. `.vimrc` - spf13-vim vim configuration 7. `.vimrc.fork` - fork vim configuration 8. `.vimrc.local` - local user configuration See `.vimrc.bundles` for specifics on what options can be set to override bundle configuration. See `.vimrc.before` for specifics on what options can be overridden. Most vim configuration options should be set in your `.vimrc.fork` file, bundle configuration needs to be set in your `.vimrc.bundles.fork` file. You can specify the default bundles for your fork using `.vimrc.before.fork` file. Here is how to create an example `.vimrc.before.fork` file in a fork repo for the default bundles. ```bash echo let g:spf13_bundle_groups=[\'general\', \'programming\', \'misc\', \'youcompleteme\'] >> .vimrc.before.fork ``` Once you have this file in your repo, only the bundles you specified will be installed during the first installation of your fork. You may also want to update your `README.markdown` file so that the `bootstrap.sh` link points to your repository and your `bootstrap.sh` file to pull down your fork. For an example of a fork of spf13-vim that provides customization in this manner see [taxilian's fork](https://github.com/taxilian/spf13-vim). ### Easily Editing Your Configuration `ev` opens a new tab containing the .vimrc configuration files listed above. This makes it easier to get an overview of your configuration and make customizations. `sv` sources the .vimrc file, instantly applying your customizations to the currently running vim instance. These two mappings can themselves be customized by setting the following in .vimrc.before.local: ```bash let g:spf13_edit_config_mapping='ev' let g:spf13_apply_config_mapping='sv' ``` # Plugins spf13-vim contains a curated set of popular vim plugins, colors, snippets and syntaxes. Great care has been made to ensure that these plugins play well together and have optimal configuration. ## Adding new plugins Create `~/.vimrc.bundles.local` for any additional bundles. To add a new bundle, just add one line for each bundle you want to install. The line should start with the word "Bundle" followed by a string of either the vim.org project name or the githubusername/githubprojectname. For example, the github project [spf13/vim-colors](https://github.com/spf13/vim-colors) can be added with the following command ```bash echo Bundle \'spf13/vim-colors\' >> ~/.vimrc.bundles.local ``` Once new plugins are added, they have to be installed. ```bash vim +BundleInstall! +BundleClean +q ``` ## Removing (disabling) an included plugin Create `~/.vimrc.local` if it doesn't already exist. Add the UnBundle command to this line. It takes the same input as the Bundle line, so simply copy the line you want to disable and add 'Un' to the beginning. For example, disabling the 'AutoClose' and 'scrooloose/syntastic' plugins ```bash echo UnBundle \'AutoClose\' >> ~/.vimrc.bundles.local echo UnBundle \'scrooloose/syntastic\' >> ~/.vimrc.bundles.local ``` **Remember to run ':BundleClean!' after this to remove the existing directories** Here are a few of the plugins: ## [Undotree] If you undo changes and then make a new change, in most editors the changes you undid are gone forever, as their undo-history is a simple list. Since version 7.0 vim uses an undo-tree instead. If you make a new change after undoing changes, a new branch is created in that tree. Combined with persistent undo, this is nearly as flexible and safe as git ;-) Undotree makes that feature more accessible by creating a visual representation of said undo-tree. **QuickStart** Launch using `u`. ## [NERDTree] NERDTree is a file explorer plugin that provides "project drawer" functionality to your vim editing. You can learn more about it with `:help NERDTree`. **QuickStart** Launch using `e`. **Customizations**: * Use `` to toggle NERDTree * Use `e` or `nt` to load NERDTreeFind which opens NERDTree where the current file is located. * Hide clutter ('\.pyc', '\.git', '\.hg', '\.svn', '\.bzr') * Treat NERDTree more like a panel than a split. ## [ctrlp] Ctrlp replaces the Command-T plugin with a 100% viml plugin. It provides an intuitive and fast mechanism to load files from the file system (with regex and fuzzy find), from open buffers, and from recently used files. **QuickStart** Launch using ``. ## [Surround] This plugin is a tool for dealing with pairs of "surroundings." Examples of surroundings include parentheses, quotes, and HTML tags. They are closely related to what Vim refers to as text-objects. Provided are mappings to allow for removing, changing, and adding surroundings. Details follow on the exact semantics, but first, consider the following examples. An asterisk (*) is used to denote the cursor position. Old text Command New text ~ "Hello *world!" ds" Hello world! [123+4*56]/2 cs]) (123+456)/2 "Look ma, I'm *HTML!" cs" Look ma, I'm HTML! if *x>3 { ysW( if ( x>3 ) { my $str = *whee!; vllllS' my $str = 'whee!'; For instance, if the cursor was inside `"foo bar"`, you could type `cs"'` to convert the text to `'foo bar'`. There's a lot more, check it out at `:help surround` ## [NERDCommenter] NERDCommenter allows you to wrangle your code comments, regardless of filetype. View `help :NERDCommenter` or checkout my post on [NERDCommenter](http://spf13.com/post/vim-plugins-nerd-commenter). **QuickStart** Toggle comments using `c` in Visual or Normal mode. ## [neocomplete] Neocomplete is an amazing autocomplete plugin with additional support for snippets. It can complete simulatiously from the dictionary, buffer, omnicomplete and snippets. This is the one true plugin that brings Vim autocomplete on par with the best editors. **QuickStart** Just start typing, it will autocomplete where possible **Customizations**: * Automatically present the autocomplete menu * Support tab and enter for autocomplete * `` for completing snippets using [Neosnippet](https://github.com/Shougo/neosnippet.vim). ![neocomplete image][autocomplete-img] ## [YouCompleteMe] YouCompleteMe is another amazing completion engine. It is slightly more involved to set up as it contains a binary component that the user needs to compile before it will work. As a result of this however it is very fast. To enable YouCompleteMe add `youcompleteme` to your list of groups by overriding it in your `.vimrc.before.local` like so: `let g:spf13_bundle_groups=['general', 'programming', 'misc', 'scala', 'youcompleteme']` This is just an example. Remember to choose the other groups you want here. Once you have done this you will need to get Vundle to grab the latest code from git. You can do this by calling `:BundleInstall!`. You should see YouCompleteMe in the list. You will now have the code in your bundles directory and can proceed to compile the core. Change to the directory it has been downloaded to. If you have a vanilla install then `cd ~/.spf13-vim-3/.vim/bundle/YouCompleteMe/` should do the trick. You should see a file in this directory called install.sh. There are a few options to consider before running the installer: * Do you want clang support (if you don't know what this is then you likely don't need it)? * Do you want to link against a local libclang or have the installer download the latest for you? * Do you want support for c# via the omnisharp server? The plugin is well documented on the site linked above. Be sure to give that a read and make sure you understand the options you require. For java users wanting to use eclim be sure to add `let g:EclimCompletionMethod = 'omnifunc'` to your .vimrc.local. ## [Syntastic] Syntastic is a syntax checking plugin that runs buffers through external syntax checkers as they are saved and opened. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them. ## [AutoClose] AutoClose does what you expect. It's simple, if you open a bracket, paren, brace, quote, etc, it automatically closes it. It handles curlys correctly and doesn't get in the way of double curlies for things like jinja and twig. ## [Fugitive] Fugitive adds pervasive git support to git directories in vim. For more information, use `:help fugitive` Use `:Gstatus` to view `git status` and type `-` on any file to stage or unstage it. Type `p` on a file to enter `git add -p` and stage specific hunks in the file. Use `:Gdiff` on an open file to see what changes have been made to that file **QuickStart** `gs` to bring up git status **Customizations**: * `gs` :Gstatus * `gd` :Gdiff * `gc` :Gcommit * `gb` :Gblame * `gl` :Glog * `gp` :Git push * `gw` :Gwrite * :Git ___ will pass anything along to git. ![fugitive image][fugitive-img] ## [PIV] The most feature complete and up to date PHP Integration for Vim with proper support for PHP 5.3+ including latest syntax, functions, better fold support, etc. PIV provides: * PHP 5.3 support * Auto generation of PHP Doc (,pd on (function, variable, class) definition line) * Autocomplete of classes, functions, variables, constants and language keywords * Better indenting * Full PHP documentation manual (hit K on any function for full docs) ![php vim itegration image][phpmanual-img] ## [Ack.vim] Ack.vim uses ack to search inside the current directory for a pattern. You can learn more about it with `:help Ack` **QuickStart** :Ack ## [Tabularize] Tabularize lets you align statements on their equal signs and other characters **Customizations**: * `a= :Tabularize /=` * `a: :Tabularize /:` * `a:: :Tabularize /:\zs` * `a, :Tabularize /,` * `a :Tabularize /` ## [Tagbar] spf13-vim includes the Tagbar plugin. This plugin requires exuberant-ctags and will automatically generate tags for your open files. It also provides a panel to navigate easily via tags **QuickStart** `CTRL-]` while the cursor is on a keyword (such as a function name) to jump to its definition. **Customizations**: spf13-vim binds `tt` to toggle the tagbar panel ![tagbar image][tagbar-img] **Note**: For full language support, run `brew install ctags` to install exuberant-ctags. **Tip**: Check out `:help ctags` for information about VIM's built-in ctag support. Tag navigation creates a stack which can traversed via `Ctrl-]` (to find the source of a token) and `Ctrl-T` (to jump back up one level). ## [EasyMotion] EasyMotion provides an interactive way to use motions in Vim. It quickly maps each possible jump destination to a key allowing very fast and straightforward movement. **QuickStart** EasyMotion is triggered using the normal movements, but prefixing them with `` For example this screen shot demonstrates pressing `,,w` ![easymotion image][easymotion-img] ## [Airline] Airline provides a lightweight themable statusline with no external dependencies. By default this configuration uses the symbols `‹` and `›` as separators for different statusline sections but can be configured to use the same symbols as [Powerline]. An example first without and then with powerline symbols is shown here: ![airline image][airline-img] To enable powerline symbols first install one of the [Powerline Fonts] or patch your favorite font using the provided instructions. Configure your terminal, MacVim, or Gvim to use the desired font. Finally add `let g:airline_powerline_fonts=1` to your `.vimrc.before.local`. ## Additional Syntaxes spf13-vim ships with a few additional syntaxes: * Markdown (bound to \*.markdown, \*.md, and \*.mk) * Twig * Git commits (set your `EDITOR` to `mvim -f`) ## Amazing Colors spf13-vim includes [solarized] and [spf13 vim color pack](https://github.com/spf13/vim-colors/): * ir_black * molokai * peaksea Use `:color molokai` to switch to a color scheme. Terminal Vim users will benefit from solarizing their terminal emulators and setting solarized support to 16 colors: let g:solarized_termcolors=16 color solarized Terminal emulator colorschemes: * http://ethanschoonover.com/solarized (iTerm2, Terminal.app) * https://github.com/phiggins/konsole-colors-solarized (KDE Konsole) * https://github.com/sigurdga/gnome-terminal-colors-solarized (Gnome Terminal) ## Snippets It also contains a very complete set of [snippets](https://github.com/spf13/snipmate-snippets) for use with snipmate or [neocomplete]. # Intro to VIM Here's some tips if you've never used VIM before: ## Tutorials * Type `vimtutor` into a shell to go through a brief interactive tutorial inside VIM. * Read the slides at [VIM: Walking Without Crutches](https://walking-without-crutches.heroku.com/#1). ## Modes * VIM has two (common) modes: * insert mode- stuff you type is added to the buffer * normal mode- keys you hit are interpreted as commands * To enter insert mode, hit `i` * To exit insert mode, hit `` ## Useful commands * Use `:q` to exit vim * Certain commands are prefixed with a `` key, which by default maps to `\`. Spf13-vim uses `let mapleader = ","` to change this to `,` which is in a consistent and convenient location. * Keyboard [cheat sheet](http://www.viemu.com/vi-vim-cheat-sheet.gif). [![Analytics](https://ga-beacon.appspot.com/UA-7131036-5/spf13-vim/readme)](https://github.com/igrigorik/ga-beacon) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/spf13/spf13-vim/trend.png)](https://bitdeli.com/free "Bitdeli Badge") [Git]:http://git-scm.com [Curl]:http://curl.haxx.se [Vim]:http://www.vim.org/download.php#pc [msysgit]:http://msysgit.github.io [Chocolatey]: http://chocolatey.org/ [spf13-vim package]: https://chocolatey.org/packages/spf13-vim [MacVim]:http://code.google.com/p/macvim/ [spf13-vim]:https://github.com/spf13/spf13-vim [contributors]:https://github.com/spf13/spf13-vim/contributors [Vundle]:https://github.com/gmarik/vundle [PIV]:https://github.com/spf13/PIV [NERDCommenter]:https://github.com/scrooloose/nerdcommenter [Undotree]:https://github.com/mbbill/undotree [NERDTree]:https://github.com/scrooloose/nerdtree [ctrlp]:https://github.com/kien/ctrlp.vim [solarized]:https://github.com/altercation/vim-colors-solarized [neocomplete]:https://github.com/shougo/neocomplete [Fugitive]:https://github.com/tpope/vim-fugitive [Surround]:https://github.com/tpope/vim-surround [Tagbar]:https://github.com/majutsushi/tagbar [Syntastic]:https://github.com/scrooloose/syntastic [vim-easymotion]:https://github.com/Lokaltog/vim-easymotion [YouCompleteMe]:https://github.com/Valloric/YouCompleteMe [Matchit]:http://www.vim.org/scripts/script.php?script_id=39 [Tabularize]:https://github.com/godlygeek/tabular [EasyMotion]:https://github.com/Lokaltog/vim-easymotion [Airline]:https://github.com/bling/vim-airline [Powerline]:https://github.com/lokaltog/powerline [Powerline Fonts]:https://github.com/Lokaltog/powerline-fonts [AutoClose]:https://github.com/spf13/vim-autoclose [Ack.vim]:https://github.com/mileszs/ack.vim [spf13-vim-img]:https://i.imgur.com/UKToY.png [spf13-vimrc-img]:https://i.imgur.com/kZWj1.png [autocomplete-img]:https://i.imgur.com/90Gg7.png [tagbar-img]:https://i.imgur.com/cjbrC.png [fugitive-img]:https://i.imgur.com/4NrxV.png [nerdtree-img]:https://i.imgur.com/9xIfu.png [phpmanual-img]:https://i.imgur.com/c0GGP.png [easymotion-img]:https://i.imgur.com/ZsrVL.png [airline-img]:https://i.imgur.com/D4ZYADr.png ================================================ FILE: bootstrap.sh ================================================ #!/usr/bin/env bash # Copyright 2014 Steve Francia # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ############################ SETUP PARAMETERS app_name='spf13-vim' [ -z "$APP_PATH" ] && APP_PATH="$HOME/.spf13-vim-3" [ -z "$REPO_URI" ] && REPO_URI='https://github.com/spf13/spf13-vim.git' [ -z "$REPO_BRANCH" ] && REPO_BRANCH='3.0' debug_mode='0' fork_maintainer='0' [ -z "$VUNDLE_URI" ] && VUNDLE_URI="https://github.com/gmarik/vundle.git" ############################ BASIC SETUP TOOLS msg() { printf '%b\n' "$1" >&2 } success() { if [ "$ret" -eq '0' ]; then msg "\33[32m[✔]\33[0m ${1}${2}" fi } error() { msg "\33[31m[✘]\33[0m ${1}${2}" exit 1 } debug() { if [ "$debug_mode" -eq '1' ] && [ "$ret" -gt '1' ]; then msg "An error occurred in function \"${FUNCNAME[$i+1]}\" on line ${BASH_LINENO[$i+1]}, we're sorry for that." fi } program_exists() { local ret='0' command -v $1 >/dev/null 2>&1 || { local ret='1'; } # fail on non-zero return value if [ "$ret" -ne 0 ]; then return 1 fi return 0 } program_must_exist() { program_exists $1 # throw error on non-zero return value if [ "$?" -ne 0 ]; then error "You must have '$1' installed to continue." fi } variable_set() { if [ -z "$1" ]; then error "You must have your HOME environmental variable set to continue." fi } lnif() { if [ -e "$1" ]; then ln -sf "$1" "$2" fi ret="$?" debug } ############################ SETUP FUNCTIONS do_backup() { if [ -e "$1" ] || [ -e "$2" ] || [ -e "$3" ]; then msg "Attempting to back up your original vim configuration." today=`date +%Y%m%d_%s` for i in "$1" "$2" "$3"; do [ -e "$i" ] && [ ! -L "$i" ] && mv -v "$i" "$i.$today"; done ret="$?" success "Your original vim configuration has been backed up." debug fi } sync_repo() { local repo_path="$1" local repo_uri="$2" local repo_branch="$3" local repo_name="$4" msg "Trying to update $repo_name" if [ ! -e "$repo_path" ]; then mkdir -p "$repo_path" git clone -b "$repo_branch" "$repo_uri" "$repo_path" ret="$?" success "Successfully cloned $repo_name." else cd "$repo_path" && git pull origin "$repo_branch" ret="$?" success "Successfully updated $repo_name" fi debug } create_symlinks() { local source_path="$1" local target_path="$2" lnif "$source_path/.vimrc" "$target_path/.vimrc" lnif "$source_path/.vimrc.bundles" "$target_path/.vimrc.bundles" lnif "$source_path/.vimrc.before" "$target_path/.vimrc.before" lnif "$source_path/.vim" "$target_path/.vim" if program_exists "nvim"; then lnif "$source_path/.vim" "$target_path/.config/nvim" lnif "$source_path/.vimrc" "$target_path/.config/nvim/init.vim" fi touch "$target_path/.vimrc.local" ret="$?" success "Setting up vim symlinks." debug } setup_fork_mode() { local source_path="$2" local target_path="$3" if [ "$1" -eq '1' ]; then touch "$target_path/.vimrc.fork" touch "$target_path/.vimrc.bundles.fork" touch "$target_path/.vimrc.before.fork" lnif "$source_path/.vimrc.fork" "$target_path/.vimrc.fork" lnif "$source_path/.vimrc.bundles.fork" "$target_path/.vimrc.bundles.fork" lnif "$source_path/.vimrc.before.fork" "$target_path/.vimrc.before.fork" ret="$?" success "Created fork maintainer files." debug fi } setup_vundle() { local system_shell="$SHELL" export SHELL='/bin/sh' vim \ -u "$1" \ "+set nomore" \ "+BundleInstall!" \ "+BundleClean" \ "+qall" export SHELL="$system_shell" success "Now updating/installing plugins using Vundle" debug } ############################ MAIN() variable_set "$HOME" program_must_exist "vim" program_must_exist "git" do_backup "$HOME/.vim" \ "$HOME/.vimrc" \ "$HOME/.gvimrc" sync_repo "$APP_PATH" \ "$REPO_URI" \ "$REPO_BRANCH" \ "$app_name" create_symlinks "$APP_PATH" \ "$HOME" setup_fork_mode "$fork_maintainer" \ "$APP_PATH" \ "$HOME" sync_repo "$HOME/.vim/bundle/vundle" \ "$VUNDLE_URI" \ "master" \ "vundle" setup_vundle "$APP_PATH/.vimrc.bundles.default" msg "\nThanks for installing $app_name." msg "© `date +%Y` http://vim.spf13.com/" ================================================ FILE: config-dependencies.gv ================================================ digraph G { graph [layout=dot] // This is just an example for you to use as a template. // Edit as you like. Whenever you save a legal graph // the layout in the graphviz window will be updated. /* vim [href="http://www.vim.org/"] */ /* dot [href="http://www.graphviz.org/"] */ /* vimdot [href="file:///usr/bin/vimdot"] */ {_} -> _before {_before} -> _before_fork {_before_fork} -> _before_local {_ _before_local} -> _bundles {_bundles} -> _bundles_fork {_bundles} -> _bundles_local {_bundles_fork} -> _bundles_local {_ _bundles_local} -> _fork {_ _fork} -> _local {_ _local} -> g_local } ================================================ FILE: spf13-vim-windows-install.cmd ================================================ REM Copyright 2014 Steve Francia REM REM Licensed under the Apache License, Version 2.0 (the "License"); REM you may not use this file except in compliance with the License. REM You may obtain a copy of the License at REM REM http://www.apache.org/licenses/LICENSE-2.0 REM REM Unless required by applicable law or agreed to in writing, software REM distributed under the License is distributed on an "AS IS" BASIS, REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. REM See the License for the specific language governing permissions and REM limitations under the License. @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @set APP_PATH=%HOME%\.spf13-vim-3 IF NOT EXIST "%APP_PATH%" ( call git clone -b 3.0 https://github.com/spf13/spf13-vim.git "%APP_PATH%" ) ELSE ( @set ORIGINAL_DIR=%CD% echo updating spf13-vim chdir /d "%APP_PATH%" call git pull chdir /d "%ORIGINAL_DIR%" call cd "%APP_PATH%" ) call mklink "%HOME%\.vimrc" "%APP_PATH%\.vimrc" call mklink "%HOME%\_vimrc" "%APP_PATH%\.vimrc" call mklink "%HOME%\.vimrc.fork" "%APP_PATH%\.vimrc.fork" call mklink "%HOME%\.vimrc.bundles" "%APP_PATH%\.vimrc.bundles" call mklink "%HOME%\.vimrc.bundles.fork" "%APP_PATH%\.vimrc.bundles.fork" call mklink "%HOME%\.vimrc.before" "%APP_PATH%\.vimrc.before" call mklink "%HOME%\.vimrc.before.fork" "%APP_PATH%\.vimrc.before.fork" call mklink /J "%HOME%\.vim" "%APP_PATH%\.vim" IF NOT EXIST "%APP_PATH%\.vim\bundle" ( call mkdir "%APP_PATH%\.vim\bundle" ) IF NOT EXIST "%HOME%/.vim/bundle/vundle" ( call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle" ) ELSE ( call cd "%HOME%/.vim/bundle/vundle" call git pull call cd %HOME% ) call vim -u "%APP_PATH%/.vimrc.bundles" +BundleInstall! +BundleClean +qall ================================================ FILE: spf13-vim-windows-xp-install.cmd ================================================ REM Copyright 2014 Steve Francia REM REM Licensed under the Apache License, Version 2.0 (the "License"); REM you may not use this file except in compliance with the License. REM You may obtain a copy of the License at REM REM http://www.apache.org/licenses/LICENSE-2.0 REM REM Unless required by applicable law or agreed to in writing, software REM distributed under the License is distributed on an "AS IS" BASIS, REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. REM See the License for the specific language governing permissions and REM limitations under the License. @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH% @if not exist "%HOME%" @set HOME=%USERPROFILE% @set APP_PATH=%HOME%\.spf13-vim-3 @if not exist "%APP_PATH%" ( echo backing up existing vim config @set today=%DATE% @if exist "%HOME%\.vim" call xcopy /s/e/h/y/r/q/i "%HOME%\.vim" "%HOME%\.vim.%today%" @if exist "%HOME%\.vimrc" call copy "%HOME%\.vimrc" "%HOME%\.vimrc.%today%" @if exist "%HOME%\_vimrc" call copy "%HOME%\_vimrc" "%HOME%\_vimrc.%today%" @if exist "%HOME%\.gvimrc" call copy "%HOME%\.gvimrc" "%HOME%\.gvimrc.%today%" ) @if exist "%APP_PATH%" ( @set ORIGINAL_DIR=%CD% echo updating spf13-vim chdir /d "%APP_PATH%" && git pull chdir /d "%ORIGINAL_DIR%" ) else ( echo cloning spf13-vim call git clone -b 3.0 git://github.com/spf13/spf13-vim.git "%APP_PATH%" ) @if not exist "%APP_PATH%\.vim\bundle" call mkdir "%APP_PATH%\.vim\bundle" call xcopy /s/e/h/y/r/q/i "%APP_PATH%\.vim" "%HOME%\.vim" call copy "%APP_PATH%\.vimrc" "%HOME%\.vimrc" call copy "%APP_PATH%\.vimrc" "%HOME%\_vimrc" call copy "%APP_PATH%\.vimrc.fork" "%HOME%\.vimrc.fork" call copy "%APP_PATH%\.vimrc.bundles" "%HOME%\.vimrc.bundles" call copy "%APP_PATH%\.vimrc.bundles.fork" "%HOME%\.vimrc.bundles.fork" call copy "%APP_PATH%\.vimrc.before" "%HOME%\.vimrc.before" call copy "%APP_PATH%\.vimrc.before.fork" "%HOME%\.vimrc.before.fork" @if not exist "%HOME%/.vim/bundle/vundle" call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle" call vim -u "%APP_PATH%/.vimrc.bundles" - +BundleInstall! +BundleClean +qall ================================================ FILE: uninstall.sh ================================================ #!/usr/bin/env sh app_dir="$HOME/.spf13-vim-3" warn() { echo "$1" >&2 } die() { warn "$1" exit 1 } rm $HOME/.vimrc rm $HOME/.vimrc.bundles rm $HOME/.vim rm -rf $app_dir