Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LF icons not working #21

Closed
piersolenski opened this issue Mar 23, 2022 · 6 comments
Closed

LF icons not working #21

piersolenski opened this issue Mar 23, 2022 · 6 comments

Comments

@piersolenski
Copy link

Recently my LF icons stopped working with this plugin. They still work outside of vim. Do I need to add any specific configuration to get them working again? Thanks!

@is0n
Copy link
Owner

is0n commented Mar 24, 2022

I'm not sure what could be causing this. I primarily use lf and icons work just fine for me. If you show me your config, I might be able to help out.

@piersolenski
Copy link
Author

Icons:

#!/bin/bash

export LF_ICONS="\
tw=:\
st=:\
ow=:\
dt=:\
di=:\
fi=:\
ln=:\
or=:\
ex=:\
*.c=:\
*.cc=:\
*.clj=:\
*.coffee=:\
*.cpp=:\
*.css=:\
*.d=:\
*.dart=:\
*.erl=:\
*.exs=:\
*.fs=:\
*.go=:\
*.h=:\
*.hh=:\
*.hpp=:\
*.hs=:\
*.html=:\
*.java=:\
*.jl=:\
*.js=:\
*.json=:\
*.lua=:\
*.md=:\
*.php=:\
*.pl=:\
*.pro=:\
*.py=:\
*.rb=:\
*.rs=:\
*.scala=:\
*.ts=:\
*.vim=:\
*.cmd=:\
*.ps1=:\
*.sh=:\
*.bash=:\
*.zsh=:\
*.fish=:\
*.tar=:\
*.tgz=:\
*.arc=:\
*.arj=:\
*.taz=:\
*.lha=:\
*.lz4=:\
*.lzh=:\
*.lzma=:\
*.tlz=:\
*.txz=:\
*.tzo=:\
*.t7z=:\
*.zip=:\
*.z=:\
*.dz=:\
*.gz=:\
*.lrz=:\
*.lz=:\
*.lzo=:\
*.xz=:\
*.zst=:\
*.tzst=:\
*.bz2=:\
*.bz=:\
*.tbz=:\
*.tbz2=:\
*.tz=:\
*.deb=:\
*.rpm=:\
*.jar=:\
*.war=:\
*.ear=:\
*.sar=:\
*.rar=:\
*.alz=:\
*.ace=:\
*.zoo=:\
*.cpio=:\
*.7z=:\
*.rz=:\
*.cab=:\
*.wim=:\
*.swm=:\
*.dwm=:\
*.esd=:\
*.jpg=:\
*.jpeg=:\
*.mjpg=:\
*.mjpeg=:\
*.gif=:\
*.bmp=:\
*.pbm=:\
*.pgm=:\
*.ppm=:\
*.tga=:\
*.xbm=:\
*.xpm=:\
*.tif=:\
*.tiff=:\
*.png=:\
*.svg=:\
*.svgz=:\
*.mng=:\
*.pcx=:\
*.mov=:\
*.mpg=:\
*.mpeg=:\
*.m2v=:\
*.mkv=:\
*.webm=:\
*.ogm=:\
*.mp4=:\
*.m4v=:\
*.mp4v=:\
*.vob=:\
*.qt=:\
*.nuv=:\
*.wmv=:\
*.asf=:\
*.rm=:\
*.rmvb=:\
*.flc=:\
*.avi=:\
*.fli=:\
*.flv=:\
*.gl=:\
*.dl=:\
*.xcf=:\
*.xwd=:\
*.yuv=:\
*.cgm=:\
*.emf=:\
*.ogv=:\
*.ogx=:\
*.aac=:\
*.au=:\
*.flac=:\
*.m4a=:\
*.mid=:\
*.midi=:\
*.mka=:\
*.mp3=:\
*.mpc=:\
*.ogg=:\
*.ra=:\
*.wav=:\
*.oga=:\
*.opus=:\
*.spx=:\
*.xspf=:\
*.pdf=:\
*.nix=:\
"

Relevant parts from lfrc:

# interpreter for shell commands
set shell zsh
set icons

Relevant line from my which key setup:

["<leader>"] = { "getreg('%') !~ 'S' ? ':Lf<cr>' : ':Lf %<cr>'", "LF", expr = true },

Packer

		-- File managers
		use({
			"is0n/fm-nvim",
			config = function()
				require("fm-nvim").setup({ ui = { float = { height = 1, width = 1 } } })
			end,
		})

It works fine outside of neovim, so wondering if it's something to do with the environment or something 🤔

@is0n
Copy link
Owner

is0n commented Mar 24, 2022

  1. What shell are you using?
  2. Where is the file containing export LF_ICONS and all of the icons sourced?

@piersolenski
Copy link
Author

I'm using zsh for my shell.

I think I've narrowed down the issue... I recently added tmux bindings to open new windows with vim instances, such as:

bind-key D if-shell 'tmux select-window -t Dotfiles' '' 'new-window -n "Dotfiles" "cd $DOTFILES; nvim"'

