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

Re: Konsole and Vim colors

Tue Dec 17, 2013 6:23 pm
I compared the two files using diff and it said they are different . I tried to copy the remote file on my local pc but colors didn't change.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Tue Dec 17, 2013 11:20 pm
Hmm. Unfortunate - i'm out of ideas as to why the colour schemes would differ as there is no reason for them to do so. Have you checked with other terminal emulators on your computer to see if that render correctly?


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

Re: Konsole and Vim colors

Tue Dec 17, 2013 11:33 pm
I am sorry but how can I do it ?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Tue Dec 17, 2013 11:37 pm
Try running another terminal application such as XTerm and see if the colours are displayed "correctly" there. If they aren't - then it is a Vim / terminfo issue, as the colour schemes being sent are wrong. If they are displayed correctly, it is a bug in Konsole.


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

Re: Konsole and Vim colors

Tue Dec 17, 2013 11:48 pm
I have just tried under xterm and the colours aren't displayed "correctly"

edit: I have a new trail : when i call vim using sudo, colors are good
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS

Re: Konsole and Vim colors

Wed Dec 18, 2013 12:10 am
What do you get when running
Code: Select all
:set t_Co


in Vim? Posting your .vimrc would also be helpful.


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

Wed Dec 18, 2013 12:20 am
I get t_Co=256
My .vimrc file:

Code: Select all
syntax on
set background=dark
set number
set cursorline
set incsearch
set nocompatible
set t_Co=256
set title
set ruler
set wrap
set ignorecase
set smartcase
set incsearch
set hlsearch
set mouse=a
set visualbell               "Empeche Vim de beeper
set noerrorbells            "Empeche Vim de beeper
set backspace=indent,eol,start    "Active le comportement 'habituel' de la touche retour arrière   
set hidden                   "Cache les fichiers lors de l'ouverture d'autres fichiers

filetype off
colorscheme tango

"Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

Bundle 'vim-scripts/guicolorscheme.vim'
Bundle 'scrooloose/nerdtree'
Bundle 'gmarik/vundle'
Bundle 'bling/vim-airline'
Bundle 'othree/html5.vim'

"airline
filetype plugin indent on
let g:airline_theme = 'murmur'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1

"réglages éditeur
set laststatus=1
set tabstop=4
set shiftwidth=4

"Pas de flèches directionnelles
map <Up> <Nop>
map <Down> <Nop>
map <Left> <Nop>
map <Right> <Nop>
imap <Up> <Nop>
imap <Down> <Nop>
imap <Left> <Nop>
imap <Right> <Nop>
imap jj <Esc>
"nnoremap <silent> <C-l> :<C-u>nohlsearch<CR><C-l>
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Wed Dec 18, 2013 2:31 am
Do the vimrc files from your computer differ with those on the university system, and those used by root on your computer?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
shmerl
Registered Member
Posts
251
Karma
1
OS

Re: Konsole and Vim colors

Wed Dec 18, 2013 7:58 am
Gnome terminal uses pastel colors for default set of common colors (aka Tango theme). Konsole uses rougher colors by default. I also like Gnome terminal choice of default color theme. You can reassign colors in Konsole as well. See Edit Current Profile > Appearance. You can modify colors by hand there (making a new theme). Or use this:

Code: Select all
[Background]
Color=0,0,0

[BackgroundIntense]
Color=0,0,0

[Color0]
Color=0,0,0

[Color0Intense]
Color=85,87,83

[Color1]
Color=204,0,0

[Color1Intense]
Color=239,41,41

[Color2]
Color=78,154,6

[Color2Intense]
Color=138,226,52

[Color3]
Color=196,160,0

[Color3Intense]
Color=252,233,79

[Color4]
Color=52,101,164

[Color4Intense]
Color=114,159,207

[Color5]
Color=117,80,123

[Color5Intense]
Color=173,127,168

[Color6]
Color=6,152,154

[Color6Intense]
Color=52,226,226

[Color7]
Color=232,232,232

[Color7Intense]
Color=238,238,238

[Foreground]
Color=232,232,232

[ForegroundIntense]
Color=238,238,238

[General]
Description=Tango
Opacity=1
Wallpaper=


Place it in file: $HOME/.kde/share/apps/konsole/Tango.colorscheme
and restart Konsole. Then go to Edit Current Profile > Appearance and chose Tango as the color theme. All this helps for default 16 colors though, to make them a bit more easy on the eyes.

