Colors not taking effect?

This is a discussion on Colors not taking effect? within the Editors forums in Theory and Concepts category; Hi, I'm using VIM 6.3 on Solaris. I created a ".gvimrc" file in my home directory but when I open any file, whether it be .java, .html, or .js in vim, I'm still not seeing color highlighting. Any ideas? Below are the contents of my file, which I copied from here -- http://www.cs.auckland.ac.nz/referen...m-HOWTO-2.html . Thanks, - Dave ==================Begin .gvimrc ===================================== " Vim " An example for a gvimrc file. " The commands in this are executed when the GUI is started. " " To use it, copy it to " for Unix and OS/2: ~/.gvimrc " for Amiga: s:.gvimrc " ...

Go Back   Application Development Forum > Theory and Concepts > Editors

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-20-2008, 01:18 PM
laredotornado
Guest
 
Default Colors not taking effect?

Hi,

I'm using VIM 6.3 on Solaris. I created a ".gvimrc" file in my home
directory but when I open any file, whether it be .java, .html, or .js
in vim, I'm still not seeing color highlighting. Any ideas? Below
are the contents of my file, which I copied from here --
http://www.cs.auckland.ac.nz/referen...m-HOWTO-2.html.

Thanks, - Dave

==================Begin .gvimrc =====================================
" Vim
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started.
"
" To use it, copy it to
" for Unix and OS/2: ~/.gvimrc
" for Amiga: s:.gvimrc
" for MS-DOS and Win32: $VIM\_gvimrc

" Make external commands work through a pipe instead of a pseudo-tty
"set noguipty

" set the X11 font to use. See 'man xlsfonts' on unix/linux
" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
set guifont=8x13bold
"set guifont=9x15bold
"set guifont=7x14bold
"set guifont=7x13bold
"
" Highly recommended to set tab keys to 4 spaces
set tabstop=4
set shiftwidth=4
"
" The opposite is 'set wrapscan' while searching for strings....
set nowrapscan
"
" The opposite is set noignorecase
set ignorecase

" Make command line two lines high
set ch=2

" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>

" Only do this for Vim version 5.0 and later.
if version >= 500

" I like highlighting strings inside C comments
let c_comment_strings=1

" Switch on syntax highlighting.
syntax on

" Switch on search pattern highlighting.
set hlsearch

" For Win32 version, have "K" lookup the keyword in a help file
"if has("win32")
" let winhelpfile='windows.hlp'
" map K :execute "!start winhlp32 -k <cword> " . winhelpfile <CR>
"endif

" Hide the mouse pointer while typing
set mousehide

" Set nice colors
" background for normal text is light grey
" Text below the last line is darker grey
" Cursor is green
" Constants are not underlined but have a slightly lighter
background
highlight Normal guibg=grey90
highlight Cursor guibg=Green guifg=NONE
highlight NonText guibg=grey80
highlight Constant gui=NONE guibg=grey95
highlight Special gui=NONE guibg=grey95

endif

===================End .gvimrc =====================================
Reply With Quote
  #2  
Old 08-20-2008, 03:10 PM
Florian Rehnisch
Guest
 
Default Re: Colors not taking effect?

Moin.

laredotornado <laredotornado@zipmail.com>:
> I'm using VIM 6.3 on Solaris.


No plans to upgrade? Vim 7.2 has been released recently

> I created a ".gvimrc" file in my home
> directory but when I open any file, whether it be .java, .html, or .js
> in vim, I'm still not seeing color highlighting. Any ideas? Below
> are the contents of my file, which I copied from here --
> http://www.cs.auckland.ac.nz/referen...m-HOWTO-2.html.


What does ":set ft" say?

Does ":set ft=java" help?

Check ":version" in Vim.

flori
Reply With Quote
  #3  
Old 08-21-2008, 06:23 AM
John Delaney
Guest
 
Default Re: Colors not taking effect?

laredotornado wrote:
> Hi,
>
> I'm using VIM 6.3 on Solaris. I created a ".gvimrc" file in my home
> directory but when I open any file, whether it be .java, .html, or .js
> in vim, I'm still not seeing color highlighting. Any ideas?


Just to be clear - are you actually using the GUI version of vim
(a.k.a. "gvim")? If not then the "syntax on" line needs to go
in .vimrc, not .gvimrc.
Reply With Quote
  #4  
Old 08-21-2008, 10:20 AM
laredotornado
Guest
 
Default Re: Colors not taking effect?

On Aug 21, 4:23*am, John Delaney <johndela...@gmail.com> wrote:
> laredotornadowrote:
> > Hi,

>
> > I'm using VIM 6.3 on Solaris. *I created a ".gvimrc" file in my home
> > directory but when I open any file, whether it be .java, .html, or .js
> > in vim, I'm still not seeing color highlighting. *Any ideas?

>
> Just to be clear - are you actually using the GUI version of vim
> (a.k.a. "gvim")? If not then the "syntax on" line needs to go
> in .vimrc, not .gvimrc.


That was definitely a problem. I'm using the command line version of
VIM and as such need .vimrc. However, I'm still not able to get color
highlighting. I downloaded a sample .vimrc file from here --
http://phuzz.org/vimrc.html. But even though the file includes
"syntax on", I'm still not getting color highlighting when opening
a .java file in vim

