From 589fc34059855518841132a979f1d8f735625236 Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 26 Mar 2022 02:00:50 +0100 Subject: [PATCH] update vimfrc --- .config/vifm/vifmrc | 98 ++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 27 deletions(-) diff --git a/.config/vifm/vifmrc b/.config/vifm/vifmrc index 61f2fd8..aa2bc48 100644 --- a/.config/vifm/vifmrc +++ b/.config/vifm/vifmrc @@ -1,12 +1,10 @@ -" vim: filetype=vifm : +" vim: filetype=vim.vifm " This is the actual command used to start vi. The default is vim. " If you would like to use another vi clone such as Elvis or Vile " you will need to change this setting. set vicmd=vim -" set vicmd=elvis\ -G\ termcap -" set vicmd=vile " Trash Directory " The default is to move files that are deleted with dd or :d to @@ -54,7 +52,8 @@ set noiec " Selected color scheme -colorscheme Default +"colorscheme Default */ +colorscheme dracula " Format for displaying time in file list. For example: " TIME_STAMP_FORMAT=%m/%d-%H:%M:%S @@ -98,6 +97,9 @@ if !has('win') set slowfs=curlftpfs endif +" Things that should be stored in vifminfo +set vifminfo=dhistory,chistory,state,shistory,phistory,fhistory,dirstack,registers,bookmarks,bmarks + " Set custom status line look set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d " @@ -161,8 +163,23 @@ command! reload :write | restart " program. " Pdf -filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c -fileviewer *.pdf pdftotext -nopgbrk %c - +filextype *.pdf zathura %c %i & +fileviewer *.pdf + \ vifmimg pdf %px %py %pw %ph %c + \ %pc + \ vifmimg clear +" ePUBs +filextype *.epub zathura %c %i & +fileviewer *.epub + \ vifmimg epub %px %py %pw %ph %c + \ %pc + \ vifmimg clear + +" Fonts +fileviewer *.otf,*.ttf,*.woff + \ vifmimg font %px %py %pw %ph %c + \ %pc + \ vifmimg clear " PostScript filextype *.ps,*.eps,*.ps.gz @@ -202,15 +219,13 @@ fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, \*.as[fx] \ ffprobe -pretty %c 2>&1 -" Web -filextype *.html,*.htm - \ {Open with dwb} - \ dwb %f %i &, - \ {Open with firefox} - \ firefox %f &, - \ {Open with uzbl} - \ uzbl-browser %f %i &, -filetype *.html,*.htm links, lynx +" HTMLs +fileviewer *.html w3m -dump %c +filetype *.html,*.htm vim %f 2>/dev/null & + +" Text based files +filetype vim +fileviewer env -uCOLORTERM bat --color always --wrap never --pager never %c -p " Object filetype *.o nm %f | less @@ -227,8 +242,13 @@ filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm \ gpicview %c, \ {View in shotwell} \ shotwell, -fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm - \ convert -identify %f -verbose /dev/null +""fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm +"" \ convert -identify %f -verbose /dev/null +""filextype mpv %c %i /dev/null & */ +fileviewer + \ vifmimg draw %px %py %pw %ph %c + \ %pc + \ vifmimg clear " OpenRaster filextype *.ora @@ -317,6 +337,8 @@ fileviewer *.7z 7z l %c " Office files filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f & +filetype *.csv,*.xlsx libreoffice %c %i +fileviewer *.csv sed "s/,,,,/,,-,,/g;s/,,/ /g" %c | column -t | sed "s/ - / /g" | cut -c -%pw fileviewer *.doc catdoc %c fileviewer *.docx, docx2txt.pl %f - @@ -327,9 +349,13 @@ filetype *.tudu tudu -f %c filextype *.pro qtcreator %f & " Directories -filextype */ - \ {View in thunar} - \ nemo %f &, +"filextype */ +" \ nautilus %f &, + +" Show ls in the preview window, it creates a similar look as ranger. +" The default directory tree thing is really messy +fileviewer */ ls --color --group-directories-first +fileviewer .*/ ls --color --group-directories-first " Syntax highlighting in preview " @@ -356,7 +382,7 @@ filextype */ " uncommenting one of lines below will result in ignoring 'vi[x]cmd' option " for unknown file types. " For *nix: -" filetype * xdg-open +filetype * xdg-open %c " For OS X: " filetype * open " For Windows: @@ -387,6 +413,9 @@ set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, " Sample mappings +" Easily quit vifm by hitting q +nmap q ZQ + " Start shell in current directory nnoremap s :shell @@ -397,19 +426,17 @@ nnoremap S :sort nnoremap w :view vnoremap w :viewgv -" Open file in existing instance of gvim -nnoremap o :!gvim --remote-tab-silent %f -" Open file in new instance of gvim -nnoremap O :!gvim %f +" Open file in vim +nnoremap o :!vim %f " Open file in the background using its default program nnoremap gb :file &l " Yank current directory path into the clipboard -nnoremap yd :!echo %d | xclip %i +nnoremap yd :!echo %d | wl-copy %i " Yank current file path into the clipboard -nnoremap yf :!echo %c:p | xclip %i +nnoremap yf :!echo %c:p | wl-copy %i " Mappings for faster renaming nnoremap I cw @@ -435,6 +462,23 @@ nnoremap :move nnoremap :mkdir nnoremap :delete +" ------------------------------------------------------------------------------ +"{{{ Icons +" file types +set classify=' :dir:/, :exe:, :reg:, :link:' +" various file names +set classify+=' ::../::, ::*.sh::, ::*.[hc]pp::, ::*.[hc]::, ::/^copying|license$/::, ::.git/,,*.git/::, ::*.epub,,*.fb2,,*.djvu::, ::*.pdf::, ::*.htm,,*.html,,**.[sx]html,,*.xml::' +" archives +set classify+=' ::*.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::' +" images +set classify+=' ::*.bmp,,*.gif,,*.jpeg,,*.jpg,,*.ico,,*.png,,*.ppm,,*.svg,,*.svgz,,*.tga,,*.tif,,*.tiff,,*.xbm,,*.xcf,,*.xpm,,*.xspf,,*.xwd::' +" audio +set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::' +" media +set classify+=' ::*.avi,,*.ts,,*.axv,,*.divx,,*.m2v,,*.m4p,,*.m4v,,.mka,,*.mkv,,*.mov,,*.mp4,,*.flv,,*.mp4v,,*.mpeg,,*.mpg,,*.nuv,,*.ogv,,*.pbm,,*.pgm,,*.qt,,*.vob,,*.wmv,,*.xvid::' +" office files +set classify+=' ::*.doc,,*.docx::, ::*.xls,,*.xls[mx]::, ::*.pptx,,*.ppt::' +"}}} " ------------------------------------------------------------------------------ " Various customization examples