To access 256 colors in various applications, I simply set TERM=xterm-256color and chose 256 color themes in vim or Midnight Commander for example.
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Wed Dec 18, 2013 11:48 pm
@bcooksley : The .vimrc are the same on the university system and on my own, because i want to have the same settings on the two platforms . But how can i know what .vimrc is uses by root ?

@shmerl : I have put the Tango.colorscheme in the konsole directory and i have chosen it as the konsole colorscheme but the problems with vim colors still appears
shmerl
Registered Member
Posts
251
Karma
1
OS

Re: Konsole and Vim colors

Thu Dec 19, 2013 3:20 am
The scheme I gave you can improve general look of Konsole, but vim assigns color schemes on its own, so it doesn't directly affect it.

In your .vimrc, I noticed that you are using background=dark. I think it's not necessary for vim schemes which are already designed to be dark, and it actually can make it look worse. Try removing that setting.

Moret wrote:But how can i know what .vimrc is uses by root?

I guess that would be /root/.vimrc if it exists. If it doesn't, vim will start with default settings as defined in /etc/vim/vimrc
Moret
Registered Member
Posts
22
Karma
0

Re: Konsole and Vim colors

Thu Dec 19, 2013 5:53 pm
In your .vimrc, I noticed that you are using background=dark. I think it's not necessary for vim schemes which are already designed to be dark, and it actually can make it look worse. Try removing that setting.


That didn't change anything.

