Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

It seems to me that it is terribly unfortunate that there isn't more highlight groups. As in for images, audio, documents, etc. etc. Using the dircolors converter just gives the same results as editing one of the colorschemes, very limited. Is there any plans for adding more in the future? Otherwise seems like a really fantastic program. I just rely heavily on colors to tell at a glance what the filetype is.

1 Answer

0 votes

You mean highlight like this one
enter image description here

It might be that your dircolors aren't set for the filetypes you're using.

Using :highlight command with patterns (comma-separated in curly braces or regular expression between /) you can define arbitrary groups youself.

Some examples:

        \ cterm=none ctermfg=187 ctermbg=default
highlight {Makefile,Makefile.am,Makefile.in,Makefile.win,*.mak,*.mk,CMakeLists.txt}
        \ cterm=none ctermfg=121 ctermbg=default
highlight {*.7z,*.ace,*.arj,*.bz2,*.cpio,*.deb,*.dz,*.gz,*.jar,*.lzh,*.lzma,*.rar,*.rpm,*.rz,*.tar,*.taz,*.tb2,*.tbz,*.tbz2,*.tgz,*.tlz,*.trz,*.txz,*.tz,*.tz2,*.xz,*.z,*.zip,*.zoo}
        \ cterm=none ctermfg=215 ctermbg=default
highlight {*.djvu,*.htm,*.html,*.shtml,*.php,*.css,*.markdown,*.md,*[^0-9].[1-9],*.mkd,*.org,*.pandoc,*.pdc,*.pdf,*.epub,*.tex,*.txt,*.xhtml,*.xml,*.pptx,*.ppt,*.doc,*.docx,*.xls,*.xls[mx]}
        \ cterm=none ctermfg=218 ctermbg=default
highlight {*.aac,*.anx,*.asf,*.au,*.avi,*.ts,*.axa,*.axv,*.divx,*.flac,*.m2a,*.m2v,*.m4a,*.m4p,*.m4v,*.mid,*.midi,*.mka,*.mkv,*.mov,*.mp3,*.mp4,*.flv,*.mp4v,*.mpc,*.mpeg,*.mpg,*.nuv,*.oga,*.ogg,*.ogv,*.ogx,*.pbm,*.pgm,*.qt,*.ra,*.ram,*.rm,*.spx,*.vob,*.wav,*.wma,*.wmv,*.xvid,*.ac3}
        \ cterm=none ctermfg=49 ctermbg=default
highlight {*.bmp,*.gif,*.jpeg,*.jpg,*.ico,*.png,*.ppm,*.svg,*.svgz,*.tga,*.tif,*.tiff,*.xbm,*.xcf,*.xpm,*.xspf,*.xwd}
        \ cterm=none ctermfg=117 ctermbg=default
highlight {*.bat,*.btm,*.cmd,*.com,*.dll,*.exe,*.run,*.msu,*.msi,*.sh,*.bash}
        \ cterm=none ctermfg=77 ctermbg=default
highlight {*.patch,*.diff,*.py,*.[ch]pp,*.mk,*.c,*.h,*.[ch]pp,*.cc,*.hs}
        \ cterm=none ctermfg=193 ctermbg=default

Thank you so much for that! I must've somehow missed it in the colorscheme area of the wiki. However my dircolors are extremely complete and colors all of them correctly in my terminal emulator without vifm open.

I should note though, that I set them up in ~/.config and perhaps it can't find them there? I don't mind having to redo them for the colorscheme, but it would definitely be more convenient if they worked.


Check output of :echo $VIFM command in vifm. Color scheme is looked up in $VIFM/colors. And check :colorscheme?.

Also maybe try adding :colorscheme Default to vifmrc, if you put output of the script into Default file. If color scheme isn't saved in vifminfo and not set via :colorscheme, the builtin is used (maybe it's worth changing).


Apologies for that poorly worded comment. I meant I set my dircolors in .config not in my home directory. I had already edited and saved a colorscheme that it came with in the vimrc. That wasn't my issue either.

However after trying your example, I decided to take another took at my dircolors and turns out I may have set them up incorrectly? I put * before each extension then ran the dircolors converter again, and this time it worked. And I didn't have to redo the whole thing into the colorscheme format, so that was nice.

Thanks again for the help.