From 68442f5a30e6b1b6fa3cdbd3b581df0142416100 Mon Sep 17 00:00:00 2001 From: yan Date: Tue, 24 Jan 2012 10:19:23 -0800 Subject: [PATCH 1/2] Remove CommandT and rebind ,t to CtrlP plugin --- .gitmodules | 3 --- README.md | 8 ++++---- vim/bundle/skwp-Command-T | 1 - vim/plugin/settings/command-t.vim | 24 ------------------------ vim/plugin/settings/ctrlp.vim | 26 ++++++++++++++++++++++++++ vim/plugin/settings/solarized.vim | 6 ++++-- vimrc | 5 +++-- 7 files changed, 37 insertions(+), 36 deletions(-) delete mode 160000 vim/bundle/skwp-Command-T delete mode 100644 vim/plugin/settings/command-t.vim diff --git a/.gitmodules b/.gitmodules index 553ea71..0ef4353 100644 --- a/.gitmodules +++ b/.gitmodules @@ -193,9 +193,6 @@ [submodule "vim/bundle/claco-jasmine"] path = vim/bundle/claco-jasmine url = https://github.com/claco/jasmine.vim -[submodule "vim/bundle/skwp-Command-T"] - path = vim/bundle/skwp-Command-T - url = https://github.com/skwp/Command-T [submodule "vim/bundle/kana-vim-textobj-function"] path = vim/bundle/kana-vim-textobj-function url = https://github.com/kana/vim-textobj-function diff --git a/README.md b/README.md index 5262103..105b1b5 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,6 @@ If you pull new changes, be sure to run this to init all the submodules: yadr init-plugins After you install yadr shell aliases, you can use the *yip* alias to do the same. -Please note that init-plugins will automatically compile the CommandT plugin for you. Setup for ZSH --- @@ -203,8 +202,9 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke **File Navigation** - * ,t - Command-T fuzzy file selector - * ,b - Command-T buffer selector + * ,t - CtrlP fuzzy file selector + * ,b - CtrlP buffer selector + * Cmd-Shift-P - Clear CtrlP cache * ,jm jump (command-t) app/models * ,jc app/controllers * ,jv app/views @@ -277,7 +277,7 @@ Included vim plugins * EasyMotion - hit ,,w (forward) or ,,b (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) - * CommandT - ,t to find a file + * CtrlP - Ctrl-p or ,t to find a file * VimBookmarks - toggle an anonymous bookmark ,bb and go thru them ,bn ,bp and clear them ,bc * TabMan - hit ,mt to see all tabs and buffers in a tree. Easy to navigate and close. diff --git a/vim/bundle/skwp-Command-T b/vim/bundle/skwp-Command-T deleted file mode 160000 index f4bbb87..0000000 --- a/vim/bundle/skwp-Command-T +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f4bbb87444a629404e141ba6a22b6800859550bd diff --git a/vim/plugin/settings/command-t.vim b/vim/plugin/settings/command-t.vim deleted file mode 100644 index 19c2327..0000000 --- a/vim/plugin/settings/command-t.vim +++ /dev/null @@ -1,24 +0,0 @@ -let g:CommandTMaxHeight = 5 -let g:CommandTMatchWindowReverse = 1 - -" Command-T -" Mapped to ,t -nmap ,t :CommandT -nmap ,T :CommandTBuffer - -" Idea from : http://www.charlietanksley.net/blog/blog/2011/10/18/vim-navigation-with-lustyexplorer-and-lustyjuggler/ -" Open CommandT starting from a particular path, making it much -" more likely to find the correct thing first. mnemonic 'jump to [something]' -map ,jm :CommandT app/models -map ,jc :CommandT app/controllers -map ,jv :CommandT app/views -map ,jh :CommandT app/helpers -map ,jl :CommandT lib -map ,jp :CommandT public -map ,js :CommandT spec -map ,jf :CommandT fast_spec -map ,jt :CommandT test -map ,jd :CommandT db -map ,jC :CommandT config -map ,jV :CommandT vendor -map ,jF :CommandT factories diff --git a/vim/plugin/settings/ctrlp.vim b/vim/plugin/settings/ctrlp.vim index 56b51ec..de0fef6 100644 --- a/vim/plugin/settings/ctrlp.vim +++ b/vim/plugin/settings/ctrlp.vim @@ -2,4 +2,30 @@ " controller let g:ctrlp_by_filename = 1 +" 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' +" Additional mapping for buffer search +nnoremap ,b :CtrlPBuffer +nnoremap :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 ,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 ,jt :CtrlP test +map ,jd :CtrlP db +map ,jC :CtrlP config +map ,jV :CtrlP vendor +map ,jF :CtrlP factories diff --git a/vim/plugin/settings/solarized.vim b/vim/plugin/settings/solarized.vim index 0e26bdd..49b69c1 100644 --- a/vim/plugin/settings/solarized.vim +++ b/vim/plugin/settings/solarized.vim @@ -6,8 +6,7 @@ hi! link rubyDefine rubyControl " This is a better cursor hi! link Cursor VisualNOS -" This is a bit nicer visual selection, and -" as a side bonus it makes CommandT look better +" This is a bit nicer visual selection hi! link Visual DiffChange " Search is way too distracting in original Solarized @@ -35,3 +34,6 @@ hi! link rubySymbol rubyBlockParameter hi! link Delimiter Identifier hi! link rDollar Identifier +" For vimscript, don' tlike red.. +hi link vimMapModKey Operator +hi link vimNotation Label diff --git a/vimrc b/vimrc index 9180541..60d2711 100644 --- a/vimrc +++ b/vimrc @@ -22,7 +22,7 @@ set gcr=a:blinkon0 "Disable cursor blink set autoread "Reload files changed outside vim " This makes vim act like all other editors, buffers can -" exist in the background without being in a window. +" exist in the background without being in a window. " http://items.sjbach.com/319/configuring-vim-right set hidden @@ -80,7 +80,8 @@ set nofoldenable "dont fold by default 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 -set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " for Linux/MacOSX +set wildignore+=*/.git/*,*/.hg/*,*/.svn/* +set wildignore+=*vim/backups* " From 796e4444ef9d5cc10a4a0a2cb47bb0c27c0749a3 Mon Sep 17 00:00:00 2001 From: yan Date: Tue, 24 Jan 2012 10:38:33 -0800 Subject: [PATCH 2/2] Replace taglist with tagbar --- .gitmodules | 3 +++ README.md | 2 +- vim/bundle/majutsushi-tagbar | 1 + vim/plugin/settings/skwp-keymap.vim | 3 --- vim/plugin/settings/tagbar.vim | 3 +++ 5 files changed, 8 insertions(+), 4 deletions(-) create mode 160000 vim/bundle/majutsushi-tagbar create mode 100644 vim/plugin/settings/tagbar.vim diff --git a/.gitmodules b/.gitmodules index 0ef4353..0e6d2d8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -208,3 +208,6 @@ [submodule "vim/bundle/kien-ctrlp"] path = vim/bundle/kien-ctrlp url = https://github.com/kien/ctrlp.vim +[submodule "vim/bundle/majutsushi-tagbar"] + path = vim/bundle/majutsushi-tagbar + url = https://github.com/majutsushi/tagbar.git diff --git a/README.md b/README.md index 105b1b5..478d759 100644 --- a/README.md +++ b/README.md @@ -276,7 +276,7 @@ Included vim plugins * ShowMarks - creates a visual gutter to the left of the number column showing you your marks * EasyMotion - hit ,,w (forward) or ,,b (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) + * TagBar - hit ,T to see a list of methods in a class (uses ctags) * CtrlP - Ctrl-p or ,t to find a file * VimBookmarks - toggle an anonymous bookmark ,bb and go thru them ,bn ,bp and clear them ,bc * TabMan - hit ,mt to see all tabs and buffers in a tree. Easy to navigate and close. diff --git a/vim/bundle/majutsushi-tagbar b/vim/bundle/majutsushi-tagbar new file mode 160000 index 0000000..52fe2b7 --- /dev/null +++ b/vim/bundle/majutsushi-tagbar @@ -0,0 +1 @@ +Subproject commit 52fe2b7c3a6c74f1fc8cb311e0bcc6fe8c09fddb diff --git a/vim/plugin/settings/skwp-keymap.vim b/vim/plugin/settings/skwp-keymap.vim index fe1357f..8e90bac 100644 --- a/vim/plugin/settings/skwp-keymap.vim +++ b/vim/plugin/settings/skwp-keymap.vim @@ -134,9 +134,6 @@ nnoremap vv v nnoremap ss s -"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/tagbar.vim b/vim/plugin/settings/tagbar.vim new file mode 100644 index 0000000..dbde1d6 --- /dev/null +++ b/vim/plugin/settings/tagbar.vim @@ -0,0 +1,3 @@ +"open the taglist (method browser) using ,t +nnoremap ,T :TagbarToggle +