I found the /etc/vim/vimrc file (/root/.vimrc file doesn't exist) but I haven't notice something special into .

I had an idea : I have opened vim using sudo, so my colors were good, and I tried to type the :source ~/.vimrc command, to load my normal .vimrc. The colors didn't change, they remained good. I think we can conclude it is a problem from environnement variables , can't we ?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Thu Dec 19, 2013 9:21 pm
When running commands using "sudo" numerous environment variables are purged (as they represent a security risk).
Please provide the output of "export".


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

Re: Konsole and Vim colors

Thu Dec 19, 2013 9:43 pm
The result of export :

Code: Select all
declare -x COLORFGBG="15;0"
declare -x DBUS_SESSION_BUS_ADDRESS="unix:abstract=/tmp/dbus-ULCUnjkE3h"
declare -x DEFAULTS_PATH="/usr/share/gconf/kde-plasma.default.path"
declare -x DESKTOP_SESSION="kde-plasma"
declare -x DISPLAY=":0"
declare -x GDMSESSION="kde-plasma"
declare -x GDM_LANG="fr_FR"
declare -x GEM_HOME="/home/aurelien/.rvm/gems/ruby-2.0.0-p353"
declare -x GEM_PATH="/home/aurelien/.rvm/gems/ruby-2.0.0-p353:/home/aurelien/.rvm/gems/ruby-2.0.0-p353@global"
declare -x GPG_AGENT_INFO="/tmp/gpg-1nwZOu/S.gpg-agent:1184:1"
declare -x GS_LIB="/home/aurelien/.fonts"
declare -x GTK2_RC_FILES="/etc/gtk-2.0/gtkrc:/home/aurelien/.gtkrc-2.0:/home/aurelien/.kde/share/config/gtkrc-2.0"
declare -x GTK_RC_FILES="/etc/gtk/gtkrc:/home/aurelien/.gtkrc:/home/aurelien/.kde/share/config/gtkrc"
declare -x HOME="/home/aurelien"
declare -x IM_CONFIG_PHASE="1"
declare -x INSTANCE=""
declare -x IRBRC="/home/aurelien/.rvm/rubies/ruby-2.0.0-p353/.irbrc"
declare -x JOB="dbus"
declare -x KDE_FULL_SESSION="true"
declare -x KDE_MULTIHEAD="false"
declare -x KDE_SESSION_UID="1000"
declare -x KDE_SESSION_VERSION="4"
declare -x KONSOLE_DBUS_SERVICE=":1.81"
declare -x KONSOLE_DBUS_SESSION="/Sessions/1"
declare -x KONSOLE_DBUS_WINDOW="/Windows/1"
declare -x KONSOLE_PROFILE_NAME="Terminal"
declare -x LANG="fr_FR.UTF-8"
declare -x LANGUAGE="fr_FR"
declare -x LESSCLOSE="/usr/bin/lesspipe %s %s"
declare -x LESSOPEN="| /usr/bin/lesspipe %s"
declare -x LOGNAME="aurelien"
declare -x LS_COLORS="rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:"
declare -x MANDATORY_PATH="/usr/share/gconf/kde-plasma.mandatory.path"
declare -x MY_RUBY_HOME="/home/aurelien/.rvm/rubies/ruby-2.0.0-p353"
declare -x OLDPWD="/home/aurelien"
declare -x PATH="/home/aurelien/.rvm/gems/ruby-2.0.0-p353/bin:/home/aurelien/.rvm/gems/ruby-2.0.0-p353@global/bin:/home/aurelien/.rvm/rubies/ruby-2.0.0-p353/bin:/home/aurelien/.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:."
declare -x PROFILEHOME=""
declare -x PWD="/home/aurelien/Bureau"
declare -x QT_PLUGIN_PATH="/home/aurelien/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/"
declare -x RUBY_VERSION="ruby-2.0.0-p353"
declare -x SESSION="kde-plasma"
declare -x SESSIONTYPE=""
declare -x SESSION_MANAGER="local/aurelien-bureau:@/tmp/.ICE-unix/1513,unix/aurelien-bureau:/tmp/.ICE-unix/1513"
declare -x SHELL="/bin/bash"
declare -x SHELL_SESSION_ID="e7a5f717bdcd400093a2f32331b844d6"
declare -x SHLVL="1"
declare -x SSH_AGENT_PID="1187"
declare -x SSH_AUTH_SOCK="/tmp/ssh-J2ZqpTEE6hGi/agent.1183"
declare -x TERM="xterm-256color"
declare -x TEXTDOMAIN="im-config"
declare -x TEXTDOMAINDIR="/usr/share/locale/"
declare -x UPSTART_EVENTS="started xsession"
declare -x UPSTART_INSTANCE=""
declare -x UPSTART_JOB="startkde"
declare -x UPSTART_SESSION="unix:abstract=/com/ubuntu/upstart-session/1000/1126"
declare -x USER="aurelien"
declare -x WINDOWID="44040218"
declare -x XAUTHORITY="/tmp/kde-aurelien/xauth-1000-_0"
declare -x XCURSOR_THEME="oxy-white"
declare -x XDG_CONFIG_DIRS="/etc/xdg/xdg-kde-plasma:/usr/share/upstart/xdg:/etc/xdg"
declare -x XDG_CURRENT_DESKTOP="KDE"
declare -x XDG_DATA_DIRS="/usr/share:/usr/share/kde-plasma:/usr/local/share/:/usr/share/"
declare -x XDG_RUNTIME_DIR="/run/user/1000"
declare -x XDG_SEAT="seat0"
declare -x XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0"
declare -x XDG_SESSION_ID="c1"
declare -x XDG_SESSION_PATH="/org/freedesktop/DisplayManager/Session0"
declare -x XDG_VTNR="7"
declare -x _system_arch="x86_64"
declare -x _system_name="Ubuntu"
declare -x _system_type="Linux"
declare -x _system_version="13.10"
declare -x rvm_alias_expanded
declare -x rvm_bin_flag
declare -x rvm_bin_path="/home/aurelien/.rvm/bin"
declare -x rvm_configure_flags
declare -x rvm_delete_flag
declare -x rvm_docs_type
declare -x rvm_file_name
declare -x rvm_gemstone_package_file
declare -x rvm_gemstone_url
declare -x rvm_hook
declare -x rvm_make_flags
declare -x rvm_niceness
declare -x rvm_nightly_flag
declare -x rvm_only_path_flag
declare -x rvm_path="/home/aurelien/.rvm"
declare -x rvm_prefix="/home/aurelien"
declare -x rvm_proxy
declare -x rvm_quiet_flag
declare -x rvm_ruby_alias
declare -x rvm_ruby_bits
declare -x rvm_ruby_configure
declare -x rvm_ruby_file
declare -x rvm_ruby_global_gems_path
declare -x rvm_ruby_make
declare -x rvm_ruby_make_install
declare -x rvm_ruby_mode
declare -x rvm_ruby_string
declare -x rvm_ruby_url
declare -x rvm_script_name
declare -x rvm_sdk
declare -x rvm_silent_flag
declare -x rvm_sticky_flag
declare -x rvm_system_flag
declare -x rvm_use_flag
declare -x rvm_user_flag
declare -x rvm_version="1.24.7 (stable)"
declare -x rvm_wrapper_name
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Konsole and Vim colors

Sat Dec 21, 2013 9:38 am
Unfortunately there isn't anything immediately obvious there. You might need to contact a person more experienced in how Vim determines which colours/themes to use to determine why it is using different colours here i'm afraid.


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


Bookmarks



Who is online

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