mcchrish / nnn.vim

File manager for vim/neovim powered by n³
BSD 2-Clause "Simplified" License
646 stars 25 forks source link

Colors in nnn.vim don't seem to work always #170

Open sedimentation-fault opened 1 year ago

sedimentation-fault commented 1 year ago

How to set colors in nnn.vim

I've had to spend days(!) to find out how to set some colors in nnn.vim. One problem is that documentation about them is so hard to find, so let me put some information here for anyone with the same problem:

Highlights nnn-hl

The following are the highlight groups that are used:

NnnNormal Window. Linked to |hl-Normal|.

NnnNormalNC Non-current window. Linked to |hl-Normal|.

NnnNormalFloat Floating window. Linked to |hl-Normal|.

NnnBorder Floating window border. Linked to |hl-FloatBorder| or |hl-Comment|.

NnnVertSplit (depecated. for < nvim-0.7) Explorer window VertSplit. Linked to |hl-VertSplit|. NnnWinSeparator Explorer window WinSeparator. Linked to |hl-WinSeparator|. (requires nvim-0.7 and above). The above is from https://github.com/mcchrish/nnn.vim/blob/e0104e369508fc12e3651ad4dee20261b5b3e87f/doc/nnn.txt#L276

, so let's try it:

In my /etc/vim/vimrc.local I have:

let g:nnn#layout = { 'window': { 'width': 0.9, 'height': 0.6, 'highlight': 'StatusLineNC' } }
let NNN_COLORS='#b4c77b9b;5384'
let g:nnn#command='nnn -C'
highlight NnnNormalNC guibg=#C8AE95 ctermbg=darkgrey ctermfg=white
highlight NnnNormalFloat guibg=#4992A7 guifg=white ctermbg=cyan ctermfg=white

The above works only partially for me:

How to reproduce

Use the above settings and try to set colors.

Expected behavior

Consistent, trouble-free user experience regarding colors.

Environment:

sedimentation-fault commented 1 year ago

FWIW I also have

BLK="0B" CHR="0B" DIR="04" EXE="06" REG="00" HARDLINK="06" SYMLINK="06" MISSING="00" ORPHAN="09" FIFO="06" SOCK="0B" OTHER="06"
export NNN_FCOLORS="$BLK$CHR$DIR$EXE$REG$HARDLINK$SYMLINK$MISSING$ORPHAN$FIFO$SOCK$OTHER"

(taken from https://github.com/sigmavim/vimrc) in my ~/.bashrc.