This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Konsole and Vim colors

Tags: None
(comma "," separated)
Moret
Registered Member
Posts
22
Karma
0

Konsole and Vim colors

Sat Dec 14, 2013 5:34 pm
Hello,

I recently moved from Ubuntu to Kubuntu, and i quite like it . But I have a color problem with Konsole when I use vim. Indeed, I love the default colorscheme of vim, but the rendering is completely different between Konsole and gnome-terminal. I am a computer science student and University's computers are running Ubuntu . On them, the vim default colorscheme is nice, but when I run vim in Konsole on my own computer, the colors are pale and ugly :( .
But there is another thing, which is very strange. When I use ssh to remotly connect to a University's computer, vim colors in Konsole are good...
I would like to know how it is possible...
I thought screenshots would be more eloquent so :

On the left of pictures, there is the ssh vim, on a remote university computer, and on the right, the vim on my local computer
On the first picture, vim use the "tango" colorscheme. We can see they have the same rendering.
On the second picture, vim use the "default" colorscheme. The rendering are very differents.
My goal is to get the colors of ssh vim tango colorscheme on my local computer.

Image

Image

I apologize for my poor english and i hop somebody will be able to give me a response
Thank you
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Sat Dec 14, 2013 11:02 pm
I suggest you copy the ~/.vimrc file from the University computers to your own. Konsole does not impose a colour scheme as such (although it does have a colour map, but that is a different thing) it merely relies on the colour markers that applications such as Vim give it. This is why Vim over SSH to the University computers differs - as they will be using a different set of colours to what Vim uses on your local computer.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: Konsole and Vim colors

Sat Dec 14, 2013 11:05 pm
Try Settings -> Edit Current Profile... -> Environment: Edit... -> enter "TERM=xterm-256color" (without "").


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Sun Dec 15, 2013 8:05 pm
I forget to specify that the .vimrc are the same both on the Universiy's computer and on my own, so I concluded there is a problem with my Konsole colors and that's why the xterm-256color is already setted.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Sun Dec 15, 2013 8:58 pm
The colour map used by Konsole is set in Settings > Edit Current Profile > Appearance. I use "Linux colours" on my system here.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Sun Dec 15, 2013 9:10 pm
I put "Linux Colors" in Konsole settings and colors have changed . But they still aren't what I want. What I don't understand is if the problem comes from the color map of Konsole, why does it work through ssh ?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Sun Dec 15, 2013 9:20 pm
I've no idea. Have you compared the output of "TERM" on both systems, as well as any system wide Vim configuration files like /etc/vimrc (if it exists)?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Sun Dec 15, 2013 9:54 pm
Yeah i have the same output when I type echo $TERM : xterm-256color

The two /etc/vim/vimc files are also the same
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Sun Dec 15, 2013 9:59 pm
Can you compare the two environment variables COLORFGBG and COLORTERM (if set)?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Sun Dec 15, 2013 10:20 pm
When i echo $COLORFGBG i get 15;0 on my computer and nothing via SSH. I think it means it is not set on the remote system.
I get nothing for COLORTERM in local and via ssh.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Mon Dec 16, 2013 10:49 pm
Can you compare the /usr/share/terminfo/x/xterm-256color file on both systems to verify it is the same?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Mon Dec 16, 2013 11:07 pm
I have no directory called terminfo into my share directory on my local pc. I have the xterm-256color file on the remote one but i don't know how i can read it. Vim and cat command give an unreadable output.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Mon Dec 16, 2013 11:23 pm
Please check to see if a package called "terminfo" or similar is available, and install it if it is not already. I'm surprised your system can function without a /usr/share/terminfo/ folder and associated contents.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Mon Dec 16, 2013 11:43 pm
I can't find any package called terminfo but you intrigued me . So i did a locate terminfo in my shell and i get this output :
/boot/grub/i386-pc/terminfo.mod
/etc/terminfo
/etc/terminfo/README
/lib/terminfo
/lib/terminfo/E
/lib/terminfo/a
/lib/terminfo/c
/lib/terminfo/d
/lib/terminfo/h
/lib/terminfo/l
/lib/terminfo/m
/lib/terminfo/p
/lib/terminfo/r
/lib/terminfo/s
/lib/terminfo/v
/lib/terminfo/w
/lib/terminfo/x
/lib/terminfo/E/Eterm
/lib/terminfo/E/Eterm-color
/lib/terminfo/a/ansi
/lib/terminfo/c/cons25
/lib/terminfo/c/cons25-debian
/lib/terminfo/c/cygwin
/lib/terminfo/d/dumb
/lib/terminfo/h/hurd
/lib/terminfo/l/linux
/lib/terminfo/m/mach
/lib/terminfo/m/mach-bold
/lib/terminfo/m/mach-color
/lib/terminfo/m/mach-gnu
/lib/terminfo/m/mach-gnu-color
/lib/terminfo/p/pcansi
/lib/terminfo/r/rxvt
/lib/terminfo/r/rxvt-basic
/lib/terminfo/r/rxvt-m
/lib/terminfo/r/rxvt-unicode
/lib/terminfo/s/screen
/lib/terminfo/s/screen-256color
/lib/terminfo/s/screen-256color-bce
/lib/terminfo/s/screen-bce
/lib/terminfo/s/screen-s
/lib/terminfo/s/screen-w
/lib/terminfo/s/sun
/lib/terminfo/v/vt100
/lib/terminfo/v/vt102
/lib/terminfo/v/vt220
/lib/terminfo/v/vt52
/lib/terminfo/w/wsvt25
/lib/terminfo/w/wsvt25m
/lib/terminfo/x/xterm
/lib/terminfo/x/xterm-256color
/lib/terminfo/x/xterm-color
/lib/terminfo/x/xterm-debian
/lib/terminfo/x/xterm-mono
/lib/terminfo/x/xterm-r5
/lib/terminfo/x/xterm-r6
/lib/terminfo/x/xterm-vt220
/lib/terminfo/x/xterm-xfree86
/usr/lib/grub/i386-pc/terminfo.mod
/usr/share/man/man5/terminfo.5.gz
/usr/share/vim/vim74/ftplugin/terminfo.vim
/usr/share/vim/vim74/syntax/terminfo.vim

into the /etc/terminfo/README is written the following sentence :

"This directory is for system-local terminfo descriptions. By default,
ncurses will search ${HOME}/.terminfo first, then /etc/terminfo (this
directory), then /lib/terminfo, and last not least /usr/share/terminfo."
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Tue Dec 17, 2013 1:51 am
Okay, it seems like your distribution simply uses a different location to store it's terminal information.
The files to compare in this case are /lib/terminfo/x/xterm-256color on your system with /usr/share/terminfo/x/xterm-256color on the other system. A simple "diff" should suffice to determine if there are any differences.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]