You are not logged in.

#1 2013-08-28 07:07:16

nullwiz
Member
Registered: 2013-08-23
Posts: 53

[SOLVED]Vim dosnt recognize 256color urxvt

I want to use rxvt as console, but vim says it dosnt have 256color support.
I downloaded the package rxvt-unicode from the repos, also did some tweaking to .Xresources.
If I execute urxvt and try to use the theme 'xoria256.vim' for vim, it says its not supported.
The output of echo $TERM is : rxvt
Im also having a hard time making urxvt recognize my font..

This is the .Xresources file :

URxvt.font:	     xft:Terminus:pixelsize=20:antialias=false
URxvt.boldFont:         xft:Terminus:bold:pixelsize=14:antialias=false

!black.normal        : xoria256.LineNr.guibg
!black.bright        : black.normal.rgb - 8
#define _color0        #121212
#define _color8        #0a0a0a

!red.normal          : red.bright.r - 8
!red.bright          : xoria256.Special.guifg
#define _color1        #d78787
#define _color9        #df8787

!green.normal        : green.bright.g - 8
!green.bright        : xoria256.PreProc.guifg
#define _color2        #afd787
#define _color10       #afdf87

!yellow.normal       : yellow.bright.rg - 8
!yellow.bright       : xoria256.Special.guifg
#define _color3        #f7f7af
#define _color11       #ffffaf

!blue.normal         : blue.bright.b - 8
!blue.bright         : xoria256.Statement.guifg
#define _color4        #87afd7
#define _color12       #87afdf

!magenta.normal      : magenta.bright.rb - 8
!magenta.bright      : xoria256.Identifier.guifg
#define _color5        #d7afd7
#define _color13       #dfafdf

!cyan.normal         : cyan.bright.gb - 8
!cyan.bright         : green.bright + blue.bright
#define _color6        #afd7d7
#define _color14       #afdfdf

!white.normal        : white.bright.rgb - 8
!white.bright        : xoria256.Folded.guifg
#define _color7        #e6e6e6
#define _color15       #eeeeee

!bold                : xoria256.Type.guifg
!underline           : xoria256.htmlValue.guifg
#define _colorBD       #afafdf
#define _colorUL       #dfdfaf

!foreground          : xoria256.Normal.guifg
!background          : xoria256.Normal.guibg
!cursorColor         : xoria256.Cursor.guibg
#define _foreground    #d0d0d0
#define _background    #1c1c1c
#define _cursorColor   #ffaf00

URxvt*color0         : _color0
URxvt*color1         : _color1
URxvt*color2         : _color2
URxvt*color3         : _color3
URxvt*color4         : _color4
URxvt*color5         : _color5
URxvt*color6         : _color6
URxvt*color7         : _color7
URxvt*color8         : _color8
URxvt*color9         : _color9
URxvt*color10        : _color10
URxvt*color11        : _color11
URxvt*color12        : _color12
URxvt*color13        : _color13
URxvt*color14        : _color14
URxvt*color15        : _color15
URxvt*colorBD        : _colorBD
URxvt*colorIT        : _colorIT
URxvt*colorUL        : _colorUL
URxvt*foreground     : _foreground
URxvt*background     : _background
URxvt*cursorColor    : _cursorColor

XTerm*color0         : _color0
XTerm*color1         : _color1
XTerm*color2         : _color2
XTerm*color3         : _color3
XTerm*color4         : _color4
XTerm*color5         : _color5
XTerm*color6         : _color6
XTerm*color7         : _color7
XTerm*color8         : _color8
XTerm*color9         : _color9
XTerm*color10        : _color10
XTerm*color11        : _color11
XTerm*color12        : _color12
XTerm*color13        : _color13
XTerm*color14        : _color14
XTerm*color15        : _color15
XTerm*colorBD        : _colorBD
XTerm*colorIT        : _colorIT
XTerm*colorUL        : _colorUL
XTerm*foreground     : _foreground
XTerm*background     : _background
XTerm*cursorColor    : _cursorColor

Last edited by nullwiz (2013-08-29 00:37:12)

Offline

#2 2013-08-28 07:49:08

bleach
Member
Registered: 2013-07-26
Posts: 264

Re: [SOLVED]Vim dosnt recognize 256color urxvt

is .Xresources being used or .Xdefaults? also why is it outputting rxvt? I am not sure how .Xresources handles # but is that not commenting out those lines? maybie do a pacman -S rxvt-unicode which I believe is built with 256 color.

Offline

#3 2013-08-28 10:06:51

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED]Vim dosnt recognize 256color urxvt

You are setting $TERM to "rxvt".  The vanilla Arch rxvt-unicode should report $TERM as "rxvt-unicode-256color".  Try:

$ urxvt -tn rxvt-unicode-256color

@bleach, Comments in X resource files are lines that begin with exclamation points, '!'.  The '#' lines function like preprocessor lines in C.  I have my X resources separated into several files and then use '#include file' statements in '~/.Xresources' to have those files read.

