I tried a ruby file, and on first go it complained:
'load_buffer_class': uninitialized constant MyClassNameHereI wonder how I can tell vim where my rails code lives?
Found this blog describing how to setup for c - the key for me was this comment:
–run ctags on your C libraries (from VIM :help ft-c-omni)
I checked out :help ft-ruby-omni and it's all there:
Vim can detect and load the Rails environment for files within a rails project. The feature is disabled by default, to enable it add
let g:rubycomplete_rails = 1
to your vimrc
So I needed to add that line to my .vimrc file....
However, here I am on windows, and unsure where the .vimrc lives. It's supposed to go in your home directory - which on windows is typically 'C:\documents and settings\*user_name*\'.
Turns out, you can use unix style shortcuts within vim and they work fine. This is useful because I can edit the home .vimrc file using the following from within vim:
:e ~/.vimrcThen, when i save the file (:w) it saves it in C:\documents and settings\*user_name*\.vimrc - problem solved!
BUT, then syntax and other defaults were turned off.... I had lost my 'default' settings.
What I needed was to source the defaults - which in my install was sitting in my VIM root, and named "_vimrc".
My final ~/.vimrc file looks like this:
source $VIM/_vimrc
let g:rubycomplete_rails = 1
And now all is good! Now I just need to spend some quality play-time...

1 comments:
Thanks a lot!
Post a Comment