LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-24-2009, 08:20 AM   #1
david.ledger
LQ Newbie
 
Registered: Nov 2009
Location: Gloucester UK
Posts: 3

Rep: Reputation: 0
How can I get a 'real' vi editor - Ubuntu


Every time I have to work seriously on Linux I have to re-adjust my environment, which is ok, but some things really get in my way. vim is one of them.

I have never been able to smoothly read text that has embedded bold bits in it, let alone coloured words. My brain stops at each transition and it's as if I have to re-focus. I've had 'more' aliased to 'TERM=dumb more' for years. Vim is a harder nut to crack. I can remove the colours, but I still get bold text according to syntax. This must be set as the file to edit is opened, which is after any .exrcr or .vimrc is done, and I have to use ':set syntax=' to clear it every time I open an edit. The easy way would be install a real, simple, vi if I could. Are there any out there?

I learned vi in '83, and use a commercial 'straight' vi on an almost daily basis, so "get used to it" is not an acceptable answer.

David
 
Old 11-24-2009, 08:27 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
You should be able to 'set syntax=' and any other preferences in .vimrc in your home directory.
--- rod.
 
Old 11-24-2009, 08:58 AM   #3
david.ledger
LQ Newbie
 
Registered: Nov 2009
Location: Gloucester UK
Posts: 3

Original Poster
Rep: Reputation: 0
> You should be able to 'set syntax=' and any other preferences in .vimrc in your home directory.

Tried that and it didn't work. Of course, it doesn't know until it opens the file which syntax it is. I suspect that setting it to blank in .vimrc is just setting it to what it would be anyway at that stage. For 'vi x.pl y.php z.c' to work (and I assume it does) it must be capable of switching syntax on each file open.

David
 
Old 11-24-2009, 09:09 AM   #4
MBybee
Member
 
Registered: Jan 2009
Location: wherever I can make a living
Distribution: PC-BSD / FreeBSD / Debian / Ubuntu / Win7 / OpenVMS
Posts: 438

Rep: Reputation: 57
Quote:
Originally Posted by david.ledger View Post
> You should be able to 'set syntax=' and any other preferences in .vimrc in your home directory.

Tried that and it didn't work. Of course, it doesn't know until it opens the file which syntax it is. I suspect that setting it to blank in .vimrc is just setting it to what it would be anyway at that stage. For 'vi x.pl y.php z.c' to work (and I assume it does) it must be capable of switching syntax on each file open.

David
Just set this in the vimrc:
Code:
syntax off
It will be overridden by other settings, if you have them, so make it the very last line.

I just tested toggling it back in forth in my vimrc here with total success.
 
Old 11-24-2009, 09:10 AM   #5
Vrajgh
Member
 
Registered: Aug 2005
Posts: 65

Rep: Reputation: 31
I have always found that not having a ~/.vimrc makes it behave a lot more like traditional vi. (See the following section from the help. I get the impression that you can still customize it with ~/.exrc but I have never used that file.

Quote:
*compatible-default*
When Vim starts, the 'compatible' option is on. This will be used when Vim
starts its initializations. But as soon as a user vimrc file is found, or a
vimrc file in the current directory, or the "VIMINIT" environment variable is
set, it will be set to 'nocompatible'.
 
Old 11-24-2009, 09:14 AM   #6
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
Well with vim on my system I can remove the files in /usr/share/vim/vim72/syntax/ and then no syntax rules will apply to any files.
 
Old 11-24-2009, 09:20 AM   #7
pcunix
Member
 
Registered: Dec 2004
Location: MA
Distribution: Various
Posts: 149

Rep: Reputation: 23
I have no idea why "set syntax" doesn't work for some people - it didn't work for me either.

However, I found that the fix for me was to add

Code:
 
set t_Co=0 
# t_C0=2 turns off MOST colors, 0 kills all

to the top of /etc/vimrc.

I took that from http://aplawrence.com/Forum/TonyLawrence10.html
 
Old 11-24-2009, 09:20 AM   #8
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Hi.

If vim is run as 'vi', it goes into old-skool plain vi mode. Check 'aliases' to see if there's one set up and unalias it if necessary.

Dave
 
Old 11-24-2009, 11:40 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,287

Rep: Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034Reputation: 2034
vim is often aliased to vi. Just remove the alias and you'll get vi (if you type in 'vi' and not 'vim'). It's not vim-in-vi mode BTW.
You can do 'which vi' to find the real one.
 
Old 11-25-2009, 04:37 AM   #10
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Quote:
It's not vim-in-vi mode BTW
Well, it kind of is - vi is usually the vim-minimum version on Linux. But yeah, it's not the same binary.

Dave
 
Old 11-26-2009, 07:36 AM   #11
david.ledger
LQ Newbie
 
Registered: Nov 2009
Location: Gloucester UK
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks all for your input.

syntax off
in my .exrc did it. On the Ubuntu installation I'm working on 'vi' runs an 'vim' no matter how you start it. There doesn't seem to be a non-vim version of vi installed anywhere.

set t_Co=0
also fixed my colours in a much tidier way than I was using. I'm running it in an xterm from a Mac at home, but the non-colour xterm in OSX still does colours.

The Linux box is not my system, and there are several other users, so I can't do anything that would change what happens for anyone else. I'd rather fix things with changes to my environment anyway. That box is just a VM on something else. It'll probably go away shortly, to be replaced by a possibly different Linux.

Thanks again,
David
 
  


Reply

Tags
vi, vim


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mpeg editor on ubuntu barrythai Ubuntu 6 03-08-2007 06:17 PM
Real light, nice, and functional text editor? orange400 Linux - Software 6 05-11-2006 08:25 PM
real, real, real, basic computer for my Mom shengchieh General 3 12-18-2005 12:02 AM
Real Programmers Real People Real CS Students nakkaya General 5 07-04-2003 02:46 PM


All times are GMT -5. The time now is 04:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration