1

While writing the ruby code in vim , it doesn't auto-complete the code as shown here. I also don't see the code hinting. Why is that ?

Steps I performed for installation of RSense and Vim Plugin. All the operations are performed as root. I did exactly what has been given in the manual.

su
password : ************
$ cp -av rsense-0.3 ~/opt
$ cd /root/opt/
$ chmod +x bin/rsense
$ bin/rsense version
Rsense 0.3
$ ruby etc/config.rb > ~/.rsense
$ cat ~/.rsense
$ mkdir -p ~/.vim/plugin
$ cp etc/rsense.vim ~/.vim/plugin

Following are the two lines i added to my vimrc file :

let g:rsenseHome = "/root/opt/"
let g:rsenseUseOmniFunc = 1

Have i missed a thing ? What is that ? Is let g:rsenseHome = "/root/opt/" alright compared to let g:rsenseHome = "$RSENSE_HOME" given here in the manual.

I have used Rsense after reading the Documentation.

RSense 0.3 in the opt directory :

enter image description here

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
  • To activate the completion menu you are supposed to hit ``; is that what you do or do you expect some sort of "as-you-type" completion? Vim can't do that without third party plugins. What is the location of your "`vimrc`"? It's supposed to begin with a dot and be here: `~/.vimrc` (for you: `/root/.vimrc`, apparently). – romainl Jun 07 '12 at 12:16
  • @romainl i wanted as you type completion. vimrc is located in etc/vimrc – Suhail Gupta Jun 08 '12 at 03:56
  • 1
    You really need to step back and learn the basics of the command-line and UNIX first: for starter, you are not supposed to do any day to day activity as `root` or put anything in `/root`. Think of `root` as the administrative account of your machine or as the IT department of your company: they do upgrades, system-wide installs… but they are not the ones working with the machine from 9 to 5. That would be you, not `root`. When you installed your OS, you were certainly prompted for a user name and password. The `~` you will see in every tutorial is not `/root`, it's `/home/username`. – romainl Jun 08 '12 at 05:16
  • So, stop doing stuff as `root`, login as `username`, re-install RSense in `~/opt` (`/home/username/opt`) or `/opt` as per the manual, put the Vim plugin in `~/.vim/plugin` and write your Vim settings in `~/.vimrc`. Even then, you won't have autocompletion because **Vim doesn't do autocompletion**. You'll need another plugin for that which will led to another batch of mistakes and frustrations. If you find all of it complicated/hard to understand you should abandon this idea and get a dedicated Ruby IDE like RubyMine. Or look around for some beginner-level UNIX/CLI/Vim tutorials. Good luck. – romainl Jun 08 '12 at 05:29

1 Answers1

1

Definitely don't put things in as root, but moving beyond that, autocompletion is opened with the <C-x><C-u> key combination

To get "as you type" auto completion you will need another plugin like YouCompleteMe

Chris Pickard
  • 147
  • 1
  • 3