as cores vim-powerline estão fora de sintonia no urxvt


3

Anexei duas imagens mostrando como é o meu vim-powerline.

modo normal do vim http://maprys.net/download/vim_normal.png

modo de inserção do vim http://maprys.net/download/vim_insert.png

Como você pode ver, algo aconteceu com as cores e não consigo descobrir como corrigi-lo.

Estou executando o Fedora 17 em uma instalação limpa com o i3 (configuração padrão) e o urxvt.

Aqui está o meu bashrc:

# .bashrc

if [[ "$(uname)" != "Darwin" ]]; then # non mac os x

    # source global bashrc
    if [[ -f "/etc/bashrc" ]]; then
        . /etc/bashrc
    fi

    export TERM='xterm-256color' # probably shouldn't do this
fi

# bash prompt with colors
# [ <user>@<hostname> <working directory> {current git branch (if you're in a repo)} ]
# ==>
PS1="\[\e[1;33m\][ \u\[\e[1;37m\]@\[\e[1;32m\]\h\[\e[1;33m\] \W\$(git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/ {\[\e[1;36m\]\1\[\e[1;33m\]}/') ]\[\e[0m\]\n==> "

# execute only in Mac OS X
if [[ "$(uname)" == 'Darwin' ]]; then

    # if OS X has a $HOME/bin folder, then add it to PATH
    if [[ -d "$HOME/bin" ]]; then
        export PATH="$PATH:$HOME/bin"
    fi

    alias ls='ls -G' # ls with colors

fi

alias ll='ls -lah' # long listing of all files with human readable file sizes
alias tree='tree -C' # turns on coloring for tree command
alias mkdir='mkdir -p' # create parent directories as needed
alias vim='vim -p' # if more than one file, open files in tabs

export EDITOR='vim'

# super-secret work stuff
if [[ -f "$HOME/.workbashrc" ]]; then
    . $HOME/.workbashrc
fi

# Add RVM to PATH for scripting
if [[ -d "$HOME/.rvm/bin" ]]; then # if installed
    PATH=$PATH:$HOME/.rvm/bin
fi

e meus Xdefaults:

! URxvt config

! colors!
URxvt.background:           #101010
URxvt.foreground:           #ededed
URxvt.cursorColor:          #666666
URxvt.color0:               #2E3436
URxvt.color8:               #555753
URxvt.color1:               #993C3C
URxvt.color9:               #BF4141
URxvt.color2:               #3C993C
URxvt.color10:              #41BF41
URxvt.color3:               #99993C
URxvt.color11:              #BFBF41
URxvt.color4:               #3C6199
URxvt.color12:              #4174FB
URxvt.color5:               #993C99
URxvt.color13:              #BF41BF
URxvt.color6:               #3C9999
URxvt.color14:              #41BFBF
URxvt.color7:               #D3D7CF
URxvt.color15:              #E3E3E3

! options
URxvt*loginShell:           true
URxvt*font:                 xft:DejaVu Sans Mono for Powerline:antialias=true:size=12
URxvt*saveLines:            8192
URxvt*scrollstyle:          plain
URxvt*scrollBar_right:      true
URxvt*scrollTtyOutput:      true
URxvt*scrollTtyKeypress:    true
URxvt*urlLauncher:          google-chrome

e finalmente meu vimrc

set nocompatible
set dir=~/.vim/ " set one place for vim swap files

" vundler for vim plugins ----
filetype off

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

Bundle 'gmarik/vundle'
Bundle 'tpope/vim-surround'
Bundle 'greyblake/vim-preview'
Bundle 'Lokaltog/vim-powerline'
Bundle 'tpope/vim-endwise'
Bundle 'kien/ctrlp.vim'
" ----------------------------

syntax enable
filetype plugin indent on

" Powerline ------------------
set noshowmode
set laststatus=2
let g:Powerline_symbols = 'fancy' " show fancy symbols (requires patched font)
set encoding=utf-8
" ----------------------------

" ctrlp ----------------------
let g:ctrlp_open_multiple_files = 'tj' " open multiple files in additional tabs
let g:ctrlp_show_hidden = 1 " include dotfiles and dotdirs in ctrlp indexing

let g:ctrlp_prompt_mappings = {
    \ 'AcceptSelection("e")': ['<c-t>'],
    \ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ } " remap <cr> to open file in a new tab
" ----------------------------

set showcmd

set tabpagemax=100

set hlsearch
set incsearch
set nowrapscan

set ignorecase
set smartcase

set ruler

set tabstop=4
set shiftwidth=4
set expandtab

set wildmode=list:longest

autocmd BufWritePre * :%s/\s\+$//e "remove trailing whitespace

" :REV to "revert" file to state of the most recent save
command REV earlier 1f

" disable netrw --------------
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
" ----------------------------

Qualquer orientação sobre como fixar a linha de status seria fantástica. Encontrei um problema no github descrevendo quase exatamente o mesmo problema, mas a solução nunca foi publicada. Obrigado.


qual é a sua localidade no urxvt?
romainl

@romainl eu não definir explicitamente locale do urxvt, mas meu sistema está em en_US.UTF-8
komidore64

Respostas:


3

Parece que urxvt, pelo menos o fornecido pelos repositórios do Fedora, não pode produzir em 256 cores. Corri um colortest para verificar urxvtse não estava exibindo 256 cores. O Fedora possui um pacote separado rxvt-unicode-256colorcontendo urxvtsuporte para 256 cores.

Para instalar no Fedora, execute:

yum install rxvt-unicode-256color

O novo executável é chamado urxvt256c.

Você pode conectá-lo de i3duas maneiras diferentes,

A. modifique a i3configuração de:

bindsym $mod+Return exec i3-sensible-terminal

para

bindsym $mod+Return exec urxvt256c

ou B. modificar /usr/bin/i3-sensible-terminal(eu escolhi esta opção) adicionando urxvt256cà lista de terminais que este script consulta.

for terminal in $TERMINAL urxvt256c urxvt rxvt ... ; do

Eu escolhi a opção B porque ela torna minha i3configuração mais portátil, caso eu a instale em um sistema que não possui urxvt256c, ainda assim posso iniciar um terminal i3sem nenhum problema.


O colortestscript não funciona: ele não exibe cores, mas apenas a tabela sem cor. Provavelmente está faltando códigos de escape que foram perdidos quando colados aqui? btw: se você estiver criando urxvt a partir da fonte, certifique-se de passar --enable-256-color!
blueyed

@ blueyed, ah sim, você está correto. Parece que os códigos de escape do shell desapareceram ao colar no comentário. Fornecerei um link para o Gist.
precisa saber é o seguinte

11
Encontrei recentemente a seguinte ferramenta interessante: github.com/scizzorz/termcolors
blueyed

Se você usa o pacote Gentoo, habilite o 256-colorsinalizador USE.
Yuri
Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.