LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Vim Problem (https://www.linuxquestions.org/questions/linux-general-1/vim-problem-120382/)

gsibble 11-27-2003 02:57 AM

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

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

hw-tph 11-27-2003 05:41 AM

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

alexisb 01-14-2006 12:52 AM

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!

berbae 01-14-2006 09:41 AM

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.

alexisb 01-14-2006 10:43 AM

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!

berbae 01-14-2006 11:12 AM

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?


All times are GMT -5. The time now is 07:14 AM.