Vim colors in xterm

I really like coding in vim, but with the current vim package in Arch Linux, the colors don't seem to work in all cases. In a standard xterm, the colors in the directory listings are working fine, but when I start vim, it only uses bold and underline and no color whatsoever.
I tried some different terminals, and gnome-terminal has the same problem. But the colors were working fine in aterm and Eterm! Now I don't really like the last two because they are slower, uglier, have all kinds of features I don't use, and the text is flickering when I move the window.
I used to use Slackware and vim colors were working fine in xterm there. Would anybody know what could be wrong with my setup?

Heh, it's one of those things you pick up somewhere.  Seriously, I usually use either rxvt or atem.  Xterm doesn't do color, I don't know why or how I found out about it.  I probably went to deja (now google.groups, I think, I still type deja) and did a search or something.
There are things you pick up somewhere--for example (I was complaining about this to a friend recently, when we were talking about poor documentation) most folks know that kill -1 or killall -SIGHUP restarts most processes (though not all). However, the Linux and FreeBSD man pages don't mention this, they simply say it terminates a process--OpenBSD, which often has better (imho) man pages do mention in passing that it will cause a process to reread its config file (in the example they mention, inetd).
Your attitude is admirable.  It's probably in some document somewhere, you could try doing apropos colors--which, in FreeBSD (where I'm writing this) gives about 15 different possible man pages.

