-3

I am trying to configure vim for ruby1.9.
I have no ~/.vimrc file for now. Should I create one? I have a ~/.viminfo on my Mac OSX. Which one does vim read?

Any help configuring vim?

2
  • What are you trying to configure? ~/.vimrc is like ~/.bashrc, a script that's loaded once on startup. It's not necessarily the best place to put language specific configuration, but it kinda depends on what you're trying to do.
    – Cubic
    Sep 11, 2012 at 10:49
  • sorry I wasnt clear enough. my vim has no syntax highlighting now for ruby 1.9
    – Trt Trt
    Sep 11, 2012 at 10:50

2 Answers 2

2

Firstly, vimrc and viminfo are different files for different usage. Generally, vimrc contents configurations for vim behaviours. And viminfo is to store cut buffers persistently, and other things. So if u would like to configure vim for ruby, I suggest put them in vimrc. But a better choice is to use vim plugins and modify them for your own convenience. And it has nothing to do with the OS platform.

2
2
  1. Find out if your version of Vim supports Ruby.

    :echo has('ruby')
    

    The command above should return 1 if Ruby support is built-in and 0 otherwise.

    If the answer is 1, you can proceed to step 3.

    If the answer is 2, you should install a more complete Vim. Go to step 2.

  2. Install a better Vim.

    You have a bunch of options: manually from the sources, via MacPorts, via Homebrew or the simplest, downloading MacVim.

    • MacPorts

      Once MacPorts is setup, issue this command in your shell:

      $ sudo port install vim +huge +ruby
      
    • Homebrew

      Once Homebrew is setup, issue this command in your shell:

      $ brew install vim
      
    • MacVim

      Download and install.

  3. Ruby support

    There's nothing to do.

You seem to have found what to do to add Rails support.

All the files and folders mentioned in tutorials must be created by you if they are not there: ~/.vimrc, ~/.vim/, ~/.vim/autoload, etc.

1
  • Just for my information. Why the downvote?
    – romainl
    Sep 11, 2012 at 12:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.