diff --git a/README.md b/README.md index d2ce1b62..46608be5 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ 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 @@ -168,7 +168,7 @@ Included vim plugins * ShowMarks - creates a visual gutter to the left of the number column showing you your marks (saved locations). use \mt to toggle it, \mm to place the next available mark, \mh to delete, \ma to clear all. Use standard vim mark navigation ('X) for mark named X. * EasyMotion - hit ,, (forward) or z,, (back) and watch the magic happen. just type the letters and jump directly to your target - in the provided vimrc the keys are optimized for home and upper row, no pinkies * LustyJuggler/Explorer - hit B, type buf name to match a buffer, or type S and use the home row keys to select a buffer - * TagList - hit T to see a list of methods in a class (uses ctags) + * TagList - hit ,T to see a list of methods in a class (uses ctags) * CommandT - although I personally use PeepOpen, this is available as it's pretty standard Git diff --git a/vim/plugin/settings/NERDtree-tabs.vim b/vim/plugin/settings/NERDtree-tabs.vim new file mode 100644 index 00000000..e0a02f72 --- /dev/null +++ b/vim/plugin/settings/NERDtree-tabs.vim @@ -0,0 +1,5 @@ +" Auto open nerd tree on startup +let g:nerdtree_tabs_open_on_gui_startup = 1 +" Focus in the main content window +let g:nerdtree_tabs_focus_on_files = 1 + diff --git a/vim/plugin/settings/NERDtree.vim b/vim/plugin/settings/NERDtree.vim index 31e9a075..394d2b94 100644 --- a/vim/plugin/settings/NERDtree.vim +++ b/vim/plugin/settings/NERDtree.vim @@ -2,4 +2,3 @@ let NERDTreeMinimalUI = 1 let NERDTreeDirArrows = 1 let g:NERDTreeWinSize = 30 - diff --git a/vim/plugin/settings/easymotion.vim b/vim/plugin/settings/easymotion.vim index c7ca6897..ddd8b6f8 100644 --- a/vim/plugin/settings/easymotion.vim +++ b/vim/plugin/settings/easymotion.vim @@ -12,3 +12,11 @@ call EasyMotion#InitOptions({ \ , 'hl_group_target' : 'Question' \ , 'hl_group_shade' : 'EasyMotionShade' \ }) + +" 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 diff --git a/vim/plugin/settings/lusty-juggler.vim b/vim/plugin/settings/lusty-juggler.vim index 273eb0bb..03c39216 100644 --- a/vim/plugin/settings/lusty-juggler.vim +++ b/vim/plugin/settings/lusty-juggler.vim @@ -2,8 +2,32 @@ " ======================================== " 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 +nmap ,b \lj +nmap ,s \lb + +" Remap using comma for the leader +" lusty file explorer +nmap ,lf \lf + +" lusty file explorer from current location +nmap ,lr \lr + +" lusty buffer juggler (alternative mapping) +nmap ,lb \lb + +" lusty buffer juggler (alternative mapping) +nmap ,lj \lj + +"idea from : http://www.charlietanksley.net/blog/blog/2011/10/18/vim-navigation-with-lustyexplorer-and-lustyjuggler/ +" open lusty file explorer from specific rails-friendly places +map ,lm :LustyFilesystemExplorer app/models +map ,lc :LustyFilesystemExplorer app/controllers +map ,lv :LustyFilesystemExplorer app/views +map ,lh :LustyFilesystemExplorer app/helpers +map ,ll :LustyFilesystemExplorer lib +map ,lp :LustyFilesystemExplorer public +map ,ls :LustyFilesystemExplorer specs +map ,lt :LustyFilesystemExplorer test let g:LustyJugglerSuppressRubyWarning = 1 let g:LustyJugglerAltTabMode = 1 diff --git a/vim/plugin/settings/neocomplcache.vim b/vim/plugin/settings/neocomplcache.vim index 885a70d0..9c7a1762 100644 --- a/vim/plugin/settings/neocomplcache.vim +++ b/vim/plugin/settings/neocomplcache.vim @@ -3,7 +3,16 @@ 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 +let g:neocomplcache_enable_smart_case = 1 + +" default # of completions is 100, that's crazy +let g:neocomplcache_max_list = 5 + +" words less than 3 letters long aren't worth completing +let g:neocomplcache_auto_completion_start_length = 3 + +" tab completion (from neocomplcache docs) +imap neocomplcache#sources#snippets_complete#expandable() ? "\(neocomplcache_snippets_expand)" : pumvisible() ? "\" : "\" " Choose completions using Apple-Space inoremap pumvisible() ? "\" : "\" diff --git a/vim/plugin/settings/skwp-keymap.vim b/vim/plugin/settings/skwp-keymap.vim index 4d58e93c..1d01d637 100644 --- a/vim/plugin/settings/skwp-keymap.vim +++ b/vim/plugin/settings/skwp-keymap.vim @@ -5,6 +5,8 @@ " alias yw to yank the entire word even if the " cursor is inside the word nnoremap yw yaw +"make Y consistent with C and D +nnoremap Y y$ " ======================================== " RSI Prevention - keyboard remaps @@ -44,12 +46,12 @@ imap :TCommenti nnoremap ,gg :GitGrep " nnoremap ,gcp :GitGrepCurrentPartial -" hit F to find the definition of the current class +" hit ,f to find the definition of the current class " this uses ctags. the standard way to get this is Ctrl-] -nnoremap F +nnoremap ,f "toggle between last two buffers with Z (normally ctrl-shift-6) -nnoremap Z +nnoremap ,z "git grep the current word using K (mnemonic Kurrent) nnoremap K :GitGrep @@ -74,8 +76,8 @@ nnoremap Q c " Use \Q to kill the buffer entirely nnoremap Q :bw -"open the taglist (method browser) using \t -nnoremap t :TlistToggle +"open the taglist (method browser) using ,t +nnoremap ,T :TlistToggle " create <%= foo %> erb tags using Ctrl-k in edit mode imap <%= %>3hi diff --git a/vim/plugin/settings/solarized.vim b/vim/plugin/settings/solarized.vim index c2d86762..91a44070 100644 --- a/vim/plugin/settings/solarized.vim +++ b/vim/plugin/settings/solarized.vim @@ -8,3 +8,5 @@ hi! link rubyDefine rubyControl " the currently selected buffer. hi clear Question hi! Question guifg=yellow + +hi! link TagListFileName Question diff --git a/vim/plugin/settings/unimpaired.vim b/vim/plugin/settings/unimpaired.vim new file mode 100644 index 00000000..f0cca4af --- /dev/null +++ b/vim/plugin/settings/unimpaired.vim @@ -0,0 +1,10 @@ +" https://github.com/carlhuda/janus/blob/master/vimrc + +" Unimpaired configuration +" Bubble single lines +nmap [e +nmap ]e + +" Bubble multiple lines +vmap [egv +vmap ]egv diff --git a/vimrc b/vimrc index 9f0d5ccd..311a1412 100644 --- a/vimrc +++ b/vimrc @@ -1,17 +1,13 @@ +"Use Vim settings, rather then Vi settings (much better!). +"This must be first, because it changes other options as a side effect. +set nocompatible + " Use tpope's pathogen plugin to manage all other plugins runtime bundle/tpope-vim-pathogen/autoload/pathogen.vim call pathogen#infect() call pathogen#helptags() -"Use Vim settings, rather then Vi settings (much better!). -"This must be first, because it changes other options as a side effect. -set nocompatible - -" Line numbers are good -set number - -" I don't like code folding -set nofoldenable +set number " Line numbers are good "allow backspacing over everything in insert mode set backspace=indent,eol,start @@ -92,8 +88,6 @@ syntax on set mouse=a set ttymouse=xterm2 -" 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. @@ -102,25 +96,23 @@ 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 - set background=dark + " http://ethanschoonover.com/solarized/vim-colors-solarized + colorscheme solarized + set background=dark - set guitablabel=%M%t - set lines=60 - set columns=190 + set guitablabel=%M%t + set lines=60 + set columns=190 - set guifont=Inconsolata:h20,Monaco:h17 + set guifont=Inconsolata:h20,Monaco:h17 else - "dont load csapprox if we no gui support - silences an annoying warning - let g:CSApprox_loaded = 1 + "dont load csapprox if we no gui support - silences an annoying warning + let g:CSApprox_loaded = 1 endif -"make Y consistent with C and D -nnoremap Y y$ " automaticaly reload files changed outside of vim set autoread