Jump to common rails dirs with ,jm ,jc ,jv ,jh etc..using CommandT

LustyJuggler ,l[something] deprecated in favor of CommandT
because CommandT does fuzzy matching. Which means you can hit
,jm (jump to model) and fuzzy type a model name. Doing this
matches much more intelligently than a typical commandT call
because it's already constrained to what you want.
This commit is contained in:
yan 2011-12-23 14:13:59 -08:00
parent 476e72ba63
commit 0d51708808
3 changed files with 32 additions and 13 deletions

View File

@ -176,7 +176,6 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
* ,s - Show buffers in LustyJuggler (use asdfjkl home row keys to then select buffer) * ,s - Show buffers in LustyJuggler (use asdfjkl home row keys to then select buffer)
* ,lf - lusty file finder * ,lf - lusty file finder
* ,lr - lusty file finder from current folder * ,lr - lusty file finder from current folder
* ,lm ,lc ,ls - rails specific lusty juggler file finders (models, controllers, specs, etc) - just use the letter for what you want after ,l
**Rails** **Rails**
@ -201,6 +200,22 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
* // - clear the search * // - clear the search
* ,T - Tag list (list of methods in a class) * ,T - Tag list (list of methods in a class)
**File Navigation**
* ,t - Command-T fuzzy file selector
* ,jm jump (command-t) app/models
* ,jc app/controllers
* ,jv app/views
* ,jh app/helpers
* ,jl lib
* ,jp public
* ,js spec
* ,jf fast_spec
* ,jt test
* ,jd db
* ,jC config
* ,jV vendor
* ,jF factories
**RSI-reduction** **RSI-reduction**
* Cmd-k and Cmd-d to type underscores and dashes (use Shift), since they are so common in code but so far away from home row * Cmd-k and Cmd-d to type underscores and dashes (use Shift), since they are so common in code but so far away from home row
* ; instead of : - avoid Shift for common tasks, just hit semicolon to get to ex mode * ; instead of : - avoid Shift for common tasks, just hit semicolon to get to ex mode
@ -235,7 +250,6 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
* ,cc - (Current command) copies the command under your cursor and executes it in vim. Great for testing single line changes to vimrc. * ,cc - (Current command) copies the command under your cursor and executes it in vim. Great for testing single line changes to vimrc.
* ,yw - yank a word from anywhere within the word (so you don't have to go to the beginning of it) * ,yw - yank a word from anywhere within the word (so you don't have to go to the beginning of it)
* ,ow - overwrite a word with whatever is in your yank buffer - you can be anywhere on the word. saves having to visually select it * ,ow - overwrite a word with whatever is in your yank buffer - you can be anywhere on the word. saves having to visually select it
* ,t - Command-T fuzzy file selector
* sj - split a line such as a hash {:foo => {:bar => :baz}} into a multiline hash (j = down) * sj - split a line such as a hash {:foo => {:bar => :baz}} into a multiline hash (j = down)
* sk - unsplit a link (k = up) * sk - unsplit a link (k = up)
* Cmd-Shift-A - align things (type a character/expression to align by, works in visual mode or by itself) * Cmd-Shift-A - align things (type a character/expression to align by, works in visual mode or by itself)

View File

@ -6,3 +6,19 @@ let g:CommandTMatchWindowReverse = 1
nmap ,t :CommandT<CR> nmap ,t :CommandT<CR>
nmap ,T :CommandTBuffer<CR> nmap ,T :CommandTBuffer<CR>
" 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<CR>
map ,jc :CommandT app/controllers<CR>
map ,jv :CommandT app/views<CR>
map ,jh :CommandT app/helpers<CR>
map ,jl :CommandT lib<CR>
map ,jp :CommandT public<CR>
map ,js :CommandT spec<CR>
map ,jf :CommandT fast_spec<CR>
map ,jt :CommandT test<CR>
map ,jd :CommandT db<CR>
map ,jC :CommandT config<CR>
map ,jV :CommandT vendor<CR>
map ,jF :CommandT factories<CR>

View File

@ -18,17 +18,6 @@ nmap <silent> ,lb \lb
" lusty buffer juggler (alternative mapping) " lusty buffer juggler (alternative mapping)
nmap <silent> ,lj \lj nmap <silent> ,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<CR>
map ,lc :LustyFilesystemExplorer app/controllers<CR>
map ,lv :LustyFilesystemExplorer app/views<CR>
map ,lh :LustyFilesystemExplorer app/helpers<CR>
map ,ll :LustyFilesystemExplorer lib<CR>
map ,lp :LustyFilesystemExplorer public<CR>
map ,ls :LustyFilesystemExplorer specs<CR>
map ,lf :LustyFilesystemExplorer fast_spec<CR>
map ,lt :LustyFilesystemExplorer test<CR>
let g:LustyJugglerSuppressRubyWarning = 1 let g:LustyJugglerSuppressRubyWarning = 1
let g:LustyJugglerAltTabMode = 1 let g:LustyJugglerAltTabMode = 1