diff --git a/README.md b/README.md index 10adba23..06036174 100644 --- a/README.md +++ b/README.md @@ -309,7 +309,8 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke * `,f` - instantly Find definition of class (must have exuberant ctags installed) * `,F` - same as ,f but in a vertical split - * `,gf` - same as vim normal gf (go to file), but in a vertical split + * `,gf` or `Ctrl-f` - same as vim normal gf (go to file), but in a vertical split (works with file.rb:123 line numbers also) + * `gF` - standard vim mapping, here for completeness (go to file at line number) * `K` - GitGrep the current word under the cursor and show results in quickfix window * `,K` - GitGrep the current word up to next exclamation point (useful for ruby foo! methods) * `Cmd-*` - highlight all occurrences of current word (similar to regular `*` except doesn't move) diff --git a/vim/plugin/settings/gotofile.vim b/vim/plugin/settings/gotofile.vim new file mode 100644 index 00000000..9c0360ba --- /dev/null +++ b/vim/plugin/settings/gotofile.vim @@ -0,0 +1,7 @@ +" Automatically jump to a file at the correct line number +" i.e. if your cursor is over /some/path.rb:50 then using 'gf' on it will take +" you to that line + +" use ,gf to go to file in a vertical split +nnoremap ,gf :vertical botright wincmd F +nnoremap :vertical botright wincmd F diff --git a/vim/plugin/settings/yadr-keymap.vim b/vim/plugin/settings/yadr-keymap.vim index 540abe75..5a1002fb 100644 --- a/vim/plugin/settings/yadr-keymap.vim +++ b/vim/plugin/settings/yadr-keymap.vim @@ -133,9 +133,6 @@ nnoremap ,f " use ,F to jump to tag in a vertical split nnoremap ,F :let word=expand(""):vsp:wincmd w:exec("tag ". word) -" use ,gf to go to file in a vertical split -nnoremap ,gf :vertical botright wincmd f - "Move back and forth through previous and next buffers "with ,z and ,x