Offline

#4 2013-08-28 10:22:24

Šaran
Member
From: Bosnia
Registered: 2011-09-03
Posts: 407

Re: [SOLVED]Vim dosnt recognize 256color urxvt

Just install rxvt-unicode-terminfo from Community.

Offline

#5 2013-08-28 14:50:03

nullwiz
Member
Registered: 2013-08-23
Posts: 53

Re: [SOLVED]Vim dosnt recognize 256color urxvt

thisoldman wrote:

You are setting $TERM to "rxvt".  The vanilla Arch rxvt-unicode should report $TERM as "rxvt-unicode-256color".  Try:

$ urxvt -tn rxvt-unicode-256color

@bleach, Comments in X resource files are lines that begin with exclamation points, '!'.  The '#' lines function like preprocessor lines in C.  I have my X resources separated into several files and then use '#include file' statements in '~/.Xresources' to have those files read.

Where am I setting that? Even if I start urxvt with that command, I still get that's not supported

@Šaran its installed
@bleach yeah i believed so too

Offline

#6 2013-08-28 22:51:46

bleach
Member
Registered: 2013-07-26
Posts: 264

Re: [SOLVED]Vim dosnt recognize 256color urxvt

I have never had an issue with urxvt out of box but I have with xterm and have had to add *termName: xterm-256color. with this reasoning I wonder what would happen if you add URxvt*termname: urxvt-256color.

Last edited by bleach (2013-08-28 22:54:46)

Offline

#7 2013-08-28 23:03:34

nullwiz
Member
Registered: 2013-08-23
Posts: 53

Re: [SOLVED]Vim dosnt recognize 256color urxvt

bleach wrote:

I have never had an issue with urxvt out of box but I have with xterm and have had to add *termName: xterm-256color. with this reasoning I wonder what would happen if you add URxvt*termname: urxvt-256color.

Thanks for the reply.
I want URxvt to apply those changes, but it seems like xrdb dosnt work..
Im doing

xrdb -merge ~/.Xresources

from the user that i want to launch urxvt.
It throws

/home/nullwiz/.Xresources:1: warning: Converted [CR+LF] to [LF]
    URxvt*termname:urxvt256-color

If i erease that line, I get :

/home/nullwiz/.Xresources:1: warning: Converted [CR+LF] to [LF]
    *background: #222222

However, it seems that after an hour or so, urxvt did detect the changes to the .Xresources file (just Xresources, the terminal still dosnt support 256 colors)

Offline

#8 2013-08-29 00:25:50

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: [SOLVED]Vim dosnt recognize 256color urxvt

Are you running the Arch box remotely (or using Arch as a guest OS)?  I'm asking because CR-LF is a DOS/Windows newline while Linux uses LF only.  And terminals can act odd over SSH connections.

Does the file '/usr/share/terminfo/r/rxvt-unicode-256color' exist on your machine?   It should have been installed when urxvt was installed.

You can remove the CR+LF warnings by fixing your .Xresources file (but first make a backup).  The 'file' command probably produces output something like this:

$  file .Xresources
.Xresources: ASCII text, with CRLF line terminators

You can remove the CRs within vim by using the following command:

:set fileformat=unix

Then save the file.  That will get rid of the warnings.  For other solutions see http://www.cyberciti.biz/faq/howto-unix … xt-format/

Next, watch your spelling in .Xresources.  You misnamed the resource, it's termName, with an uppercase 'N', and there is no terminfo file for urxvt256-color.  The correct line is:

URxvt*termName: rxvt-unicode-256color

Offline

#9 2013-08-29 00:36:37

nullwiz
Member
Registered: 2013-08-23
Posts: 53

Re: [SOLVED]Vim dosnt recognize 256color urxvt

thisoldman wrote:

Are you running the Arch box remotely (or using Arch as a guest OS)?  I'm asking because CR-LF is a DOS/Windows newline while Linux uses LF only.  And terminals can act odd over SSH connections.

Does the file '/usr/share/terminfo/r/rxvt-unicode-256color' exist on your machine?   It should have been installed when urxvt was installed.

You can remove the CR+LF warnings by fixing your .Xresources file (but first make a backup).  The 'file' command probably produces output something like this:

$  file .Xresources
.Xresources: ASCII text, with CRLF line terminators

You can remove the CRs within vim by using the following command:

:set fileformat=unix

Then save the file.  That will get rid of the warnings.  For other solutions see http://www.cyberciti.biz/faq/howto-unix … xt-format/

Next, watch your spelling in .Xresources.  You misnamed the resource, it's termName, with an uppercase 'N', and there is no terminfo file for urxvt256-color.  The correct line is:

URxvt*termName: rxvt-unicode-256color

Wow, you really readed my mind.
I figured it out when I rebooted, it was just throwing errors without a reason.
That indeed was the problem.
Thanks. Marked as solved

Offline

Board footer

Powered by FluxBB