For some reason, when I do this I lose the icons. If I echo the shell here it still results as /bin/zsh, so that part should be correct at least.

It doesn't really seem to matter where I export export LF_ICONS from, even if it's as low level as my .zshrc - they're still missing when opening new windows via tmux 🤔

@is0n
Copy link
Owner

is0n commented Mar 26, 2022

Can't say for sure what's causing this but here are the relevant parts of my lf configuration.

~/.config/lf/lfrc:

# Settings
set previewer ~/.config/lf/preview
set cleaner ~/.config/lf/cleaner
set drawbox true
set icons true
set info "size"
# set hidden

~/.zshenv

export LF_ICONS="\
di=:\
fi=:\
ln=:\
or=:\
ex=:\
*.vimrc=:\
*.viminfo=:\
*.gitignore=:\
*.c=:\
*.cc=:\
*.clj=:\
*.coffee=:\
*.cpp=:\
*.css=:\
*.d=:\
*.dart=:\
*.erl=:\
*.exs=:\
*.fs=:\
*.go=:\
*.h=:\
*.hh=:\
*.hpp=:\
*.hs=:\
*.html=:\
*.java=:\
*.jl=:\
*.js=:\
*.json=:\
*.lua=:\
*.md=:\
*.php=:\
*.pl=:\
*.pro=:\
*.py=:\
*.rb=:\
*.rs=:\
*.scala=:\
*.ts=:\
*.vim=:\
*.cmd=:\
*.ps1=:\
*.sh=:\
*.bash=:\
*.zsh=:\
*.fish=:\
*.tar=:\
*.tgz=:\
*.arc=:\
*.arj=:\
*.taz=:\
*.lha=:\
*.lz4=:\
*.lzh=:\
*.lzma=:\
*.tlz=:\
*.txz=:\
*.tzo=:\
*.t7z=:\
*.zip=:\
*.z=:\
*.dz=:\
*.gz=:\
*.lrz=:\
*.lz=:\
*.lzo=:\
*.xz=:\
*.zst=:\
*.tzst=:\
*.bz2=:\
*.bz=:\
*.tbz=:\
*.tbz2=:\
*.tz=:\
*.deb=:\
*.rpm=:\
*.jar=:\
*.war=:\
*.ear=:\
*.sar=:\
*.rar=:\
*.alz=:\
*.ace=:\
*.zoo=:\
*.cpio=:\
*.7z=:\
*.rz=:\
*.cab=:\
*.wim=:\
*.swm=:\
*.dwm=:\
*.esd=:\
*.jpg=:\
*.jpeg=:\
*.mjpg=:\
*.mjpeg=:\
*.gif=:\
*.bmp=:\
*.pbm=:\
*.pgm=:\
*.ppm=:\
*.tga=:\
*.xbm=:\
*.xpm=:\
*.tif=:\
*.tiff=:\
*.png=:\
*.svg=:\
*.svgz=:\
*.mng=:\
*.pcx=:\
*.mov=:\
*.mpg=:\
*.mpeg=:\
*.m2v=:\
*.mkv=:\
*.webm=:\
*.ogm=:\
*.mp4=:\
*.m4v=:\
*.mp4v=:\
*.vob=:\
*.qt=:\
*.nuv=:\
*.wmv=:\
*.asf=:\
*.rm=:\
*.rmvb=:\
*.flc=:\
*.avi=:\
*.fli=:\
*.flv=:\
*.gl=:\
*.dl=:\
*.xcf=:\
*.xwd=:\
*.yuv=:\
*.cgm=:\
*.emf=:\
*.ogv=:\
*.ogx=:\
*.aac=:\
*.au=:\
*.flac=:\
*.m4a=:\
*.mid=:\
*.midi=:\
*.mka=:\
*.mp3=:\
*.mpc=:\
*.ogg=:\
*.ra=:\
*.wav=:\
*.oga=:\
*.opus=:\
*.spx=:\
*.xspf=:\
*.pdf=:\
*.nix=:\
*.yml=:\
*.yaml=:\
*.zshrc=:\
*.zshenv=:\
*.bashrc=:\
*.DS_Store=:\
bin/=:\
Downloads/=:\
Documents/=:\
Desktop/=:\
Music/=:\
Wallpapers/=:\
Pictures/=:\
Programming/=:\
Movies/=:\
TV/=:\
Public/=:\
Users/=:\
Notes/=:\
Shared/=:\
node_modules/=:\
.git/=:\
"

~/.config/nvim/init.lua:

require('fm-nvim').setup{
	ui = {
		default = "float",
		float = {
			border   = "single",
			border_hl = "NONE",
		},
	},
	cmds = {
                -- https://gist.github.com/Provessor/dbb4a6d22945e7a42c3b904302ee273c
		lf_cmd  = "~/.config/lf/startlf"
	},
}

@piersolenski
Copy link
Author

Exporting LF_ICONS from .zshenv fixed it! Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants