Jump to content
  • Advertisement
Sign in to follow this  
datadawgx

text color in vim

This topic is 4722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I KNOW some of you guys are hardcore VIM users ;) I'm still learning the ropes myself. Does anyone know how to set the color of the background, the test, certain kinds of syntax, etc in the .vimrc file? I know you can set them to hex values or something like that. I just don't remember how. -ddx

Share this post


Link to post
Share on other sites
Advertisement
Hi!, try ":help syntax", in visual mode...., are you using vim or gvim???

Bye!

Haora

Share this post


Link to post
Share on other sites
You're kind of outdated...[grin], you should change to gVim (if you can), or at least update from 5.8 to 6.3.....

On a side note..., vim rocks!!! [grin]

Share this post


Link to post
Share on other sites
By the by you'll want :h while in normal, not visual.

" from my color file...
highlight String gui=none guifg=linen guibg=#426F42
hi feralClass gui=none guifg=LightGreen guibg=bg
" etc.

" from a project specific .vim sourced from .vimrc
syn keyword cTodo MAKEME POLISH CURRENT PRETTIFY

if 1
syntax match feral_x "_x\>" containedin=ALL
syntax match feral_y "_y\>" containedin=ALL
syntax match feral_z "_z\>" containedin=ALL
syntax match feral_x "\<x\>" containedin=ALL
syntax match feral_y "\<y\>" containedin=ALL
syntax match feral_z "\<z\>" containedin=ALL
syntax match feral_x "\<x_" containedin=ALL
syntax match feral_y "\<y_" containedin=ALL
syntax match feral_z "\<z_" containedin=ALL

highlight feral_x guifg=white guibg=MediumVioletRed
highlight feral_y guifg=white guibg=SeaGreen
highlight feral_z guifg=white guibg=SteelBlue

endif

if 1 " namespaces
syntax match feralNamespace /\<std\>::/me=e-2
syntax match feralNamespace /\<Ogre\>::/me=e-2
hi feralNamespace guifg=pink
endif

syntax match feralClass "\<Ogre::Angle\>"lc=6
" and so on and so forth...




:h syntax
:h syn-match
:h syn-keyword
and so on.. (=

:wq

Share this post


Link to post
Share on other sites
im not understanding this syntax very well, and highlight doesn't seem to do anything when i try to use it.

does it matter that im using xterm?

Share this post


Link to post
Share on other sites
Prolly, what I posted was for gVIM, sorry forgot to mention that.

Also, my knowledge of VIM starts at 6.0 so I may be making erroneous assumptions for your version. I use 6.3 currently. By the by it is WELL worth the bother to get using 6.3. Folds > all ;)

Make sure :version lists "+syntax" also by the by; not going to get much colors without it. (will show "-syntax" is it was compiled without syntax stuff.)

I'm not really super sure on terms (mine worked out of the box as it were), I only fiddled with :colorscheme (=
A quick check shows that Adaryn.vim : A Deep, Sharp color scheme, has term colors, I think anyway. (I've no term available so I can but guess)

The highlight command is pretty easy to understand,
:highlight <group> <options=value>
group being what well group you want these optiones to pertain to; cTodo for instance. (// XXX, TODO in a comment only, by the by, in a :set ft=cpp file)
and the options (:h highlight-args) set a particular option. "guifg=linen" for instance.

Perhaps easiest to learn by example and examine your vim/color directory, or visit vim.sf.net and DL one that sounds nice.

Another option perhaps would be to hop into X and get GVIM running and try playing with it abit; then once you have a better idea fiddle with xterm, if you have the option of course.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!