" ================ CTRLP settings ================ if exists("g:ctrlp_user_command") unlet g:ctrlp_user_command endif if executable('ag') " Use ag in CtrlP for listing files. Lightning fast and respects .gitignore let g:ctrlp_user_command = \ 'ag %s --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"' " ag is fast enough that CtrlP doesn't need to cache let g:ctrlp_use_caching = 0 else " Fall back to using git ls-files if Ag is not available let g:ctrlp_custom_ignore = '\.git$\|\.hg$\|\.svn$' let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'] endif " Default to filename searches - so that appctrl will find application " controller let g:ctrlp_by_filename = 1 " Don't jump to already open window. This is annoying if you are maintaining " several Tab workspaces and want to open two windows into the same file. let g:ctrlp_switch_buffer = 0 " We don't want to use Ctrl-p as the mapping because " it interferes with YankRing (paste, then hit ctrl-p) let g:ctrlp_map = ',t' nnoremap ,t :CtrlP " Additional mapping for buffer search nnoremap ,b :CtrlPBuffer " Cmd-Shift-P to clear the cache nnoremap :ClearCtrlPCache " Idea from : http://www.charlietanksley.net/blog/blog/2011/10/18/vim-navigation-with-lustyexplorer-and-lustyjuggler/ " Open CtrlP starting from a particular path, making it much " more likely to find the correct thing first. mnemonic 'jump to [something]' map ,ja :CtrlP app/assets map ,jm :CtrlP app/models map ,jc :CtrlP app/controllers map ,jv :CtrlP app/views map ,jh :CtrlP app/helpers map ,jl :CtrlP lib map ,jp :CtrlP public map ,js :CtrlP spec map ,jf :CtrlP fast_spec map ,jd :CtrlP db map ,jC :CtrlP config map ,jV :CtrlP vendor map ,jF :CtrlP factories map ,jT :CtrlP test "Cmd-Shift-(M)ethod - jump to a method (tag in current file) "Ctrl-m is not good - it overrides behavior of Enter nnoremap :CtrlPBufTag " ================ fugitive settings ================ " For fugitive.git, dp means :diffput. Define dg to mean :diffget nnoremap ,dg :diffget nnoremap ,dp :diffput " The tree buffer makes it easy to drill down through the directories of your " git repository, but it’s not obvious how you could go up a level to the " parent directory. Here’s a mapping of .. to the above command, but " only for buffers containing a git blob or tree autocmd User fugitive \ if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' | \ nnoremap .. :edit %:h | \ endif " Every time you open a git object using fugitive it creates a new buffer. " This means that your buffer listing can quickly become swamped with " fugitive buffers. This prevents this from becomming an issue: autocmd BufReadPost fugitive://* set bufhidden=delete " ================ jquery settings ================ autocmd BufRead,BufNewFile *.js set ft=javascript syntax=jquery " ================ lightline settings ================ let g:lightline = { \ 'colorscheme': 'wombat', \ 'active': { \ 'left': [ [ 'mode', 'paste' ], \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ] \ }, \ 'inactive': { \ 'left': [ [ 'mode' ], \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ] \ }, \ 'component': { \ 'readonly': '%{&readonly?"r":"rw"}', \ 'modified': '%{&filetype=="help"?"":&modified?"+":&modifiable?"":"-"}', \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}' \ }, \ 'component_visible_condition': { \ 'readonly': '(&filetype!="help"&& &readonly)', \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())', \ 'modified': '(&filetype!="help"&&(&modified||!&modifiable))' \ }, \ 'separator': { 'left': '', 'right': '' }, \ 'subseparator': { 'left': '|', 'right': '|' } \ } set laststatus=2 " ================ nerdtree-tabs settings ================ " Auto open nerd tree on startup let g:nerdtree_tabs_open_on_gui_startup = 0 " Focus in the main content window let g:nerdtree_tabs_focus_on_files = 1 " ================ nerdtree settings ================ " Make nerdtree look nice let NERDTreeMinimalUI = 1 let NERDTreeDirArrows = 1 let g:NERDTreeWinSize = 30 nmap :NERDTreeToggle " ================ persistent-undo settings ================ " persistent undos - undo after you re-open the file " but this gives warnings under command line vim " use only in macvim if v:version > '702' set undodir=~/.vim/backups set undofile endif " ================ Nerdcommenter settings ================ let g:NERDDefaultAlign = 'left' let g:NERDCommentEmptyLines = 1 " ================ showmarks settings ================ " Tell showmarks to not include the various brace marks (),{}, etc let g:showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY" " ================ syntastic settings ================ "mark syntax errors with :signs let g:syntastic_enable_signs=1 "automatically jump to the error when saving the file let g:syntastic_auto_jump=0 "show the error list automatically let g:syntastic_auto_loc_list=1 "disable warnings and false positive errors via regex let g:syntastic_quiet_messages = { "regex": [ \ '\mwhitespace before footnote', \ '\mpossible unwanted space at "{"', \ ],'level': 'warnings'} " ================ tComment settings ================ " tComment maps 'gcc' to comment current line " this adds 'gcp' comment current paragraph (block) " using tComment's built in p mapping nmap gcp p " ================ tidy settings ================ :vmap ,gt :!tidy -q -i --show-errors 0 " ================ vim-indent-guides settings ================ let g:indent_guides_auto_colors = 1 let g:indent_guides_start_level = 2 let g:indent_guides_guide_size = 1 " ================ vim-session settings ================ " Prevent vim-session from asking us to load the session. " If you want to load the session, use :SaveSession and :OpenSession let g:session_autosave = 'no' let g:session_autoload = 'no' " ================ tabular settings ================ " Hit Cmd-Shift-A then type a character you want to align by nmap :Tabularize / vmap :Tabularize / " ================ sudo settings ================ " w!! to write a file as sudo " stolen from Steve Losh cmap w!! w !sudo tee % >/dev/null " ================ YankRing settings ============== let g:yankring_history_dir = '$HOME/.vim' "let g:yankring_history_file = '.yankring-history' nnoremap ,yr :YRShow nnoremap :YRShow " ================ vim-processing settings ============== let g:processing_doc_style='local' let g:processing_doc_path='/usr/share/processing/modes/java/reference/' " ================ vim-colors-solarized ============== let g:solarized_termcolors=256 let g:solarized_termtrans=1 " ================ YouCompleteMe ============== " set let g:EclimCompletionMethod = 'omnifunc' " ================ supercollider ================ let g:scFlash = 1 let g:scSplitDirection = "v" let g:scSplitSize = 25