Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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.
> 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.
> 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.
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'.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.