LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2011, 01:24 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Rep: Reputation: 51
Vim: disabling coloring.


Kernel 2.6.21.5, Slackware 12.0
Vim 7.1

Hi:
To disable color I've always used the 'syntax off' command. Before posting this, I decided to have a look at the help. I found

syntax
syntax highlighting
coloring

There is a great deal about colors but I cannot find anything about taking colours away. Do any of you know how to do this? I no longer want to use the 'syntax off' command in my ~/.vimrc.
 
Old 08-21-2011, 05:57 PM   #2
EmaRsk
Member
 
Registered: Mar 2006
Distribution: Funtoo
Posts: 124

Rep: Reputation: 25
What's wrong with "syntax off"?
 
Old 08-21-2011, 07:06 PM   #3
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Hello stf92,

you can simply put a line
Code:
syntax off
at the end of your ~/.vimrc file

Markus
 
Old 08-21-2011, 09:21 PM   #4
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Original Poster
Rep: Reputation: 51
Thanks for your reply.
Quote:
Originally Posted by EmaRsk View Post
What's wrong with "syntax off"?
The following: without "syntax off" vim is supposed to do the same work as a compiler. It looks for left braces and tries to match them to right ones. Each time it finds a matching right brace, the entire character block where the brace lies is colored, making it difficult for me, due to my monitor color rendering or other cause, to read the line. It's a matter of legibility.

Well, this automatic brace/parenthesis/bracket matching mechanism does not go off with 'syntax off'. I have tried a thousand commands and never was able to get rid of this. But please remember. It's not a matter of braces matching. I do not want color at all.

You can do ':help color' terminating with ctrl-D instead of <Enter> and will be presented with up to nine items about color.
 
Old 08-22-2011, 07:02 AM   #5
EmaRsk
Member
 
Registered: Mar 2006
Distribution: Funtoo
Posts: 124

Rep: Reputation: 25
On my pc, it highlights only the bracket the cursor is on and its sibling, not the whole block. Maybe you have some option activated in your vimrc.
You can disable bracket matching with "set noshowmatch". I know it's not the ultimate solution you were asking for, but maybe it could do, combined with "syntax off".
I honestly think that a better solution would be finding a good combo of vim color theme (try the command "colorscheme") and terminal color profile.
 
1 members found this post helpful.
Old 08-22-2011, 12:04 PM   #6
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Original Poster
Rep: Reputation: 51
"set noshowmatch" has no perceptible effect. I think it causes a brief jump to the left matching parenthesis, and nothing else. I'll try your other suggestions. Thanks a lot.
 
Old 08-22-2011, 07:40 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
How about posting your .vimrc ?
 
Old 08-22-2011, 08:12 PM   #8
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Original Poster
Rep: Reputation: 51
Here is my ~/.vimrc:
Code:
 
semoi@darkstar:~$ cat .vimrc
set autoindent
syntax off
set ic
set expandtab
set tabstop=4
set shiftwidth=4
semoi@darkstar:~$
Thanks.
 
Old 08-23-2011, 01:51 AM   #9
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Why don't you use the sample vimrc from your distribution, normally located in /usr/share/vim/vim7?/vimrc_example.vim ?

I use to copy this file into my home-directory (to .vimrc) and adapt it to my needs. Most of the problems you describe here I've never had.

Markus
 
Old 08-23-2011, 10:32 PM   #10
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Original Poster
Rep: Reputation: 51
Your tip is welcome. Thanks.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
file coloring Ribo01 Linux - Newbie 2 11-27-2010 05:44 PM
LXer: Customizing vim and coloring the terminal in OpenSolaris 2009.06 LXer Syndicated Linux News 0 07-12-2009 12:10 PM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 05:26 PM
Disabling Auto-Formatting in vim? Sir Meowdengalf Linux - Software 1 10-24-2008 03:16 PM
turning off syntax coloring in vim, permanently davalos Linux - Newbie 5 08-18-2003 10:04 PM


All times are GMT -5. The time now is 02:38 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration