aboutsummaryrefslogtreecommitdiffstats
path: root/.vim/addons-settings.vim
diff options
context:
space:
mode:
Diffstat (limited to '.vim/addons-settings.vim')
-rw-r--r--.vim/addons-settings.vim181
1 files changed, 181 insertions, 0 deletions
diff --git a/.vim/addons-settings.vim b/.vim/addons-settings.vim
new file mode 100644
index 0000000..77a36aa
--- /dev/null
+++ b/.vim/addons-settings.vim
@@ -0,0 +1,181 @@
+" ================ 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 <silent> ,t :CtrlP<CR>
+
+" Additional mapping for buffer search
+nnoremap <silent> ,b :CtrlPBuffer<cr>
+
+" Cmd-Shift-P to clear the cache
+nnoremap <silent> <D-P> :ClearCtrlPCache<cr>
+
+" 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<CR>
+map ,jm :CtrlP app/models<CR>
+map ,jc :CtrlP app/controllers<CR>
+map ,jv :CtrlP app/views<CR>
+map ,jh :CtrlP app/helpers<CR>
+map ,jl :CtrlP lib<CR>
+map ,jp :CtrlP public<CR>
+map ,js :CtrlP spec<CR>
+map ,jf :CtrlP fast_spec<CR>
+map ,jd :CtrlP db<CR>
+map ,jC :CtrlP config<CR>
+map ,jV :CtrlP vendor<CR>
+map ,jF :CtrlP factories<CR>
+map ,jT :CtrlP test<CR>
+
+"Cmd-Shift-(M)ethod - jump to a method (tag in current file)
+"Ctrl-m is not good - it overrides behavior of Enter
+nnoremap <silent> <D-M> :CtrlPBufTag<CR>
+
+" ================ fugitive settings ================
+" For fugitive.git, dp means :diffput. Define dg to mean :diffget
+nnoremap <silent> ,dg :diffget<CR>
+nnoremap <silent> ,dp :diffput<CR>
+" 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 <buffer> .. :edit %:h<CR> |
+ \ 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' ],
+ \ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
+ \ },
+ \ 'component': {
+ \ 'readonly': '%{&readonly?"⭤":""}',
+ \ 'fugitive': '%{exists("*fugitive#head")?fugitive#head():""}'
+ \ },
+ \ 'component_visible_condition': {
+ \ 'fugitive': '(exists("*fugitive#head") && ""!=fugitive#head())'
+ \ },
+ \ '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
+
+" ================ 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
+
+" ================ 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
+"don't care about warnings
+let g:syntastic_quiet_messages = {'level': 'warnings'}
+
+" ================ tComment settings ================
+" tComment maps 'gcc' to comment current line
+" this adds 'gcp' comment current paragraph (block)
+" using tComment's built in <c-_>p mapping
+nmap <silent> gcp <c-_>p
+
+" ================ tidy settings ================
+:vmap ,gt :!tidy -q -i --show-errors 0<CR>
+
+" ================ 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 <D-A> :Tabularize /
+vmap <D-A> :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<CR>
+nnoremap <C-y> :YRShow<CR>
+
+" ================ vim-processing settings ==============
+let g:processing_doc_style='local'
+let g:processing_doc_path='~/.vim/bundle/vim-processing/syntax/processing.vim'
+
+" ================ vim-colors-solarized ==============
+let g:solarized_termcolors=256
+let g:solarized_termtrans=1
+"set background=black
+"colorscheme solarized