Similar Messages

  • [SOLVED] Vim color scheme

    Hello! This is my first post and I'm new with Archlinux, sorry if this trouble is very simple but I'm a newbie...
    The question... Vim color scheme only works fine when I use sudo or when I'm root...
    I've put the color scheme in /usr/share/vim/vim73/colors and in ~/.vim/colors, and I've configured /etc/vimrc and ~/.vimrc
    I don't know what's wrong...
    Correct color scheme (with sudo):
    Wrong color scheme (normal user):
    Thank you very much!!
    Last edited by Midnith (2012-03-27 11:58:48)

    Hi again!
    Kaustic wrote:
    There's your problem. xterm (as indicated by tput) only supports 8 colours.
    If you're using Konsole, check the configuration and change the session to xterm-256color. Alternatively can set the environment variable within your ~/.bashrc file like so: export TERM=xterm-256color
    It works! Thank you very much and sorry for the inconveniece
    Kaustic wrote:
    (PS: To list all the terminals you can use with 256 colours try the following command: (Iirc there was a cleaner way to do this, but alas)
    ls /usr/share/terminfo/*/* | grep 256
    The output:
    /usr/share/terminfo/E/Eterm-256color
    /usr/share/terminfo/d/darwin-256x96
    /usr/share/terminfo/d/darwin-256x96-m
    /usr/share/terminfo/g/gnome-256color
    /usr/share/terminfo/k/konsole-256color
    /usr/share/terminfo/m/mlterm-256color
    /usr/share/terminfo/m/mrxvt-256color
    /usr/share/terminfo/p/putty-256color
    /usr/share/terminfo/r/rxvt-256color
    /usr/share/terminfo/s/screen-256color
    /usr/share/terminfo/s/screen-256color-bce
    /usr/share/terminfo/s/screen-256color-bce-s
    /usr/share/terminfo/s/screen-256color-s
    /usr/share/terminfo/v/vte-256color
    /usr/share/terminfo/x/xnuppc+256x96
    /usr/share/terminfo/x/xnuppc-256x96
    /usr/share/terminfo/x/xnuppc-256x96-m
    /usr/share/terminfo/x/xterm+256color
    /usr/share/terminfo/x/xterm-256color
    How I put xterm-256color by default?

  • How to turn off mouse (or touchpad) scrolling when running vim in an xterm?

    Just updated 13" macbook pro (mid-2010) from Snow Leopard (10.6.8) to Yosemite (10.10.1).  Previously, when running vim in an xterm, scrolling with the touchpad did nothing inside vim, it just scrolled the xterm history back so I could see what I had done before executing vim.  Now, the same scrolling action (either with touchpad or with an external mouse with scrollwheel) moves the cursor position inside vim (if I'm in navigate mode).  I want to turn this feature off.  I'm sure some people like it but I do not.  Anyone know whether this is something to be blocked by vim settings, or perhaps something in the xterm settings I need to change?  Vim version is 7.3 (2010 Aug 15), which must be a slightly later version than I had under the original operating system, since I got it July 2010. 
    I've tried modifying various vim settings, but to no effect.  I haven't found a comprehensive list of such settings to try systematically. 

    While I do not have Yosemite up and running at the moment, I cannot actually play with Yosemite Terminal.app.  But you should at least look through the various Terminal -> Preferences to see if there is any configuration option that is telling the Terminal how to treat scroll operations.  And try things like changing the "Declare terminal as: ............." setting, as that may affect the Terminfo database entry, which Vim uses to decide on what it does with various keyboard escape keys for input as well as displaying output (not sure if that would affect scrolling input, but it is worth a shot).
    Instead of using X11 and xterm, consider giving iTerm a try.  I have been using as my terminal emulator for years, and at work I live in terminal sessions, ssh'ed into various Linux, Solaris, AIX platforms.
    <http://iterm2.com>  A newer version
    <http://iterm.sourceforge.net> an older but still viable version (I used this on my Snow Leopard 10.6.8 system)
    iTerm will give you Tabbed windows just like Terminal (actually had Tabbed windows years before Terminal.app).  It will allow you to define what a double-click selection thinks is a word.  It has an option to automatically load anything selected into the copy/paste buffer.
    NOTE:  I have nothing against X11 and xterm.  I also use X11 (XQuartz) all day as well as terminal sessions, with various Linux, Solaris, AIX X11 displays being sent back to my iMac at work, frequently using gvimdiff.

  • [SOLVED] vim can't use colorscheme from ~/.vim/colors

    Hello
    I wanted to use the Molokai Theme for vim. So I downloaded molokai.vim from http://www.vim.org/scripts/script.php?script_id=2340 Copied it to ~/.vim/colors folder. In vim I enter :colorscheme molokai.vim but it can't find it.
    Also install molokai-vim from AUR but still. E185: Cannot find color scheme 'molokai.vim'
    Any thoughts?
    Last edited by blackout23 (2013-04-01 08:15:38)

    I'm sure I tried it with and without extension and it didn't work.
    However after creating a .vimrc (didn't have one before) according to this:
    http://dthettich.tumblr.com/post/131989 … rc-molokai
    It worked.
    @WonderWoofy
    The AUR package installed it into that directory.
    Thanks to all!

  • Converting Colors in Xterm?

    N00bie here. The title may be confusing, but what I'm trying to ask is there a way to change a color in xterm? For example, I want the color black to look white(I don't want these specific colors though). I want to do this because irssi doesn't let you choose between a lot of colors.

    ArchLunix wrote:N00bie here. The title may be confusing, but what I'm trying to ask is there a way to change a color in xterm? For example, I want the color black to look white(I don't want these specific colors though). I want to do this because irssi doesn't let you choose between a lot of colors.
    xterm recognizes a palette change escape sequence as noted here:
    http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
    in the paragraph beginning "Xterm maintains a color palette whose entries are identified by an index beginning with zero"

  • Terminal colors vs Vim colors [SOLVED]

    Hey guys!
    I've been using vim since the very first day I started learning programming, and am now using it on my brand new arch system. Everything works really well so far, but I'm having a bit of trouble customizing colors. I wouldn't normally make a big deal out of it, but since I'm going to spend an enormous amount of hours using it for school and personnal projects, I'd really like to get all my colors right. I'm using an urxvt terminal, under awesome wm.
    Here are my 16 terminal colors:
    http://tinypic.com/r/2yper6b/5
    Here is what my vim loks like:
    http://tinypic.com/r/s1547k/5
    As you can see, vim uses a crap-looking, brownish-red color for line numbers and html tags. This color is not in any of the 16 I specified in .Xresources. I don't know where it comes from, but I would like for vim to use only these 16 colors. Is that possible? I assume it is, because most of my vim colors are changed whenever I edit them in .Xresources.
    If not, I'd like to know how I can edit the colors vim uses myself. Thank you for reading!
    Last edited by PolyBender (2013-05-12 00:35:41)

    You select a colorscheme (:help colorscheme) in your vimrc.  The themes can use 256 colors, which I find nice once I customized the theme/scheme.  But if you want to limit it to 16, just `set t_Co=16` in your vimrc.

  • Vim color glitch using Xterm

    Hello,
    I recently started to use Xterm rather than urxvt, and there's a weird glitch when using vim. I have cursorline enabled, so the background of the cursor line is a different color from the regular background, and I used this config in urxvt and termite and it works properly. However, in Xterm, when I scroll down, the cursor line leaves a "trace" on the background where there is no text.
    http://i.imgur.com/9CO522D.png
    This is a screenshot of the issue I'm having, and I am using vim to edit my colorscheme file, urxvt is on the left and xterm is on the right. As I said, this colorscheme gave me no problems on urxvt and termite, but in case I'm missing something I thought I might as well show it.
    Also, the comments in the colorscheme file shouldn't have a separate background either, and they don't in urxvt, and there shouldn't be yellow highlighting on '=dar' at the top of the colorscheme file. I don't understand why there can be so many differences from terminal to terminal.
    Can anyone help me fix this?
    Thanks,
    wadawalnut
    -- mod edit: read the Forum Etiquette and only post thumbnails http://wiki.archlinux.org/index.php/For … s_and_Code [jwr] --

    Does the problem occur with other vim colorschemes? Perhaps we can eliminate the colorscheme and any .vimrc configurations or plugins as the source of the problem.
    You can create a very basic .vimrc file, perhaps naming it basic.vim
    set nocompatible
    filetype plugin on
    set t_Co=256
    syntax on
    Start vim using basic.vim instead of your .vimrc:
    $ vim -u basic.vim <file_to_edit>
    Vim should open with the default colorscheme. Then add cursorline highlighting and see if the problem exists.
    :se cul
    If the graphical glitch is there, you've pretty much eliminated your .vimrc as the source of the problem. If the "tracing" problem isn't there, change to a colorscheme where you know it has previously occurred.
    :colo <my_colorscheme>
    Try editing different filetypes to make sure the problem isn't a filetype or syntax plugin.
    Edit: Ctrl+l, (Control plus lowercase L) should refresh the screen in vim.
    Last edited by thisoldman (2015-03-08 18:47:05)

  • Why are the colors in XTerm (x11) and Apple's terminal are different?

    Is there a way to fix this? I would like Apple's terminal to look like XTerm...
    the screenshot on the left is X11, and the screenshot on the right is Apple's terminal:

    Patrick Collins wrote:
    The "Pro" setting and the others are nothing more than settings for background and foreground text. Not the actual ANSI colors found when you do a colorized LS, or syntax highlighting in editors like vim.
    So, that is my question, why are these two terminals interpreting colors differently? Where can I FIX what it thinks "blue" is, etc?
    OK. I get it now. Apple's blue isn't blue enough I guess. Apparently people have been up in arms over this for years. I guess I missed it.
    This hack: http://ciaranwal.sh/2007/11/01/customising-colours-in-leopard-terminal
    is supposedly working in 10.6.4 now.

  • [solved] vim color scheme not working in urxvt/screen

    i'm using the 256 color scheme inkblot in vim.  It works great in urxvt alone.  But the background is messed up in screen.  Screen is able to display 256 colors.
    Basically, the background it is supposed to set ends up being set for every line in which there is no text, while the lines that have text have an all black background.   This doesn't happen outside of screen or in other 256 color enabled terminals.
    This happens with every theme that sets a background (or more specifically an off-black/dark-grey background.. i haven't tried a theme that tries another color background).
    Last edited by scv5 (2009-06-20 20:15:35)

    add "term screen-256color" to your .screenrc, that's the cleanest approach
    That probably won't be enough for urxvt, see this thread for more information http://bbs.archlinux.org/viewtopic.php?id=50647

  • [Solved] ViM colors

    How do I have a ViM colorscheme inherit the background colour that is prescribed in Xresources?---Ideally there would be a command like
    hi Normal ctermfg=$XFGLOL ctermbg=$XBG_LOL
    Last edited by tomgg (2013-12-24 03:40:46)

    Glad that worked, please remember to mark the thread as [SOLVED] by clicking "edit" on the first post.

  • A vim color scheme which imitates ArchLinux Mousepad cobalt

    I like ArchLinux Mousepad cobalt scheme, and I am a vim user. So I made a copy for vim.
    Hopefully this scheme added to official repository.
    Download here: http://www.vim.org/scripts/script.php?script_id=5022
    Last edited by jasonwryan (2014-11-10 20:24:51)

    Moving to Community Contributions...

  • [SOLVED] vim color highlighting not correctly displayed in vc/tty

    For instance visual selection is set up to change fg/bg to black/green but changes fg to green. Under x using urxvt it displays correctly.
    Last edited by Noble (2010-07-26 21:22:19)

    I have written my own syntax highlight theme, post below. If you think your script could do anything about it after looking at the file please post But as I said, vim works fine in urxvt, but not when I switch out of X and run it in the vc/tty.
    :set statusline=#%n\ %y\ %F\ %r\ %=%c\ %l/%L
    :set hlsearch
    :set nocompatible
    :set noexrc
    :set number
    :syntax enable
    :set autochdir
    :set backup
    :set backupdir=~/.vim/backup
    :set directory=~/.vim/tmp
    :set autoindent
    :set ruler
    :set nowrap
    :set nocp
    :set scrolloff=5
    :set sidescrolloff=5
    :set fileformats=unix,dos,mac
    :set title
    :set laststatus=2
    :set tabstop=4
    :set autoread
    :set showcmd
    :set showmatch
    :set shiftwidth=4
    :set smarttab
    :set backspace=indent,eol,start
    filetype on
    filetype plugin on
    filetype indent on
    hi clear
    set background=dark
    if exists("syntax_on")
    syntax reset
    endif
    highlight ErrorMsg ctermfg=red ctermbg=none cterm=bold
    highlight WarningMsg ctermfg=red ctermbg=none cterm=bold
    highlight VertSplit ctermfg=green ctermbg=black
    highlight Folded ctermfg=magenta ctermbg=none
    highlight FoldColumn ctermfg=magenta ctermbg=none
    highlight FoldColumn ctermfg=magenta
    highlight LineNr ctermfg=green cterm=bold
    highlight ModeMsg ctermfg=lightgreen cterm=bold
    highlight MatchParen ctermfg=black ctermbg=green
    highlight Normal ctermfg=white ctermbg=none
    highlight SignColumn ctermfg=magenta
    highlight NonText ctermfg=blue
    highlight Question ctermfg=red cterm=bold
    highlight Comment ctermfg=8
    highlight Constant ctermfg=green cterm=none
    highlight Identifier ctermfg=white cterm=bold
    highlight Statement ctermfg=lightgreen cterm=bold
    highlight PreProc ctermfg=10
    highlight Type ctermfg=2
    highlight Special ctermfg=cyan
    highlight Error ctermfg=red ctermbg=none
    highlight Todo ctermfg=yellow ctermbg=none cterm=bold
    highlight StatusLine ctermfg=black ctermbg=green cterm=none
    highlight StatusLineNc ctermfg=black ctermbg=lightgreen cterm=none
    highlight Directory ctermfg=white
    highlight Search ctermfg=black ctermbg=green cterm=none
    highlight Visual ctermfg=black ctermbg=lightgreen
    highlight WildMenu ctermfg=black ctermbg=cyan cterm=none
    highlight Pmenu ctermfg=black ctermbg=green
    highlight PmenuSel ctermfg=black ctermbg=lightgreen cterm=none

  • Changing Konsole font colors a la xterm

    Hello.  I'm not a big fan of the default font colors that Konsole uses for things such as directories, exexecutables, strings, vim syntax highlighting etc.  I was wondering how to go about getting the same font colors in konsole that I can for say aterm (by configuring the .Xdefaults file with the appropriate font colors...)  Any ideas would be much appreciated.  Thanks!!

    I resolved this issue.  In Konsole there is a schema type of 'Vim colors'  that will allow you to utilize the xterm color settings in the .Xdefaults file.

  • [SOLVED] xterm colors differ from any other TTY

    Hello,
    I have a bit of a problem concerning the colors in xterm. To illustrate the difference between the colors in any other TTY (Gnome terminal in this case) and the colors in xterm, let me show you an alsa restart:
    *snip*
    You might say that I have been tinkering with the color palette of xterm, but I haven't. I've tried to restore the colors to default but it doesn't seem to help, which is pretty logical since they should be set to default.
    Is this a known issue? What can be done about it?
    Thanks in advance!
    SOLUTION:
    Instead of starting xterm with "xterm -rv", I use "xterm -bg black -fg white". The -rv option somehow messes things up for bold text, and the -bg/fg options seem to do the trick.
    Last edited by whordijk (2010-06-19 09:17:16)

    SamC wrote:Looks like something to do with bold text. Could you post your .Xdefaults?
    I would, but I'm affraid both my useraccount and the root account don't have a .Xdefaults file. I thought it was only used if you'd wish to change the default X settings, so I figured: no .Xdefaults = default X settings.
    EDIT:
    I found out it has got something to do with the swapping of colors: I use "xterm -rv" to get a white-on-black terminal, look at what I get when I start a non-video-reversed xterm:
    EDIT:
    Fixed!
    Last edited by whordijk (2008-12-13 18:28:30)

  • [SOLVED] How to convince vim my terminal supports color?

    Hi. I recently got a shell account from Kaitocracy on his linode machine. I noticed that my bash prompt has color, as expected, but when I copied over my vim configuration (which includes a color theme), it didn't work! After some toying around, I noticed that vim recognizes the terminal escape codes using `:hi <type> start= stop=`, but not the existing `cterm` commands in my color theme. To make things more confusing, I know my terminal (urxvt) is capable of using the cterm flags.
    Also, Ctrl+L does not clear/redraw the screen as expected.
    What can I do to fix these issues? Here are the configs:
    ~/.vimrc:
    " No vi compatibility; strictly vim here.
    set nocompatible
    " Don't source /etc/vimrc
    set noexrc
    " My background is always black
    set background=dark
    " The mouse is helpful every now and then...
    set mouse=a
    " I'm a Linux user
    set fileformats=unix,dos,mac
    " Search while I type
    set incsearch
    " The blinking pisses me off
    set novisualbell
    " Line numbers are key to debugging
    set number
    set numberwidth=5
    " My tabs are 4 characters long
    set tabstop=4
    set softtabstop=4
    " Indention is also 4 characters
    set shiftwidth=4
    " Normally, I don't want tabs converted to spaces.
    set noexpandtab
    " Syntax highlighting is a staple :D
    syntax on
    " I want liberal use of hidden buffers, just in case.
    set hidden
    set laststatus=2
    " filename, filetype, readonly flag, modified flag line #, column #, %age of file length, hex value of byte under cursor.
    " Ex: .vimrc [vim][+] 48,22 55% hex:20
    set statusline=%f\ %y%r%m\ %l,%c\ %P\ hex:%B
    set noai
    " I can see where tabs and line endings are
    set listchars=tab:▸\ ,eol:¬
    " This turns on the config above; I can turn it off with :set nolist
    set list
    " I want wordwrap on, coupled with sane line-breaking. This will not work when :set list is active.
    set wrap
    set lbr
    " My color scheme is pwn
    colorscheme sporkbox
    filetype indent on
    if has("autocmd")
    " enable filetype detection
    filetype on
    " I want to convert tabs to spaces to adhere to PEP 8.
    autocmd FileType python setlocal ts=4 sts=4 sw=4 expandtab
    endif
    " \l toggles invisibles
    nmap <leader>l :set list!<CR>
    " I like to get rid of trailing white space.
    nnoremap <silent> <F5> :call <SID>StripTrailingWhitespaces()<CR>
    " Fast window movement is important
    map <C-h> <C-w>h
    map <C-j> <C-w>j
    map <C-k> <C-w>k
    map <C-l> <C-w>l
    " Courtesy of vimcasts.org
    function! <SID>StripTrailingWhitespaces()
    " Save last search and cursor position
    let _s=@/
    let l = line(".")
    let c = col(".")
    " Do the business:
    %s/\s\+$//e
    " Restore previous search history and cursor position
    let @/=_s
    call cursor(l, c)
    endfunction
    ~/.vim/colors/sporkbox.vim:
    " Color scheme "sporkbox"
    " by Daniel Campbell <[email protected]>
    " Tab characters and EOLs should be dark gray so they don't stand out too much.
    highlight SpecialKey ctermfg=darkgray
    highlight NonText ctermfg=darkgray
    " If I'm in a mode, I want to see it.
    highlight ModeMsg ctermfg=green
    " The current file should be obvious; the others can be faded.
    highlight StatusLine ctermfg=green ctermbg=black
    highlight StatusLineFC ctermfg=darkgray ctermbg=white
    " Line numbers should be just-visible, not bright.
    highlight LineNr ctermfg=darkgray
    " Titles in Markdown
    highlight Title cterm=bold ctermfg=white
    " My splits should not be bright
    highlight VertSplit ctermfg=black ctermbg=darkblue
    highlight Comment ctermfg=darkgreen
    highlight Constant ctermfg=cyan
    highlight Identifier ctermfg=yellow
    highlight Statement ctermfg=magenta
    highlight PreProc ctermfg=lightblue
    highlight Type ctermfg=blue
    highlight Special ctermfg=lightblue
    Remote .bashrc:
    ### ~/.bashrc: Sourced by all interactive bash shells on startup
    # Set a fancier prompt
    PS1='\[\e[32;01m\]\u\[\e[m\] \[\e[36m\]\w\[\e[m\]: '
    # Turn on colors for ls and grep
    alias less='less --RAW-CONTROL-CHARS'
    alias ls='ls --color=auto'
    alias grep='grep --color=auto'
    # Set colors for ls and friends
    if [ -f ~/.dir_colors ]; then
    eval `dircolors -b ~/.dir_colors`
    elif [ -f /etc/dir_colors ]; then
    eval `dircolors -b /etc/dir_colors`
    else eval `dircolors -b`; fi
    # Compilation optimization flags
    CHOST="i686-pc-linux-gnu"
    MAKEFLAGS="-j2"
    LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=both"
    CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    FFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    CPPFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer"
    export PGHOST="private1.kiwilight.com"
    export PS1 CHOST MAKEFLAGS LDFLAGS CFLAGS FFLAGS CXXFLAGS
    To make matters more confusing, my vim theme works when I connect to the linode in a GNU screen session, but not when it's a straight-up terminal.
    Last edited by xelados (2010-04-25 00:34:44)

    Mr.Elendig wrote:Make sure you are using rxvt-unicode-256color and that your TERM is rxvt-256color outside of screen, and screen-256color inside of screen.
    That's the peculiarity of the problem; when I run vim in my local environment, I always get color using the `:hi <hilighttype> ctermfg=* ctermbg=*` commands. This applies inside of X through rxvt-unicode (non-256color), GNU screen, and on the plain command line in vc1. This issue seems to be related to the remote environment and/or variables not being sent through ssh.
    @moljac: When I echo'd TERM inside a screen session, it returned "screen", so I don't know whether it's legit or not.
    Last edited by xelados (2010-04-24 11:47:52)

Maybe you are looking for

  • Issues Configure MS SQL 2012 RS (SharePoint Integrated Mode) in SharePoint 2010

    Dear All, Can someone guide how to troubleshoot this error. Application Server : Slipstreamed Version of SharePoint 2010 SP2 + Window Server 2012 + Configure RS (RS is in SQL Server 2012 SP2) as per - http://technet.microsoft.com/en-us/library/jj2190

  • Botched file type/application associations...

    I'm not a Mac guy. I've been extremely lucky when helping my client that I have been able to solve their connectivity/networking problems even though I'm not at all proficient with a Macintosh computer, a testament to how intuitive the Mac really is.

  • LaserJet will not correctly print Statement (5.5 in. by 8.5 in.) ((Alignment off))

    Not sure if it's a driver problem, but the printer keeps printing the statement size as though it were loaded on the left of the tray. So it basically prints off the page. When I try to get around this issue by loading the paper on the left in the mi

  • Using workflow to email and fax output documents

    The requirement is that everytime an output is triggered for a document, the document should be emailed and/or faxed to certain contacts that are maintained on the customer master. Currently you can only email or fax to one contact at a time but we w

  • How to display query result like this

    I got a query...gives list of names. i want to display 11.  Peter 12. Jessica 32. Leo 15. Jamie 36. Edward how i get static number infront of my query result. static number is not in order.