Menu

#19 different colorschemes for different TERMs

None
closed
xaizek
TUI (9)
5
2012-09-27
2010-03-21
ckester
No

Now that I know that vifm already supports 256 colors, I see a need for a related feature.

Sometimes I'm logged into a console or terminal window that DOESN'T support 256 colors. vifm's colorscheme file should provide a way to say which colors I should use in this case, while still allowing me to specify a different set of colors to use if I'm using a 256-color TERM.

In vim, for example, I can have the following in my .vimrc:

if &term =~? 'xterm-256color'
let &t_Co=256
colorscheme cgk256
else
colorscheme koehler
endif

Discussion

  • ken steen

    ken steen - 2010-03-21

    I will have to look at the vim source code to see how they check the number of colors a term can handle. Ncurses just checks if the terminal will support colors. The infocmp program will return the number of colors a term can handle but I would like to use the most portable implementation.

     
  • xaizek

    xaizek - 2012-09-27

    Hi,

    this feature request was opened long time ago and finally can be closed. The development version (which will be released as 0.7.4 soon) already supports if-else-endif statements. So you can add something like this to your vifmrc file:

    if $TERM == 'xterm'
        colorscheme colorschemeA
    else
        colorscheme colorschemeB
    endif
    
    • status: open --> accepted
    • assigned_to: ken steen --> xaizek
    • milestone: -->

    • status: accepted --> closed

     

Log in to post a comment.

MongoDB Logo MongoDB