开发者

How to set my GVim to be feel like IDE?

Currently, I'm using GEdit as my text editor for editing Ruby and Javascript source codes. I would like to give GVim a try to be my editor choice. I have tried to follow https://github.com/akitaonrails/vimfiles and few others instructions, but I don't get any luck, when I source ~/.vimrc, then I always get:

bash: /home/samnang/.vimrc: line 5: syntax error near unexpected token (' 
bash: /home/samnang/.vimrc: line 5:call pathogen#runtime_append_all_bundles()'

Could you point me somewhere to get the instruction or configuration?

Environment: Ubuntu 10.10

Edi开发者_如何学Ct: If I don't source it, when I type vim or gvim, then I got:

Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault


You need to run source ~/.vimrc as an Ex mode command. That is, inside Vim itself, hit : and enter the command:

:source ~/.vimrc

Right now, you're running Bash's source command, which is entirely not what you want to do.


~/.vimrc is the configuration file for vim, and will automatically be read by vim when it launches in order to know how you want it set up. You can add your non-graphical vim commands, such as key mappings, abbreviations to ~/.vimrc/. In ~/.gvimrc you can add commands to set your colorscheme, the default number of columns and rows displayed at startup, etc.

If you aren't familiar with vim itself type vimtutor at the command-line and go through the tutorial.

To start gvim, type gvim at the command-line. To edit a file you can either open gvim, then use :e file/to/load in comman-mode, or do gvim file/to/load at the command-line. gvim supports multiple windows and tabs as does vim, so study those things to make the most use of them.


You can also try integrating Vim with eclipse if you want to bring IDE functionality to Vim (like projects, error highlighting, code completion, etc).

If you're interested check out the eclim project. It supports most of the modern languages, including Ruby, and I highly recommend it.


Try adding a .vim or vimfiles in your $HOME directory. If it still fails, add a file to the .vim directory. I did a

cd
mkdir .vim
cd .vim
touch .netrwhist
chmod g+w .netrwhist

I discovered this while learning about building your own syntax files at vim wikia creating your own syntax files

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