From 492408b767d68d297da7c41c3d0e9bf3a6b064b0 Mon Sep 17 00:00:00 2001 From: yan Date: Mon, 12 Dec 2011 18:21:42 -0800 Subject: [PATCH] Breaking vimrc apart into individual settings files in vim/plugin/settings --- README.md | 4 +- vim/plugin/settings/NERDtree.vim | 5 + vim/plugin/settings/README.md | 4 + vim/plugin/settings/Tlist.vim | 19 ++ vim/plugin/settings/autotag.vim | 3 + vim/plugin/settings/command-t.vim | 8 + vim/plugin/settings/conqueterm.vim | 11 + vim/plugin/settings/easymotion.vim | 14 ++ vim/plugin/settings/fugitive.git | 4 + vim/plugin/settings/guioptions.vim | 6 + vim/plugin/settings/lusty-juggler.vim | 10 + vim/plugin/settings/neocomplcache.vim | 9 + vim/plugin/settings/showmarks.vim | 2 + vim/plugin/settings/skwp-keymap.vim | 120 +++++++++ vim/plugin/settings/solarized.vim | 10 + vim/plugin/settings/statusline.vim | 29 +++ vim/plugin/settings/syntastic.vim | 8 + vim/plugin/settings/tComment.vim | 8 + vim/plugin/settings/vim-ruby-conque.vim | 3 + vimrc | 317 ++---------------------- 20 files changed, 290 insertions(+), 304 deletions(-) create mode 100644 vim/plugin/settings/NERDtree.vim create mode 100644 vim/plugin/settings/README.md create mode 100644 vim/plugin/settings/Tlist.vim create mode 100644 vim/plugin/settings/autotag.vim create mode 100644 vim/plugin/settings/command-t.vim create mode 100644 vim/plugin/settings/conqueterm.vim create mode 100644 vim/plugin/settings/easymotion.vim create mode 100644 vim/plugin/settings/fugitive.git create mode 100644 vim/plugin/settings/guioptions.vim create mode 100644 vim/plugin/settings/lusty-juggler.vim create mode 100644 vim/plugin/settings/neocomplcache.vim create mode 100644 vim/plugin/settings/showmarks.vim create mode 100644 vim/plugin/settings/skwp-keymap.vim create mode 100644 vim/plugin/settings/solarized.vim create mode 100644 vim/plugin/settings/statusline.vim create mode 100644 vim/plugin/settings/syntastic.vim create mode 100644 vim/plugin/settings/tComment.vim create mode 100644 vim/plugin/settings/vim-ruby-conque.vim diff --git a/README.md b/README.md index 5406049..d2ce1b6 100644 --- a/README.md +++ b/README.md @@ -130,8 +130,10 @@ TODO: these customizations will be extracted into a separate keybinding plugin s * F - instantly Find definition of class (must have exuberant ctags installed) * B - show buffers (LustyJuggler buffer search), just type to fuzzy match a buffer name * S - Show buffers in LustyJuggler (use asdfjkl home row keys to then select buffer) - * T - Tag list (list of methods in a class) + * \t - Tag list (list of methods in a class) + * Cmd-* - highlight all occurrences of current word (similar to regular * except doesn't move) + * ,hl - toggle search highlight on and off * K - git grep for the Kurrent word under the cursor * ,gg - GitGrep command line with a quote pretyped (close the quote yourself) * ,gcp - GitGrep Current Partial to find references to the current view partial diff --git a/vim/plugin/settings/NERDtree.vim b/vim/plugin/settings/NERDtree.vim new file mode 100644 index 0000000..31e9a07 --- /dev/null +++ b/vim/plugin/settings/NERDtree.vim @@ -0,0 +1,5 @@ +" Make nerdtree look nice +let NERDTreeMinimalUI = 1 +let NERDTreeDirArrows = 1 +let g:NERDTreeWinSize = 30 + diff --git a/vim/plugin/settings/README.md b/vim/plugin/settings/README.md new file mode 100644 index 0000000..875d502 --- /dev/null +++ b/vim/plugin/settings/README.md @@ -0,0 +1,4 @@ +This directory contains settings for various vim plugins and vim itself. + +For cleanliness, each plugin's overrides/settings should be put into a +separate file. diff --git a/vim/plugin/settings/Tlist.vim b/vim/plugin/settings/Tlist.vim new file mode 100644 index 0000000..3ffecdd --- /dev/null +++ b/vim/plugin/settings/Tlist.vim @@ -0,0 +1,19 @@ +" set up automatic ctags +let Tlist_Ctags_Cmd='/opt/local/bin/ctags' + +" taglist defaults +let Tlist_Auto_Highlight_Tag=0 +let Tlist_Auto_Open=0 +let Tlist_Compact_Format = 1 +let Tlist_Exist_OnlyWindow = 1 +let Tlist_WinWidth = 40 +let Tlist_GainFocus_On_ToggleOpen = 1 +let Tlist_Show_Menu = 1 +let Tlist_Use_Right_Window = 1 +let Tlist_Use_Horiz_Window = 0 +let Tlist_Close_On_Select = 1 +let Tlist_Show_One_File = 1 +let Tlist_Enable_Fold_Column = 0 +let Tlist_Display_Prototype = 0 +let Tlist_Use_SingleClick = 1 + diff --git a/vim/plugin/settings/autotag.vim b/vim/plugin/settings/autotag.vim new file mode 100644 index 0000000..342dff4 --- /dev/null +++ b/vim/plugin/settings/autotag.vim @@ -0,0 +1,3 @@ +" AutoTag +" Seems to have problems with some vim files +let g:autotagExcludeSuffixes="tml.xml.text.txt.vim" diff --git a/vim/plugin/settings/command-t.vim b/vim/plugin/settings/command-t.vim new file mode 100644 index 0000000..6af8560 --- /dev/null +++ b/vim/plugin/settings/command-t.vim @@ -0,0 +1,8 @@ +let g:CommandTMaxHeight = 5 +let g:CommandTMatchWindowReverse = 1 + +" Command-T +" Mapped to ,t +nmap ,t :CommandT +nmap ,T :CommandTBuffer + diff --git a/vim/plugin/settings/conqueterm.vim b/vim/plugin/settings/conqueterm.vim new file mode 100644 index 0000000..0d87be8 --- /dev/null +++ b/vim/plugin/settings/conqueterm.vim @@ -0,0 +1,11 @@ +" Run the current file in a ConqueTerm, great for ruby tests +let g:ConqueTerm_InsertOnEnter = 0 +let g:ConqueTerm_CWInsert = 1 +let g:ConqueTerm_Color = 2 + +" Open up a variety of commands in the ConqueTerm +nmap cc :execute 'ConqueTermSplit script/console --irb=pry' +nmap pp :execute 'ConqueTermSplit pry' +nmap bb :execute 'ConqueTermSplit /bin/bash --login' + +let g:ConqueTerm_SendVisKey = 'e' diff --git a/vim/plugin/settings/easymotion.vim b/vim/plugin/settings/easymotion.vim new file mode 100644 index 0000000..c7ca689 --- /dev/null +++ b/vim/plugin/settings/easymotion.vim @@ -0,0 +1,14 @@ +" This remaps easymotion to show us only the left +" hand home row keys as navigation options which +" may mean more typing to get to a particular spot +" but it'll all be isolated to one area of the keyboard +call EasyMotion#InitOptions({ +\ 'leader_key' : '' +\ , 'keys' : 'fjdkslewio' +\ , 'do_shade' : 1 +\ , 'do_mapping' : 1 +\ , 'grouping' : 1 +\ +\ , 'hl_group_target' : 'Question' +\ , 'hl_group_shade' : 'EasyMotionShade' +\ }) diff --git a/vim/plugin/settings/fugitive.git b/vim/plugin/settings/fugitive.git new file mode 100644 index 0000000..f794646 --- /dev/null +++ b/vim/plugin/settings/fugitive.git @@ -0,0 +1,4 @@ +" fugitive.git +" ======================================== +" For fugitive.git, dp means :diffput. Define dg to mean :diffget +nnoremap dg :diffget diff --git a/vim/plugin/settings/guioptions.vim b/vim/plugin/settings/guioptions.vim new file mode 100644 index 0000000..28a8617 --- /dev/null +++ b/vim/plugin/settings/guioptions.vim @@ -0,0 +1,6 @@ +" Disable the scrollbars (NERDTree) +set guioptions-=r +set guioptions-=L + +" Disable the macvim toolbar +set guioptions-=T diff --git a/vim/plugin/settings/lusty-juggler.vim b/vim/plugin/settings/lusty-juggler.vim new file mode 100644 index 0000000..273eb0b --- /dev/null +++ b/vim/plugin/settings/lusty-juggler.vim @@ -0,0 +1,10 @@ +" LustyJuggler +" ======================================== +" better triggers for buffer switching +" B to use the a/s/d/f juggler, S to search the buffers +nmap B \lj +nmap S \lb + +let g:LustyJugglerSuppressRubyWarning = 1 +let g:LustyJugglerAltTabMode = 1 +let g:LustyJugglerShowKeys = 'a' " show a/s/d/f keys diff --git a/vim/plugin/settings/neocomplcache.vim b/vim/plugin/settings/neocomplcache.vim new file mode 100644 index 0000000..885a70d --- /dev/null +++ b/vim/plugin/settings/neocomplcache.vim @@ -0,0 +1,9 @@ +" neocomplcache +" A beter autocomplete system! +let g:neocomplcache_enable_at_startup = 1 +let g:neocomplcache_enable_camel_case_completion = 1 +let g:neocomplcache_enable_underbar_completion = 1 +let g:neocomplcache_min_syntax_length = 5 + +" Choose completions using Apple-Space +inoremap pumvisible() ? "\" : "\" diff --git a/vim/plugin/settings/showmarks.vim b/vim/plugin/settings/showmarks.vim new file mode 100644 index 0000000..c844c53 --- /dev/null +++ b/vim/plugin/settings/showmarks.vim @@ -0,0 +1,2 @@ +" Tell showmarks to not include the various brace marks (),{}, etc +let g:showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY" diff --git a/vim/plugin/settings/skwp-keymap.vim b/vim/plugin/settings/skwp-keymap.vim new file mode 100644 index 0000000..4d58e93 --- /dev/null +++ b/vim/plugin/settings/skwp-keymap.vim @@ -0,0 +1,120 @@ +" ======================================== +" General vim sanity improvements +" ======================================== +" +" alias yw to yank the entire word even if the +" cursor is inside the word +nnoremap yw yaw + +" ======================================== +" RSI Prevention - keyboard remaps +" ======================================== +" Certain things we do every day as programmers stress +" out our hands. For example, typing underscores and +" dashes are very common, and in position that require +" a lot of hand movement. Vim to the rescue +" +" Now using the middle finger of either hand you can type +" underscores with apple-k or apple-d, and add Shift +" to type dashes +imap _ +imap _ +imap - +imap - + +" alias W to write the file instead of :w +nnoremap W :w + +" Don't have to use Shift to get into command mode, just hit semicolon +nnoremap ; : + +" move up/down quickly by using Ctrl-j, Ctrl-k +" which will move us around by functions +nnoremap } +nnoremap { + +" Open the project tree and expose current file in the nerdtree with Ctrl-\ +nnoremap :NERDTreeFind + +" Command-/ to toggle comments +map :TComment +imap :TCommenti + +"open up a git grep line, with a quote started for the search +nnoremap ,gg :GitGrep " +nnoremap ,gcp :GitGrepCurrentPartial + +" hit F to find the definition of the current class +" this uses ctags. the standard way to get this is Ctrl-] +nnoremap F + +"toggle between last two buffers with Z (normally ctrl-shift-6) +nnoremap Z + +"git grep the current word using K (mnemonic Kurrent) +nnoremap K :GitGrep + +" Move between split windows by using the four directions H, L, I, N +" (note that I use I and N instead of J and K because J already does +" line joins and K is mapped to GitGrep the current word +nnoremap H h +nnoremap L l +nnoremap I k +nnoremap M j + +" Create window splits easier. The default +" way is Ctrl-w,v and Ctrl-w,s. I remap +" this to vv and ss +nnoremap vv v +nnoremap ss s + +" Remap Q to close a window +nnoremap Q c + +" Use \Q to kill the buffer entirely +nnoremap Q :bw + +"open the taglist (method browser) using \t +nnoremap t :TlistToggle + +" create <%= foo %> erb tags using Ctrl-k in edit mode +imap <%= %>3hi + +" create <%= foo %> erb tags using Ctrl-j in edit mode +imap <% %>2hi + +" ============================ +" Shortcuts for everyday tasks +" ============================ + +" copy current filename into system clipboard - mnemonic: (c)urrent(f)ilename +" this is helpful to paste someone the path you're looking at +nnoremap cf :let @* = expand("%:p") + +"Clear current search highlight by double tapping // +nmap // :nohlsearch + +" (C)opy (c)ommand - which allows us to execute +" the line we're looking at (it does so by yy-copy, colon +" to get to the command mode, C-f to get to history editing +" p to paste it, C-c to return to command mode, and CR to execute +nmap Cc yy:p + +" Type ,hl to toggle highlighting on/off, and show current value. +noremap ,hl :set hlsearch! hlsearch? + +" Apple-* Highlight all occurrences of current word (like '*' but without moving) +" http://vim.wikia.com/wiki/Highlight_all_search_pattern_matches +nnoremap :let @/='\<=expand("")\>':set hls + +" After repeating a command, return the cursor to where it started +" http://vim.wikia.com/wiki/VimTip1142 +nmap . .`[ + +" These are very similar keys. Typing 'a will jump to the line in the current +" file marked with ma. However, `a will jump to the line and column marked +" with ma. It’s more useful in any case I can imagine, but it’s located way +" off in the corner of the keyboard. The best way to handle this is just to +" swap them: http://items.sjbach.com/319/configuring-vim-right +nnoremap ' ` +nnoremap ` ' diff --git a/vim/plugin/settings/solarized.vim b/vim/plugin/settings/solarized.vim new file mode 100644 index 0000000..c2d8676 --- /dev/null +++ b/vim/plugin/settings/solarized.vim @@ -0,0 +1,10 @@ +" Some color remaps +" If statements and def statements should look similar +" so you can see the flow +hi! link rubyDefine rubyControl + +" Colors to make LustyJuggler more usable +" the Question color in LustyJuggler is mapped to +" the currently selected buffer. +hi clear Question +hi! Question guifg=yellow diff --git a/vim/plugin/settings/statusline.vim b/vim/plugin/settings/statusline.vim new file mode 100644 index 0000000..75237f9 --- /dev/null +++ b/vim/plugin/settings/statusline.vim @@ -0,0 +1,29 @@ +"statusline setup +set statusline+=%#warningmsg# +set statusline+=%{SyntasticStatuslineFlag()} +set statusline+=%* +set statusline=%#warningmsg# +set statusline+=%f +set statusline+=%{fugitive#statusline()} +set statusline+=%m "modified flag + +"display a warning if &paste is set +set statusline+=%#error# +set statusline+=%{&paste?'[paste]':''} +set statusline+=%* +set statusline+=%= "left/right separator +set statusline+=%{StatuslineCurrentHighlight()}\ \ "current highlight +set statusline+=%c: "cursor column +set statusline+=%l/%L "cursor line/total lines +"set statusline+=\ %P "percent through file +set laststatus=2 + +"return the syntax highlight group under the cursor '' +function! StatuslineCurrentHighlight() + let name = synIDattr(synID(line('.'),col('.'),1),'name') + if name == '' + return '' + else + return '[' . name . ']' + endif +endfunction diff --git a/vim/plugin/settings/syntastic.vim b/vim/plugin/settings/syntastic.vim new file mode 100644 index 0000000..ace3af3 --- /dev/null +++ b/vim/plugin/settings/syntastic.vim @@ -0,0 +1,8 @@ +"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=1 +"show the error list automatically +let g:syntastic_auto_loc_list=1 +"don't care about warnings +let g:syntastic_quiet_warnings=1 diff --git a/vim/plugin/settings/tComment.vim b/vim/plugin/settings/tComment.vim new file mode 100644 index 0000000..ddfd078 --- /dev/null +++ b/vim/plugin/settings/tComment.vim @@ -0,0 +1,8 @@ +" tComment +" ======================================== +" extensions for tComment plugin. Normally +" tComment maps 'gcc' to comment current line +" this adds 'gcp' comment current paragraph (block) +" using tComment's built in p mapping +nmap gcp p + diff --git a/vim/plugin/settings/vim-ruby-conque.vim b/vim/plugin/settings/vim-ruby-conque.vim new file mode 100644 index 0000000..19715b2 --- /dev/null +++ b/vim/plugin/settings/vim-ruby-conque.vim @@ -0,0 +1,3 @@ +" Default to rspec 1. If you want +" rspec 2, set this to 'rspec' +let g:ruby_conque_rspec_command='spec' diff --git a/vimrc b/vimrc index 98ebede..9f0d5cc 100644 --- a/vimrc +++ b/vimrc @@ -49,42 +49,16 @@ set ai " autoindent set si " smart indent set smarttab -"statusline setup -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* -set statusline=%#warningmsg# -set statusline+=%f -set statusline+=%{fugitive#statusline()} -set statusline+=%m "modified flag - -"display a warning if &paste is set -set statusline+=%#error# -set statusline+=%{&paste?'[paste]':''} -set statusline+=%* -set statusline+=%= "left/right separator -set statusline+=%{StatuslineCurrentHighlight()}\ \ "current highlight -set statusline+=%c: "cursor column -set statusline+=%l/%L "cursor line/total lines -"set statusline+=\ %P "percent through file -set laststatus=2 - -"return the syntax highlight group under the cursor '' -function! StatuslineCurrentHighlight() - let name = synIDattr(synID(line('.'),col('.'),1),'name') - if name == '' - return '' - else - return '[' . name . ']' - endif -endfunction - "indent settings set shiftwidth=2 set softtabstop=2 set tabstop=2 set expandtab set autoindent +set list listchars=tab:\ \ ,trail:· + +" Prevent 'Press ENTER..' on error messages +set shortmess=atI "folding settings set foldmethod=indent "fold based on indent @@ -92,7 +66,7 @@ set foldnestmax=3 "deepest fold is 3 levels set nofoldenable "dont fold by default "make cmdline tab completion similar to bash -set wildmode=list:longest +set wildmode=list:longest set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing @@ -103,7 +77,7 @@ set listchars=tab:\ \ ,extends:>,precedes:< set formatoptions-=o "dont continue comments when pushing o/O "vertical/horizontal scroll off settings -set scrolloff=3 +set scrolloff=8 set sidescrolloff=7 set sidescroll=1 @@ -118,13 +92,18 @@ syntax on set mouse=a set ttymouse=xterm2 -"hide buffers when not displayed +" Don’t worry about the name. What this does is allow Vim to manage multiple buffers effectively. +" +" The current buffer can be put to the background without writing to disk; +" When a background buffer becomes current again, marks and undo-history are remembered. +" Turn this on. +" http://items.sjbach.com/319/configuring-vim-right set hidden " Make it beautiful - colors and fonts if has("gui_running") - "tell the term has 256 colors - set t_Co=256 + "tell the term has 256 colors + set t_Co=256 " http://ethanschoonover.com/solarized/vim-colors-solarized colorscheme solarized @@ -143,280 +122,12 @@ endif "make Y consistent with C and D nnoremap Y y$ -"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=1 -"show the error list automatically -let g:syntastic_auto_loc_list=1 -"don't care about warnings -let g:syntastic_quiet_warnings=1 - -"jump to last cursor position when opening a file -"dont do it when writing a commit log entry -autocmd BufReadPost * call SetCursorPosition() -function! SetCursorPosition() - if &filetype !~ 'commit\c' - if line("'\"") > 0 && line("'\"") <= line("$") - exe "normal! g`\"" - normal! zz - endif - end -endfunction - -" Open the project tree and expose current file in the nerdtree with Ctrl-\ -" the winfixwidth call ensures that nerdtree will not resize -" if we create or remove other windows -let g:NERDTreeWinSize = 30 -nnoremap :NERDTreeFind - -" move up/down quickly by using Ctrl-j, Ctrl-k -" which will move us around by functions -nnoremap } -nnoremap { - -" Move between split windows by using the four directions H, L, I, N -" (note that I use I and N instead of J and K because J already does -" line joins and K is mapped to GitGrep the current word -nnoremap H h -nnoremap L l -nnoremap I k -nnoremap M j - -" Create window splits easier. The default -" way is Ctrl-w,v and Ctrl-w,s. I remap -" this to vv and ss -nnoremap vv v -nnoremap ss s - -" Remap Q to close a window -nnoremap Q c - -" Use \Q to kill the buffer entirely -nnoremap Q :bw - -"open the taglist (method browser) using T -nnoremap T :TlistToggle - -" taglist defaults -let Tlist_Auto_Highlight_Tag=0 -let Tlist_Auto_Open=0 -let Tlist_Compact_Format = 1 -let Tlist_Exist_OnlyWindow = 1 -let Tlist_WinWidth = 40 -let Tlist_GainFocus_On_ToggleOpen = 1 -let Tlist_Show_Menu = 1 -let Tlist_Use_Right_Window = 1 -let Tlist_Use_Horiz_Window = 0 -let Tlist_Close_On_Select = 1 -let Tlist_Show_One_File = 1 -let Tlist_Enable_Fold_Column = 0 -let Tlist_Display_Prototype = 0 -let Tlist_Use_SingleClick = 1 - " automaticaly reload files changed outside of vim set autoread " save up to 100 marks and f1 means global marks (capital letters) are enabled set viminfo='100,f1 -" hit F to find the definition of the current class -" this uses ctags. the standard way to get this is Ctrl-] -nnoremap F - -"toggle between last two buffers with Z (normally ctrl-shift-6) -nnoremap Z - -"git grep the current word using K (mnemonic Kurrent) -nnoremap K :GitGrep - -"open up a git grep line, with a quote started for the search -nnoremap ,gg :GitGrep " -nnoremap ,gcp :GitGrepCurrentPartial - -" create <%= foo %> erb tags using Ctrl-k in edit mode -imap <%= %>3hi - -" create <%= foo %> erb tags using Ctrl-j in edit mode -imap <% %>2hi - -" set up automatic ctags -let Tlist_Ctags_Cmd='/opt/local/bin/ctags' - -" Run the current file in a ConqueTerm, great for ruby tests -let g:ConqueTerm_InsertOnEnter = 0 -let g:ConqueTerm_CWInsert = 1 -let g:ConqueTerm_Color = 2 - -" Open up a variety of commands in the ConqueTerm -nmap cc :execute 'ConqueTermSplit script/console --irb=pry' -nmap pp :execute 'ConqueTermSplit pry' -nmap bb :execute 'ConqueTermSplit /bin/bash --login' - -let g:ConqueTerm_SendVisKey = 'e' - " prevent auto insert mode, which is helpful when using conque " term for running tests autocmd WinEnter * stopinsert - -" Disable the scrollbars (NERDTree) -set guioptions-=r -set guioptions-=L - -" Disable the macvim toolbar -set guioptions-=T - - -" show this many lines around what i'm editing -set so=8 - -" aliases (C)opy (c)ommand - which allows us to execute -" the line we're looking at (it does so by yy-copy, colon -" to get to the command mode, C-f to get to history editing -" p to paste it, C-c to return to command mode, and CR to execute -nmap Cc yy:p - -" Remember cursor position and etc when you leave windows -" au BufWinLeave * silent! mkview "make vim save view (state) (folds, cursor, etc) -" au BufWinEnter * silent! loadview "make vim load view (state) (folds, cursorrsor, etc) - -" When editing a file, always jump to the last known cursor position. -" Don't do it when the position is invalid or when inside an event handler -" (happens when dropping a file on gvim). -autocmd BufReadPost * - \ if line("'\"") > 0 && line("'\"") <= line("$") | - \ exe "normal g`\"" | - \ endif - - -" Make nerdtree look nice -let NERDTreeMinimalUI = 1 -let NERDTreeDirArrows = 1 - -" Don't have to use Shift to get into command mode, just hit semicolon -nnoremap ; : - -"Clear current search highlight by double tapping // -nmap // :nohlsearch - - - - -" copy current filename into system clipboard - mnemonic: (c)urrent(f)ilename -" this is helpful to paste someone the path you're looking at -nnoremap cf :let @* = expand("%:p") - - -" General vim sanity improvements -" ======================================== -" alias yw to yank the entire word even if the -" cursor is inside the word -nnoremap yw yaw -" alias W to write the file instead of :w -nnoremap W :w - - -" RSI Prevention - keyboard remaps -" ======================================== -" in code, undescores and dashes are very commmon, but -" the key is really far away. remap the middle fingers -" with the command key to do what we want (type dashes) -imap _ -imap - - - -" fugitive.git -" ======================================== -" For fugitive.git, dp means :diffput. Define dg to mean :diffget -nnoremap dg :diffget - - -" tComment -" ======================================== -" extensions for tComment plugin. Normally -" tComment maps 'gcc' to comment current line -" this adds 'gcp' comment current paragraph (block) -" using tComment's built in p mapping -nmap gcp p - -" AutoTag -" Seems to have problems with some vim files -let g:autotagExcludeSuffixes="tml.xml.text.txt.vim" - -" LustyJuggler -" ======================================== -" better triggers for buffer switching -" B to use the juggler, S to search the buffers -nmap B \lj -nmap S \lb - -let g:LustyJugglerSuppressRubyWarning = 1 -let g:LustyJugglerAltTabMode = 1 -let g:LustyJugglerShowKeys = 'a' " show a/s/d/f keys -" Colors to make LustyJuggler more usable -" the Question color in LustyJuggler is mapped to -" the currently selected buffer. -hi clear Question -hi! Question guifg=yellow - - -" EasyMotion -" ======================================== -" Use EasyMotion by double tapping comma -nmap ,, \\w -" Use EasyMotion backwards by z,, -nmap z,, \\b -" Make EasyMotion more yellow, less red -hi clear EasyMotionTarget -hi! EasyMotionTarget guifg=yellow - -" This remaps easymotion to show us only the left -" hand home row keys as navigation options which -" may mean more typing to get to a particular spot -" but it'll all be isolated to one area of the keyboard -call EasyMotion#InitOptions({ -\ 'leader_key' : '' -\ , 'keys' : 'fjdkslewio' -\ , 'do_shade' : 1 -\ , 'do_mapping' : 1 -\ , 'grouping' : 1 -\ -\ , 'hl_group_target' : 'Question' -\ , 'hl_group_shade' : 'EasyMotionShade' -\ }) - -" vim-ruby-conque -" ======================================== -let g:ruby_conque_rspec_command='spec' - - -" ShowMarks -" ======================================== -" Tell showmarks to not include the various brace marks (),{}, etc -let g:showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXY" - -" Tell showmarks to stop using the '>' indicator for marks -let g:showmarks_textlower="\t>" -let g:showmarks_textupper="\t>" - -" neocomplcache -" A beter autocomplete system! -let g:neocomplcache_enable_at_startup = 1 -let g:neocomplcache_enable_camel_case_completion = 1 -let g:neocomplcache_enable_underbar_completion = 1 -let g:neocomplcache_min_syntax_length = 5 -inoremap pumvisible() ? "\" : "\" - - -" Command-T -" Mapped to ,t -let g:CommandTMaxHeight = 5 -let g:CommandTMatchWindowReverse = 1 -nmap ,t :CommandT -nmap ,T :CommandTBuffer - - -" Some color remaps -" If statements and def statements should look similar -" so you can see the flow -hi! link rubyDefine rubyControl