Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

  1. #1
    Join Date
    May 2010
    Location
    London UK
    Beans
    74
    Distro
    Ubuntu 11.04 Natty Narwhal

    VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Hi,

    I'm trying to get a start with VIM, so I'm following Derek Wyatt's video tutorials. However I can't get colorschemes working in VIM for syntax highlighting.

    Clearly I'm doing something wrong, or are too dumb to use VIM (The latter is a real possibility)!!!

    I've figured out that Xterm is only running in 8 color mode, not 256 colors, so I found this HowTo which I've attempted to follow to get 256 colors working.

    http://push.cx/2008/256-color-xterms-in-ubuntu

    But even though I've installed 'ncurses-term' I don't have an Xdefault file or 'vimrc' as far as I can see.

    ~/.Xdefaults and ~/.vimrc report no files or directory.

    If I run
    $ tput colors

    I get a response of 8

    If I run

    $ echo
    $TERM

    I get xterm

    It should be
    'xterm-256color'

    I'm stuck now, can anyone help?



    How about a nice cup of tea

  2. #2
    Join Date
    May 2010
    Location
    London UK
    Beans
    74
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Okay,

    You have to manually create the:

    .Xdefaults
    .vimrc
    .xsession


    files in your home directory. I did that and then edited them with:

    Xdefaults
    Code:
    *customization: -color
    
    Xterm*termName: xterm-256color
    xsession
    Code:
    if [ -f $HOME/.Xdefaults ]; 
    
    then   xrdb -merge $HOME/.Xdefaults 
    
    fi
    But I'm still getting

    $ tput colors

    8


    $ echo $TERM

    xterm

    So, stuck again?
    Last edited by airper; June 27th, 2012 at 09:27 PM.
    How about a nice cup of tea

  3. #3
    Join Date
    Nov 2009
    Beans
    67

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Quote Originally Posted by airper View Post
    Okay,
    Code:
    *customization: -color
    
    Xterm*termName: xterm-256color
    The class name is "XTerm", not "Xterm".

  4. #4
    Join Date
    May 2010
    Location
    London UK
    Beans
    74
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Thanks and well spotted, but that still hasn't fixed the color system, I'm still in 8 color mode.

    The answer it out there somewhere.
    How about a nice cup of tea

  5. #5
    Join Date
    Nov 2009
    Beans
    67

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Quote Originally Posted by airper View Post
    Thanks and well spotted, but that still hasn't fixed the color system, I'm still in 8 color mode.

    The answer it out there somewhere.
    Is $TERM still "xterm"?

  6. #6
    Join Date
    May 2010
    Location
    London UK
    Beans
    74
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Hi,

    Yes, output from echo $TERM remain xterm and tput colors is 8

    Of course what I'm trying to do here is get VIM to run with the Desert color scheme, it obviously won't do that until XTerm is running in 256 color mode.

    As always with these little problems learning a lot though.

    the more I read and understand about VIM the more I see how powerful it is. I can understand why people spend the time and effort learning to use it properly, really awesome software.
    How about a nice cup of tea

  7. #7
    Join Date
    Nov 2009
    Beans
    67

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Quote Originally Posted by airper View Post
    Hi,

    Yes, output from echo $TERM remain xterm and tput colors is 8
    Probably your terminal database does not have xterm-256color then:
    This option specifies the name of the terminal type to be set in the TERM environment variable. It corresponds to the termName resource. This terminal type must exist in the terminal database (termcap or terminfo, depending on how xterm is built) and should have li# and co# entries. If the terminal type is not found, xterm uses the built-in list “xterm”, “vt102”, etc.

  8. #8
    Join Date
    May 2010
    Location
    London UK
    Beans
    74
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    If I run;

    find /lib/terminfo /usr/share/terminfo -name "*256*"

    I get this list, so I'm assuming here I've got xterm-256color loaded okay?


    Code:
    /lib/terminfo/x/xterm-256color
    /lib/terminfo/s/screen-256color
    /lib/terminfo/s/screen-256color-bce
    /usr/share/terminfo/x/xnuppc+256x96
    /usr/share/terminfo/x/xnuppc-256x96-m
    /usr/share/terminfo/x/xnuppc-256x96
    /usr/share/terminfo/x/xterm+256color
    /usr/share/terminfo/s/screen-256color-bce-s
    /usr/share/terminfo/s/screen-256color-s
    /usr/share/terminfo/d/darwin-256x96
    /usr/share/terminfo/d/darwin-256x96-m
    /usr/share/terminfo/g/gnome-256color
    /usr/share/terminfo/p/putty-256color
    /usr/share/terminfo/m/mlterm-256color
    /usr/share/terminfo/m/mrxvt-256color
    /usr/share/terminfo/r/rxvt-256color
    /usr/share/terminfo/r/rxvt-unicode-256color
    /usr/share/terminfo/v/vte-256color
    /usr/share/terminfo/E/Eterm-256color
    /usr/share/terminfo/k/konsole-256color
    How about a nice cup of tea

  9. #9
    Join Date
    Feb 2008
    Beans
    21

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Are you able to set it manually?

    export TERM=xterm-256color

    If that worked then your current xterm should have $TERM of xterm-256color.
    You don't want to do this all the time, but this is just to find out where the issue is...

    If that works, does manually loading your resources file work? ie open a new xterm and run this:

    xrdb -merge ~/.Xdefaults

    now during this session, all newly started xterms should have xterm-256color. If that worked then probably ubuntu is not sourcing .xsession on log-in. Maybe you can make .xsession autorun on start up?

  10. #10
    Join Date
    Nov 2009
    Beans
    67

    Re: VIM 256 Color Support Config Xdefaults - Ubuntu 12.04

    Quote Originally Posted by miggys View Post
    Are you able to set it manually?

    export TERM=xterm-256color
    Actually
    Code:
    infocmp xterm-256color
    is a more direct way of checking if the
    description exists (for most systems - there are still some that use termcap).

    The hint about .xsession sounds plausible - I generally don't use xrdb
    but rely upon setting $XAPPLRESDIR for private resource settings.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •