tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.11k stars 384 forks source link

gf and :wincmd f produce different results #473

Closed GabeIsman closed 6 years ago

GabeIsman commented 7 years ago

Thanks for this awesome tool!

I noticed an oddity just now: in my setup gf correctly opens all sorts of files, for example gf with the cursor on Tag opens the right model.

However :wincmd f produces E447: Can't find file "tag.find.rb" in path.

Having this work correctly would be handy for bindings like nnoremap gv :vertical wincmd f<cr>.

GabeIsman commented 7 years ago

I was able to work around this with nnoremap gv :vsp <c-r>=findfile(rails#cfile())<cr><cr>

tpope commented 6 years ago

:wincmd is a built-in and can't be extended. You can use <C-W>f.