http://screencast.com/t/V2ETP4D2tx

Per Florian's suggestion, I typed "set ft" in my shell, but nothing
happened.

Any other suggestions you can provide are much appreciated, - Dave


PS - At the company I'm at, I don't have control over the version of
VIM, but will lobby for an upgrade.
Reply With Quote
  #5  
Old 08-21-2008, 04:37 PM
Gary Johnson
Guest
 
Default Re: Colors not taking effect?

laredotornado <laredotornado@zipmail.com> wrote:
> On Aug 21, 4:23 am, John Delaney <johndela...@gmail.com> wrote:
>> laredotornadowrote:
>> > Hi,

>>
>> > I'm using VIM 6.3 on Solaris. I created a ".gvimrc" file in my home
>> > directory but when I open any file, whether it be .java, .html, or .js
>> > in vim, I'm still not seeing color highlighting. Any ideas?

>>
>> Just to be clear - are you actually using the GUI version of vim
>> (a.k.a. "gvim")? If not then the "syntax on" line needs to go
>> in .vimrc, not .gvimrc.

>
> That was definitely a problem. I'm using the command line version of
> VIM and as such need .vimrc. However, I'm still not able to get color
> highlighting. I downloaded a sample .vimrc file from here --
> http://phuzz.org/vimrc.html. But even though the file includes
> "syntax on", I'm still not getting color highlighting when opening
> a .java file in vim
>
> http://screencast.com/t/V2ETP4D2tx
>
> Per Florian's suggestion, I typed "set ft" in my shell, but nothing
> happened.


You were supposed to execute ":set ft" within vim, not in your shell. If
you were editing a .java file at the time, you should have seen

filetype=java

at the bottom of your screen.

That being said, I don't see anywhere in http://phuzz.org/vimrc.html a
command to turn on filetype detection. That command is probably in the
system vimrc of the author's system. You need to add to your .vimrc a
line like this:

filetype plugin on

See

:help filetype-plugin-on

and nearby sections of that same help file for more information.

> PS - At the company I'm at, I don't have control over the version of
> VIM, but will lobby for an upgrade.


Syntax coloring should work fine in the version you have.

--
Gary Johnson
Reply With Quote
  #6  
Old 08-21-2008, 09:53 PM
Bob Harris
Guest
 
Default Re: Colors not taking effect?

In article
<9d88fddc-3dbd-4e7a-ab09-8604c43a135e@a70g2000hsh.googlegroups.com
>,

laredotornado <laredotornado@zipmail.com> wrote:

> On Aug 21, 4:23*am, John Delaney <johndela...@gmail.com> wrote:
> > laredotornadowrote:
> > > Hi,

> >
> > > I'm using VIM 6.3 on Solaris. *I created a ".gvimrc" file in my home
> > > directory but when I open any file, whether it be .java, .html, or .js
> > > in vim, I'm still not seeing color highlighting. *Any ideas?

> >
> > Just to be clear - are you actually using the GUI version of vim
> > (a.k.a. "gvim")? If not then the "syntax on" line needs to go
> > in .vimrc, not .gvimrc.

>
> That was definitely a problem. I'm using the command line version of
> VIM and as such need .vimrc. However, I'm still not able to get color
> highlighting. I downloaded a sample .vimrc file from here --
> http://phuzz.org/vimrc.html. But even though the file includes
> "syntax on", I'm still not getting color highlighting when opening
> a .java file in vim
>
> http://screencast.com/t/V2ETP4D2tx
>
> Per Florian's suggestion, I typed "set ft" in my shell, but nothing
> happened.
>
> Any other suggestions you can provide are much appreciated, - Dave
>
>
> PS - At the company I'm at, I don't have control over the version of
> VIM, but will lobby for an upgrade.


If you are not getting syntax coloring after you do

:syntax on

even when you do it interactively, then I would guess that your
TERM environment variable setting is not pointing to a
terminfo/TERMCAP definition that includes color settings.

If you can not find a TERM setting that gives you syntax coloring,
try adding the following to your .vimrc file:

if has("terminfo")
let &t_Co=8
let &t_Sf="\e[3%p1%dm"
let &t_Sb="\e[4%p1%dm"
else
let &t_Co=8
let &t_Sf="\e[3%dm"
let &t_Sb="\e[4%dm"
endif

This will tell Vim that your terminal supports colors.

Bob Harris
Reply With Quote
  #7  
Old 08-22-2008, 01:38 AM
canoe
Guest
 
Default Re: Colors not taking effect?

laredotornado wrote:
> Hi,
>
> I'm using VIM 6.3 on Solaris. I created a ".gvimrc" file in my home
> directory but when I open any file, whether it be .java, .html, or .js
> in vim, I'm still not seeing color highlighting. Any ideas? Below
> are the contents of my file, which I copied from here --
> http://www.cs.auckland.ac.nz/referen...m-HOWTO-2.html.


What does
:version
show? In particular, does it have
+syntax
or
-syntax
?

If its showing "-syntax", then your vim doesn't have syntax highlighting support
compiled in.

Other things:

set nocp
filetype plugin on
syntax on

Canoe
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:04 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.