Closed rockyzhang24 closed 4 years ago
Hello,
every time you change value of 'classify'
it breaks it into pieces and compiles each of them as a regular expression. If you have N
of them and add one at a time, you'll get N*(N - 1)/2
compilations of individual regexps in total. ranger_devicons
doesn't use regular expressions and doesn't add it one at a time, so no slowdown there.
Patterns like those actually don't need to be regular expressions and are good candidates for optimization. I thought about it, but haven't implemented yet. At the moment you can combine multiple set classify
commands together which should reduce startup time.
Thank you so much. As you suggested, I combined set classify
s together. Now, the superfast start comes back :) I show them below. Could you please help me check whether it is what you mean?
BTW, I think my icon settings are relatively all-inclusive. It almost contains all the special folders and file extensions. Is it possible to put this icon setting into the doc/wiki, or the README page so that other users could use it directly? I pushed it here: https://github.com/yanzhang0219/dotfiles/blob/master/.config/vifm/icons
Thanks a lot!
" Icons
" Filetypes
set classify=' :dir:/, :exe:, :reg:, :link:,? :?:, ::../::'
" Dirs
set classify+=' ::.git/::/,
\ ::.config/::/,
\ ::Desktop/::/,
\ ::Documents/::/,
\ ::Development/::/,
\ ::Downloads/::/,
\ ::Dropbox/::/,
\ ::Google\ Drive/::/,
\ ::git/::/,
\ ::Music/::/,
\ ::Pictures/::/,
\ ::Public/::/,
\ ::Templates/::/,
\ ::Videos/::/,
\ ::node_modules/::/'
" Files
set classify+=' ::.Xauthority,,.Xdefaults,,.Xresources,,.bash_aliases,,.bashprofile,,.bash_profile,,.bash_logout,,.bash_history,,.bashrc,,.dmrc,,.DS_Store,,.fasd,,.gitconfig,,.gitattributes,,.gitignore,,.inputrc,,.jack-settings,,.mime.types,,.nvidia-settings-rc,,.pam_environment,,.profile,,.recently-used,,.selected_editor,,.tmux.conf,,.xinitrc,,.xinputrc,,config,,bspwmrc,,sxhkdrc,,Makefile,,Makefile.in,,Makefile.ac,,mimeapps.list,,.zshenv,,.zprofile,,.zshrc,,.zlogin,,.zlogout,,vifmrc,,yabairc,,skhdrc,,ini,,user-dirs.dirs::,
\ ::.fehbg::,
\ ::.vim,,.vimrc,,.viminfo,,init.vim::,
\ ::Dockerfile,,docker-compose.yml::,
\ ::dropbox::,
\ X1 ::exact-match-case-sensitive-1.txt::,
\ X2 ::exact-match-case-sensitive-2::,
\ ::favicon.ico::,
\ ::a.out,,configure::,
\ ::config.mk,,config.m4,,config.ac::,
\ ::Rakefile::,
\ ::gruntfile.coffee,,gruntfile.js,,gruntfile.ls::,
\ ::gulpfile.coffee,,gulpfile.js,,gulpfile.ls::,
\ ::ledger::,
\ ::package.json,,package-lock.json,,webpack.config.js::,
\ ::.ncmpcpp,,playlists::,
\ ::known_hosts,,authorized_keys,,license,,LICENSE.md,,LICENSE,,LICENSE.txt::,
\ ::procfile::,
\ ::react.jsx::,
\ ::README.rst,,README.md,,README.markdown,,README,,README.txt::'
" Extentions
set classify+=' ::*.7z,,*.apk,,.*.bz2,,*.cpio,,*.deb,,*.gz,,*.gzip,,*.gem,,*.lha,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.tar,,*.tgz,,*.xbps,,*.xz,,*.zip::,
\ ::*.a,,*.cmake,,*.jl,,*.o,,*.so::,
\ ::*.ai::,
\ ::*.asm,,*.css,,*.less,,*.s,,*.sh::,
\ ::*.asp,,*.rom,,*.efi,,*.elf,,*.fish::,
\ ::*.aup,,*.cue,,*.flac,,*.m4a,,*.mp3,,*.ogg,,*.wav::,
\ ::*.avi,,*.flv,,*.m4v,,*.mkv,,*.mov,,*.mp4,,*.mpeg,,*.mpg,,*.webm::,
\ ::*.bat,,*.conf,,*.cvs,,*.htaccess,,*.htpasswd,,*.ini,,*.rc,,*.yaml,,*.yml::,
\ ::*.bmp,,*.gif,,*.ico,,*.jpeg,,*.jpg,,*.png,,*.ppt,,*.pptx::,
\ ::*.c,,*.h::,
\ ::*.cbr,,*.cbz::,
\ ::*.class,,*.jar,,*.java::,
\ ::*.clj,,*.cljc::,
\ ::*.cljs,,*.edn::,
\ ::*.coffee::,
\ ::*.cs::,
\ ::*.cxx,,*.c++,,*.cc,,*.cp,,*.cpp::,
\ ::*.d::,
\ ::*.dart::,
\ ::*.db,,*.dump,,*.img,,*.iso,,*.sql::,
\ ::*.diff::,
\ ::*.dll,,*.exe,,*.msi::,
\ ::*.doc,,*.docx,,*.epub,,*.pdf,,*.rtf,,*.xls,,*.xlsx::,
\ ::*.ejs,,*.htm,,*.html,,*.slim,,*.xhtml,,*.xml::,
\ ::*.elm::,
\ ::*.erl,,*.hrl::,
\ ::*.ex,,*.exs,,*.eex::,
\ ::*.f#,,*.fs,,*.fsi,,*.fsscript,,*.fsx::,
\ | ::*.fifo::,
\ ::*.go::,
\ ::*.hbs,,*.mustache::,
\ ::*.hs,,*.lhs::,
\ ::*.js::,
\ ::*.json::,
\ ::*.jsx::,
\ ::*.key,,*.pub::,
\ ::*.log::,
\ ::*.lua::,
\ ::*.markdown,,*.md::,
\ λ ::*.ml,,*.mli::,
\ ::*.php::,
\ ::*.pl,,*.pm,,*.t::,
\ ::*.psb,,*.psd::,
\ ::*.py,,*.pyc,,*.pyd,,*.pyo::,
\ ::*.rb::,
\ ::*.rlib,,*.rs::,
\ ::*.rss::,
\ ::*.scala::,
\ ::*.scss::,
\ ::*.sln,,*.suo::,
\ ::*.styl::,
\ ::*.ts::,
\ ::*.twig::,
\ ::*.vim,,*.vimrc::,
\ ::*.xul::'
Yes, that's what I meant.
You might want to remove these two lines though:
set classify+='X1 ::exact-match-case-sensitive-1.txt::'\ set classify+='X2 ::exact-match-case-sensitive-2::'
I just realized that there is a link to vifm_devicons at https://vifm.info (see "Related" on the right side). You could have used that, but it would be slow as well. I've added link to yours as an alternative (although I think they are almost identical in contents).
Okay. Thank you very much! I have already removed those two meaningless lines. Just let you know, compared to vifm_devicons, my icon setting is more comprehensive. I set icons for some special directories (like ~/Documents, ~/Dropbox, etc) and more special files. And it has no slowdown issue. :) I have added a README on my vifm repo containing a screenshot and installation instruction. Could you please change the link of my icons you added to the link of my vifm repo above so that other friends could see the README page? Thanks a lot!
I Love Vifm!!!!
Hi,
I tried to use classify to set icons for lots of files/dirs, but it led to a sluggishness issue. I'm using all the devicons from ranger_devicons. Actually I just converted the code in this file to the "classify" sentences which are shown below.
When I start the vifm, there is an around 1s sluggishness. I use ranger_devicons in ranger as well, but the start of ranger is much faster than vifm.
If I get rid of all these icon settings, vifm becomes very very smooth and unbelievably fast. Thank you very much.
macOS version: 10.15.4 (the lastest) vifm version: