LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 05-08-2006, 03:08 AM   #1
rajeev1982
LQ Newbie
 
Registered: Apr 2006
Location: India
Distribution: Fedora Core 5
Posts: 13

Rep: Reputation: 0
Question no colors in vim on command line


Hi All,
I am using vim 6.3 on AIX 5.2, I can see the colors in ls command and other command, but when I run the vi there are no colors in that. when i run the command 'vi -g' it opens an X window and stats showing the colors. pleaes help me... I also have tried export TERM=xterm-color, but no luck. please anybody help me in this.
 
Old 05-09-2006, 12:53 PM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Did you try to enable syntax highlighting? Go into command mode and type "syntax on". If that does not work, you maybe don't have any default colors for vim. You may add color to your /pathtovim/vim63/colors (just a guess). You can download a color sample from here:

http://www.vim.org/scripts/download_...hp?src_id=4010
 
Old 05-09-2006, 11:25 PM   #3
rajeev1982
LQ Newbie
 
Registered: Apr 2006
Location: India
Distribution: Fedora Core 5
Posts: 13

Original Poster
Rep: Reputation: 0
Hi Mega Man X,
I can see the colors now, I have added the folowing lines to my .vimrc file.

if &term =~ "xterm"
if has("terminfo")
set t_Co=8
set t_Sf=^[[3%p1%dm
set t_Sb=^[[4%p1%dm
else
set t_Co=8
set t_Sf=^[[3%dm
set t_Sb=^[[4%dm
endif
endif

" where ^[ is actual <Ctrl-V> + <Esc>.
 
Old 06-04-2009, 03:39 AM   #4
mezhaka
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by rajeev1982 View Post
Hi Mega Man X,
I can see the colors now, I have added the folowing lines to my .vimrc file.

if &term =~ "xterm"
if has("terminfo")
set t_Co=8
set t_Sf=^[[3%p1%dm
set t_Sb=^[[4%p1%dm
else
set t_Co=8
set t_Sf=^[[3%dm
set t_Sb=^[[4%dm
endif
endif

" where ^[ is actual <Ctrl-V> + <Esc>.
thanks a lot -- this has worked out for me. may be you can briefly comment on the meaning if this code snipet?
 
Old 09-12-2012, 02:01 PM   #5
grantwnorman
LQ Newbie
 
Registered: Jun 2008
Posts: 7

Rep: Reputation: 1
Thumbs up

You can also simply append "syntax on" to the .vimrc file and it will enable syntax highlighting with one line.

wow just realized this is a super old thread. Hopefully the info will still help anyone else who is searching for this solution like I was.

Last edited by grantwnorman; 09-12-2012 at 02:03 PM.
 
Old 02-05-2015, 10:03 AM   #6
andstein
LQ Newbie
 
Registered: Feb 2015
Posts: 1

Rep: Reputation: Disabled
as rajeev1982 has pointed out, setting t_Co might do the trick

in my case, I was using tmux, which sets the environment variable TERM=screen, and vim sets t_Co=8 accordingly

to fix, I now specify tmux to set TERM=screen-256color by adding the following line to ~/.tmux.conf:

Code:
set -g default-terminal "screen-256color"
then, I let VIM set the variable t_Co accordingly by adding the following to ~/.vimrc:

Code:
if &term =~ "-256color$"
  set t_Co=256
endif
 
  


Reply

Tags
colors, vim



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
vim 'n' lynx: command line option to search for string Samsara Linux - Software 6 01-02-2013 06:36 PM
vim colors Erik Thorsson Debian 1 02-09-2005 09:38 AM
Switching off line number colors on vi or vim raees Linux - Software 4 04-21-2004 07:31 AM
Command line Colors? TikRu Linux - General 1 03-12-2002 07:10 AM
Command Line Graphics and Colors tony Programming 1 11-21-2000 12:28 PM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 10:49 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