LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-27-2003, 02:57 AM   #1
gsibble
Member
 
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162

Rep: Reputation: 30
Vim Problem


I'm now using KDE 3.1 on Arch .5. Everything is bleeding edge stable up-to-date

In any case, I use konsole for my colsoles (transparency is awesome......) but I'm having a problem with vim (my editor of choice).

When I'm in a normal console window (TTY1 for instance), vim correctly displays the colors for different types of files. This is of course very helpful. In Konsole however, the colors are not displayed. All of the text is white!

Also, the colors in my prompt (username, time, etc.) DO display correctly in Konsole, so it isn't just a single konsole setting. Any ideas where it might be? Thanks!

-George
 
Old 11-27-2003, 05:41 AM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Does :syn on in vim do anything? Just a thought.

Another thought: Does Konsole set the $TERM variable correctly, and if so - to what? It might set the terminal type to something that vim doesn't recognize, and if it doesn't recognize the $TERM it will default to black and white.

You could try something like TERM=xterm vim to launch your editor with the terminal type set to plain xterm (which vim recognizes as a color-capable terminal).

Håkan
 
Old 01-14-2006, 12:52 AM   #3
alexisb
LQ Newbie
 
Registered: Jun 2003
Location: Lima, Peru
Distribution: Fedora Core 3
Posts: 17

Rep: Reputation: 0
Hello, I'm having the same problem, you can see I have Konsole with $TERM set to xterm.

Code:
$ echo $TERM
xterm
But vim is not recognizing the color schemes I have in ~/.vim/colors , I have to use gvim for getting it working.

But my problem is accessing remote servers, I don't use gvim there, just plain vim and need my colors right.

Is this a problem with KDE scheme colors? I've tried all of them.

Should I use other terminal application?

Regards!
 
Old 01-14-2006, 09:41 AM   #4
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Hello Everyone
Here is what I have in the ~/.vimrc file:
Code:
"
" Colo(u)red or not colo(u)red
" If you want color you should set this to true
"
let color = "true"
"
if has("syntax")
    if color == "true"
    " This will switch colors ON
    so ${VIMRUNTIME}/syntax/syntax.vim
    else
    " this switches colors OFF
    syntax off
    set t_Co=0
    filetype on
    endif
endif
On my machine VIMRUNTIME contains /usr/share/vim/current
Here is the /usr/share/vim/current/syntax/syntax.vim file:
Quote:
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2001 Sep 04

" This file is used for ":syntax on".
" It installs the autocommands and starts highlighting for all buffers.

if !has("syntax")
finish
endif

" If Syntax highlighting appears to be on already, turn it off first, so that
" any leftovers are cleared.
if exists("syntax_on") || exists("syntax_manual")
so <sfile>:p:h/nosyntax.vim
endif

" Load the Syntax autocommands and set the default methods for highlighting.
runtime syntax/synload.vim

" Load the FileType autocommands if not done yet.
if exists("did_load_filetypes")
let s:did_ft = 1
else
filetype on
let s:did_ft = 0
endif

" Set up the connection between FileType and Syntax autocommands.
" This makes the syntax automatically set when the file type is detected.
augroup syntaxset
au! FileType * exe "set syntax=" . expand("<amatch>")
augroup END


" Execute the syntax autocommands for the each buffer.
" If the filetype wasn't detected yet, do that now.
" Always do the syntaxset autocommands, for buffers where the 'filetype'
" already was set manually (e.g., help buffers).
doautoall syntaxset FileType
if !s:did_ft
doautoall filetypedetect BufRead
endif
I don't know if this can work for you, but I have colors in Konsole and TERM=xterm with this vim configuration file.

Last edited by berbae; 01-14-2006 at 11:08 AM.
 
Old 01-14-2006, 10:43 AM   #5
alexisb
LQ Newbie
 
Registered: Jun 2003
Location: Lima, Peru
Distribution: Fedora Core 3
Posts: 17

Rep: Reputation: 0
Hi, thank you very much, unfornutely is not working for me, I have TERM=xterm in Konsole and have tried with all the color schemes it offers (from Black on Light Color, to VIM colors to XTERM Colors).

Only using gvim I can get "colorscheme someColorScheme" working.

Any idea on how to override the colors imposed by Konsole? I'm used to it and wouldn't want to install another terminal before getting Konsole right.

By the way, I needed to log to MSN with Kopete and upgraded KDE with "yum update kdenetwork" , it downloaded all the dependencies (including kdebase), could I have missed something there that is affecting VIM colors?

Regards!
 
Old 01-14-2006, 11:12 AM   #6
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
I think it's not a Konsole configuration issue but a vim configuration issue
See my edited message above.
What do you have in the .vimrc file?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
vim backspace problem (no, not THAT one!) mad_pear Linux - Software 3 07-14-2009 12:03 AM
vim problem noir911 Linux - General 1 01-29-2005 07:39 AM
vim little problem tommasopiff General 3 03-26-2004 09:38 AM
vim little problem tommasopiff Linux - Newbie 3 03-26-2004 09:23 AM
problem with vim 77hh77 Linux - General 4 03-25-2003 12:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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