LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-29-2004, 09:49 PM   #1
mahugl
LQ Newbie
 
Registered: Jan 2004
Distribution: Fedora Core
Posts: 5

Rep: Reputation: 0
VI Background Text Color


I was using vi to do some php and all of a sudden the background text color changed to brown. How can I get it back to the way it was. It makes it hard to read. My OS is Fedora.
Thanks for your help.
 
Old 01-29-2004, 11:02 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Assuming you want it to be black background, white text
:hi normal ctermfg=white ctermbg=black

If you put this in a file called .vimrc in the root of your home directory it'll automatically set it every time. In fact, I'll post my whole .vimrc so you can see all the options I use:

Code:
set cindent
set shiftwidth=3
set tabstop=3
set expandtab
set ruler
" some colors:  "white on black"
hi normal   ctermfg=white  ctermbg=black guifg=white  guibg=black
hi nontext  ctermfg=blue   ctermbg=black guifg=blue   guibg=black
" Syntax Hilighting
syntax on
set nowrap

" enables real tabs for Makefiles only
augroup Makefile
au!
au BufReadPre Makefile set noexpandtab
augroup END

" vim -b : edit binary using xxd-format!
augroup Binary
au!
au BufReadPre  *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
That is all pretty straight forward, I turn on cindent (uses spaces instead of tabs), set my widths to 3, show the ruler at the bottom of the screen (cursor coord.), and use syntax highlighting.

I also have special rules for Makefiles and Binaries so they show up how I like.
 
Old 12-15-2013, 09:38 PM   #3
kickstand
LQ Newbie
 
Registered: Dec 2013
Posts: 1

Rep: Reputation: Disabled
need extra command

set bg=dark
or set bg_light

to make the highlight correct color.
 
Old 12-15-2013, 10:12 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
Quote:
Originally Posted by kickstand View Post
need extra command

set bg=dark
or set bg_light

to make the highlight correct color.
Archaeologist?

This thread was last active 10 years ago next month. If you have a question you would do better to start a new one and put some thought into your post.

If you were answering this one you might be a little late!
 
  


Reply



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
How change text color using linux in text mode only runlevel 3? Xavius Linux - General 7 05-07-2009 02:19 AM
Change background color chingyenccy Linux - Newbie 6 01-23-2005 03:17 AM
PHP code did not create a cookie and it did not changed the background and text color Linh Programming 5 07-29-2004 10:15 PM
how change text (and background) color within the bash shell? Xavius Linux - Newbie 4 03-29-2004 02:21 PM
ncurses background color gtanghookup Programming 1 09-02-2003 08:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:20 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
Open Source Consulting | Domain Registration