LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-12-2016, 05:52 AM   #1
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311
Blog Entries: 2

Rep: Reputation: 16
Question VIM: Can't see Certain keywords


Search Terms:
UTG: Unidentified Text Group
IDE, group, keywords, colorscheme, visibility
________________________________________________________________________

I am on Lubuntu 14.04 using VIM - Vi IMproved 7.4 through xterm.

I would like to see certain text in both "morning" and "shiny" color themes. Both of these themes have a bright near white background, and there are certain keywords, in bright yellow, which is extremely hard to see with a white background.

Examples:
Quote:
if elif, else, fi, for, do, done, echo, etc...
I wonder if this is the "NonText" group?

I search for "yellow" in both the /etc/vim/vimrc and /usr/share/vim/vim74/colors/am.vim, but simply nothing is set to "yellow".

The following attempts are solutions I found online.

_____________________________________________
Attempt 01:
I tried the first 4 examples work:
Code:
highlight Comment ctermbg=DarkGray
highlight Constant ctermbg=Blue
highlight Normal ctermbg=Black
highlight Special ctermbg=DarkMagenta
highlight NonText ctermbg=Black
Unfortunately, the last command (NonText) has no effect:

I try other foreground colors, but nothing works.

_____________________________________________
Attempt 02: '

Previously I had some problems with my cursor background/foreground color being the same as the general background color (as in "morning" and "shiny" colorschemes) and thanks to Astrogeek, I was able to fix it with a termcap conditional clause. I found a codename for NonText on sourceforge. Thus I tried altering that same clause to fit that of NonText in my colorscheme (am.vim) file:
Code:
if &term =~ "xterm\\|rxvt"
" use an red cursor in insert mode
let &hl-NonText = "\<Esc>]12;red\x7"
silent !echo -ne "\033]12;red\007"
" reset cursor when vim exits
autocmd VimLeave * silent !echo -ne "\033]112\007"
" use \003]12;gray\007 for gnome-terminal			
endif
This merely produces a few error codes, and all the same words are still in yellow.

This is not a very high priority, since my workaround is to use GVim (no problems adjusting this by attempt 01 above!!) and not xterm.

I also tried an older post LQ which provides a working Vim config with a "nontext" color definition, but nothing worked for me either.

Does anyone know how to change the aforesaid word color to foreground = black? Have I guessed correctly in saying that these words are of the group named "NonText"?
 
Old 11-12-2016, 03:57 PM   #2
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Have I guessed correctly in saying that these words are of the group named "NonText"?
Try changing the "Statement" group color to black. From the link that astrogeek provided in your previous thread: http://vimdoc.sourceforge.net/htmldo...tml#group-name
 
1 members found this post helpful.
Old 11-12-2016, 10:49 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by andrew.comly View Post
I would like to see certain text in both "morning" and "shiny" color themes. Both of these themes have a bright near white background, and there are certain keywords, in bright yellow, which is extremely hard to see with a white background.

Examples:

Code:
if elif, else, fi, for, do, done, echo, etc...
I wonder if this is the "NonText" group?

...

Does anyone know how to change the aforesaid word color to foreground = black? Have I guessed correctly in saying that these words are of the group named "NonText"?
No those are not in the NonText group. From the docs:

Code:
NonText   '~' and '@' at the end of the window, characters from
		'showbreak' and other characters that do not really exist in
		the text (e.g., ">" displayed when a double-wide character
		doesn't fit at the end of the line).
Looking for a NonText solution has trapped us in an XY problem since your thread about Vim cursor colors!

For completeness, the above NonText examples are almost certainly working for the NonText characters described above, but those are not what you are looking at for evidence of change.

For if elif, else, fi, for, do, done, echo, etc., you want the Conditional sub-group of the Statement group, as indicated by norobro. So, something like this would affect those keywords, choose your colors as required:

Code:
highlight Conditional ctermbg=Black
highlight Conditional ctermfg=White
In looking further into this I have gotten a needed refresher on Vim syntax hilighting myself, so here are some additional notes that should be helpful in answering these and other questions...

The docs: The previously linked Vimdocs on Sourceforge are always handy, but you probably have the same docs for your Vim package available on your system. Look under /usr/share/vim/vim74/docs/ or wherever your distro places shared docs, and learn your way around them.

The basics of syntax hilighting: The complete reference on Vim syntax hilighting from those docs, simply start at the top and read down - it is complete! In particular, follow the link to the Syntax page for a very good overview of how the syntax hilighting files are found and loaded.

It all works as advertised, when we identify and ask the right question!

Hope this helps!

Last edited by astrogeek; 11-12-2016 at 11:16 PM. Reason: typos, grammar
 
1 members found this post helpful.
Old 11-17-2016, 03:21 AM   #4
andrew.comly
Member
 
Registered: Dec 2012
Distribution: Trisquel-Mini 7.0, Lubuntu 14.04, Debian lxde 8.0
Posts: 311

Original Poster
Blog Entries: 2

Rep: Reputation: 16
Lightbulb Solved

Quote:
Originally Posted by astrogeek View Post
No those are not in the NonText group. From the docs:

Code:
NonText   '~' and '@' at the end of the window, characters from
		'showbreak' and other characters that do not really exist in
		the text (e.g., ">" displayed when a double-wide character
		doesn't fit at the end of the line).
...
The basics of syntax hilighting: The complete reference on Vim syntax hilighting from those docs, simply start at the top and read down - it is complete! In particular, follow the link to the Syntax page for a very good overview of how the syntax hilighting files are found and loaded.
...

Astrogeek & norobro,

I found just what I needed on your and norobro's Syntax Page, more specifically:
Code:
	Statement	  any statement
	Conditional	if, then, else, endif, switch, etc.
	Repeat			for, do, while, etc.
However, their description for "Statement" is a bit vague. This helped me with words (LaTeX) like
Code:
Preamble:
	\usepackage
Functions:
	\arcsin, \qquad, \int, \frac, \sqrt, ^
Formatting:
	\begin{align}, \end{align}
Thanks Again Astrogeek and norobro!

Hope this helps anyone who has this problem in the future.
 
1 members found this post helpful.
  


Reply

Tags
color, group, vim, visibility, xterm



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
LXer: Useful Vim editor plugins for software developers - part 3: a.vim LXer Syndicated Linux News 0 10-20-2016 10:54 AM
[SOLVED] Vim Slackbuild fails to fetch vim 8.000x sources from github on -current mats_b_tegner Slackware 4 09-15-2016 06:56 PM
[SOLVED] Fedora shows 'man vim' but when execute 'vim' got "bash: vim: command not found..." ? flash_os Linux - Newbie 19 01-03-2015 11:56 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:37 PM.

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
Open Source Consulting | Domain Registration