Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

Hello,

First post here, so I'll start with much deserved thanks for this great piece of software.

As I'm slowly moving my setup to Catppuccin (Frappe), of course, I wanted to have my beloved CLI FM wear that same soft suit. No available theme, no problem, let's create one! That should be fun… Well, in the beginning at least ;)

So after a few hours into this, I'm starting to have the feeling I understand less and less what I'm doing and would gratefully use a bit of help.

As I couldn't get a satisfying result with 0-255 color codes, I kept on researching. Finally found in release notes that true colors were supported, and finally that vifm.vim can generate a theme from ViM's one. So I did. First result was much better than previous tries, nice!

Then I started trying to refine the :VifmCs generated theme but somehow broke something and now, whatever modification I do, nothing seem to change.

Here is the current state of my theme writing attempt:

" Once automatically converted from Vim color scheme catppuccin-frappe

highlight clear

"" Window background / border
highlight Win guifg=#c6d0f5 ctermbg=default cterm=none
highlight OtherWin guifg=#737995 ctermbg=-1 cterm=none
" no conversion defined for AuxWin
" no conversion defined for OddLine
"highlight OddLine ctermbg=<second color>

highlight TopLine guifg=#51576e guibg=#232634 cterm=none
highlight TopLineSel guifg=#c6d0f6 guibg=#292c3d cterm=none

highlight TabLine guifg=#737995 guibg=#232635 cterm=none
highlight TabLineSel guifg=#c6d0f6 ctermbg=default cterm=none

highlight JobLine ctermfg=6 ctermbg=0 cterm=none
highlight StatusLine guifg=#c6d0f6 guibg=#292c3d cterm=none
highlight Border guifg=#232635 ctermbg=17 cterm=none

highlight CurrLine guifg=#303447 guibg=#c6d0f6 cterm=bold
"highlight OtherLine guifg=#303447 guibg=#c6d0f6 cterm=none
highlight LineNr guifg=#51576e ctermbg=default cterm=none

highlight Selected ctermfg=0 guibg=#51576e gui=bold
highlight CmpMismatch ctermfg=0 guibg=#363c53 cterm=none

highlight SuggestBox guifg=#c6d0f6 ctermbg=default cterm=none
highlight WildMenu guifg=#949cbc guibg=#3b3f53 cterm=none

highlight CmdLine guifg=#c6d0f6 ctermbg=default cterm=none
highlight ErrorMsg guifg=#e78285 ctermbg=1 cterm=bold

"" Directory and links
highlight Directory guifg=#8caaee ctermbg=default cterm=none  " Blue
highlight Executable guifg=#a6d189 ctermbg=default cterm=none "#ca9ee7 Green
highlight Socket guifg=#f4b8e5 ctermbg=default cterm=none
highlight Device guifg=#949cbc ctermbg=default cterm=none
highlight Fifo guifg=#a6d18a ctermbg=default cterm=none
highlight Link guifg=#99d1db ctermbg=default cterm=none "#ca9ee7 Teal
highlight HardLink guifg=#85c1dc ctermbg=default cterm=none " Sapphire
highlight BrokenLink guifg=#e78284 guibg=#eebebe gui=bold "#303447

" no conversion defined for User1..User9

Thanks in advance for your help and insights.
I hope I'll be able to get this in a good enough shape to be contributed back...

Have a nice one
J

1 Answer

0 votes
by

Hello,

glad to hear you're enjoying using Vifm.

I don't see anything wrong with your commands. Things you can check:

  • look for Direct color: yes in :version menu
  • check output of :messages command for errors
  • make sure you're adding the correct file (the easiest is to insert something like asdf and see if you get an error)
by

Hello,

Thank you for your answer @xaizek.

Just got back to this with the help of the ViM color_toon and xterm-color-table scripts to help… but still can't understand what is happening.
When making changes, either they're ignored, or I don't get the expected color.

Here is the output of :version:

Version: 0.14.2
Git info: built out of repository
Compiled at: May  7 2025 12:48:15

Support of extended keys is on
Parsing of .desktop files is enabled
Without GLib2 library
Without magic library
Without X11 library
Without dynamic loading of X11 library
With file program
With -n option for cp and mv
With remote command execution

Terminal name: tmux-256color
Max colors: 256
Max color pairs: 65536
Extended colors: present
RGB: -1
Direct color: no

Preview cache size: 0 B
Color pairs in use: 18 

Those RGB: -1 and Direct color: no of course look suspicious but I shamely have to admit I don't know what to do with this.

BTW, I'm running Debian Testing (Kali Rolling), and my terminal emulator is either Kitty (xterm-kitty) or Alacritty (xterm-256color), with or without tmux (tmux-256color). All combos have COLORTERM=truecolor.
ViFM is installed with Homebrew:

➜  brew info vifm
==> vifm: stable 0.14.2 (bottled), HEAD
Ncurses-based file manager with vi-like keybindings
https://vifm.info/
Installed
/home/linuxbrew/.linuxbrew/Cellar/vifm/0.14.2 (64 files, 4.3MB) *
  Poured from bottle using the formulae.brew.sh API on 2025-05-13 at 13:49:22
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/v/vifm.rb
License: GPL-2.0-or-later
==> Dependencies
Build: mandoc ✔
Required: ncurses ✔
==> Options
--HEAD
        Install HEAD version
by

Looks like 24-bit colors haven't been working for you at all.

COLORTERM=truecolor has no effect, only $TERM is taken into account by curses.

Inside of tmux, you need tmux-direct (if only for Vifm via a function/alias). Outside of tmux, try alacritty-direct for Alacritty, don't see an analog for Kitty (you can try just with tmux-direct first in case tmux can do without appropriate $TERM outside of it).

Even without use of true colors you want to use alacritty inside Alacritty, see the top of https://github.com/tmux/tmux/wiki/FAQ.

by

Hello @xaizek

Thank you so much, those *-direct TERM settings solved it!

Here are the settings I added:

  • Alacritty
[env]
TERM = "alacritty-direct"
  • Kitty
term kitty-direct
  • tmux
# Detect the correct TERM value for new sessions.
# https://chadaustin.me/2024/02/tmux-config/
# if-shell uses /bin/sh, so bashisms like [[ do not work.
if "[ $(tput colors) = 16777216 ]" {
  set -g default-terminal "tmux-direct"
} {
  if "[ $(tput colors) = 256 ]" {
    set -g default-terminal "tmux-256color"
  } {
    set -g default-terminal "tmux"
  }
}

# https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
# tmux must be told that the terminal outside supports RGB colour.
# This is done by specifying the RGB or Tc terminfo(5) flags. RGB is the official flag,
# Tc is a tmux extension.
# tmux 3.2 and later
set -sa terminal-features ",*-direct:RGB"
set -sa terminal-features ",*-256color:RGB"
# any tmux version
#set -sa terminal-overrides ",*-direct:RGB"
#set -sa terminal-overrides ",*-direct:Tc"

Now to see if I can make something nice with that...
Thanks again for your help
Have a good one and take care

...