1

I'm brand new to Vim so I'll be SUPER clear about what my question is. Right now I have an application and I'm in the root directory with vim(I'll post a screenshot for clarity). I want to navigate to the Users_controller.rb with a vim command, something like :e users_controller.rb but I don't know what the actual command is? I feel like the answer to this question should be easy but I can't find it anywhere.

Here is my current position in vim

enter image description here

As you can see on the left I have my full application but now I want to simply navigate to a particular file(like fuzzyfinder in atom)How can I do this?

Bitwise
  • 7,425
  • 20
  • 59
  • 145
  • 1
    The actual command is `:e app/constrollers/users_controller.rb` or with autocomplete `:e ap/con/use` – Philidor Apr 30 '16 at 23:12
  • hmm That's so weird then. When ever I type that command it starts a new directory? – Bitwise Apr 30 '16 at 23:16
  • http://stackoverflow.com/questions/16082991/vim-switching-between-files-rapidly-using-vanilla-vim-no-plugins/16084326#16084326 – romainl May 01 '16 at 09:50

1 Answers1

1

This you can do without any plugin, plain vanilla vim using :find and extending path.

:set path+=** "Extends path to look into all sub-folders, :help path

Now use :find users_controller.rb or even :find users_*.rb to locate and open the file. Details at :help :find

Base on the number of sub folders in your project, find may take sometime to search the file.


But you will be lot happier with ctrl-p plugin, though there are many ways to accomplish that. Just type ctrl + p and name of file. You need to install the plugins from https://github.com/kien/ctrlp.vim

dlmeetei
  • 8,817
  • 3
  • 29
  • 37