View previous topic :: View next topic |
Author |
Message |
Devil n00b
Joined: 20 Apr 2002 Posts: 4
|
Posted: Fri Apr 26, 2002 3:48 pm Post subject: vi editor problemo |
|
|
Hi.
1.
Why can I only emerge vim and not vi?
2.
How do I get vim to do syntax highlighing?
Make it automaticly insert tabs when I start a new code block?
I know it can be done cuz I it works in mandrake automaticly. (with vi)! |
|
Back to top |
|
|
tod Developer
Joined: 17 Apr 2002 Posts: 136 Location: Ozarks, USA
|
Posted: Fri Apr 26, 2002 3:56 pm Post subject: |
|
|
Hi!
You can have vim run in vi compatibilty mode if you chose
Basically you need to check out
/usr/share/vim/
and look for the example vimrc files.
copy this to your home directory as .vimrc, then edit to your preference (vi compatible, syntax highlighting, etc)
hth
tod |
|
Back to top |
|
|
gilgames n00b
Joined: 18 Apr 2002 Posts: 12 Location: Edam - The Netherlands
|
Posted: Fri Apr 26, 2002 5:05 pm Post subject: Re: vi editor problemo |
|
|
Devil wrote: | Hi.
1.
Why can I only emerge vim and not vi?
|
try: Code: | emerge app-editors/nvi | this gives you a more basic vi than vim is.
Devil wrote: |
2.
How do I get vim to do syntax highlighing?
Make it automaticly insert tabs when I start a new code block?
|
Should be in the the example config files(propably system_gvimrc). It's just a guess coz I'm not at one of my *nix boxen right now. |
|
Back to top |
|
|
Stalione Guru
Joined: 21 Apr 2002 Posts: 335
|
Posted: Fri Apr 26, 2002 8:27 pm Post subject: |
|
|
or simly make a link to vim as vi and alias it to start in vi compatibility mode =)
Quote: |
Arguments:
-- Only file names after this
-v Vi mode (like "vi")
|
so do the following:
ln -s /path/to/vim /usr/bin/vi
alias vi="vi -v"
so from now on whenever you do vi, it will start vim in vi compatibility mode.
|
|
Back to top |
|
|
DarrenM l33t
Joined: 25 Apr 2002 Posts: 653 Location: Sydney, Australia
|
Posted: Sat Apr 27, 2002 12:50 am Post subject: |
|
|
No need for the link just do the alias vi='vim -v' You will want to put it in the env.d or .bash_profile to have it setup everytime you login.
To get syntax highlighting on you can either use the following command while running vim Or to make it the default for all users add the following line to /usr/share/vim/vimrc
If you only want it for 1 user, copy the vimrc to ~/.vimrc and add the line there. |
|
Back to top |
|
|
chadh Moderator
Joined: 21 Apr 2002 Posts: 137 Location: Atlanta, GA
|
Posted: Sat Apr 27, 2002 6:43 pm Post subject: Re: vi editor problemo |
|
|
Devil wrote: | Hi.
1.
Why can I only emerge vim and not vi?
|
covered
Devil wrote: | 2.
How do I get vim to do syntax highlighing?
Make it automaticly insert tabs when I start a new code block?
I know it can be done cuz I it works in mandrake automaticly. (with vi)! |
Check out http://www.vim.org and http://vim.sf.net . If you aren't familiar with setting vim preferences, check out sven's vimrc to get a taste (be prepared for it to take a few hours).
In particular, you should edit your ~/.vimrc and add
Code: |
syn on
set smartindent
|
A lot of these settings happen automatically when you open a file with the proper extension. A corollary to this is that if you are editing a new file (which obviously has no extension), you need to make sure to save it once in order to turn on the language-specific features. _________________ Chad |
|
Back to top |
|
|
|