tpope / vim-rvm

rvm.vim: Switch Ruby versions from inside Vim
http://www.vim.org/scripts/script.php?script_id=4269
117 stars 5 forks source link

`Rvm use` does not work in .vimrc #9

Closed TheJefe closed 9 years ago

TheJefe commented 9 years ago

I'd like Rvm use default be run on vim startup, so I added that line to the end of my .vimrc, but when I startup vim, I get the following error.

Not an editor command: Rvm use default

However, I can run that command in vim command-line mode (ie :Rvm use default) and it works just fine.

Is there a way this can be used in .vimrc ? I feel like I must be missing something obvious, so sorry if this is a stupid question.

I should also mention that I use Vundle, if that makes any difference.

tpope commented 9 years ago

You could use a VimEnter autocommand.

TheJefe commented 9 years ago

Thanks! I knew there had to be a simple way around this.

For anyone that finds themselves with this same issue, the solution was to add this line to my .vimrc autocmd VimEnter * Rvm use default