Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
vi editor problemo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Devil
n00b
n00b


Joined: 20 Apr 2002
Posts: 4

PostPosted: Fri Apr 26, 2002 3:48 pm    Post subject: vi editor problemo Reply with quote

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
View user's profile Send private message
tod
Developer
Developer


Joined: 17 Apr 2002
Posts: 136
Location: Ozarks, USA

PostPosted: Fri Apr 26, 2002 3:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
gilgames
n00b
n00b


Joined: 18 Apr 2002
Posts: 12
Location: Edam - The Netherlands

PostPosted: Fri Apr 26, 2002 5:05 pm    Post subject: Re: vi editor problemo Reply with quote

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
View user's profile Send private message
Stalione
Guru
Guru


Joined: 21 Apr 2002
Posts: 335

PostPosted: Fri Apr 26, 2002 8:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
DarrenM
l33t
l33t


Joined: 25 Apr 2002
Posts: 653
Location: Sydney, Australia

PostPosted: Sat Apr 27, 2002 12:50 am    Post subject: Reply with quote

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
Code:
:syntax on
Or to make it the default for all users add the following line to /usr/share/vim/vimrc
Code:
set syntax


If you only want it for 1 user, copy the vimrc to ~/.vimrc and add the line there.
Back to top
View user's profile Send private message
chadh
Moderator
Moderator


Joined: 21 Apr 2002
Posts: 137
Location: Atlanta, GA

PostPosted: Sat Apr 27, 2002 6:43 pm    Post subject: Re: vi editor problemo Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum