dotfiles/.config/vifm/vifmrc

444 lines
8.6 KiB
Plaintext

" Settings {{{
" This is the actual command used to start vi
set vicmd=nvim
" This makes vifm perform file operations on its own
" instead of relying on standard utilities like cp
set syscalls
" Use vim help format
set vimhelp
" Show list of matches on tab completion in command-line mode
set wildmenu
" Display completions in a form of popup with descriptions of the matches
set wildstyle=popup
" Controls how size of directories is displayed in file views
set dirsize=nitems
" Sets characters used to fill borders
set fillchars=vborder:┊
" Use ripgrep instead of grep
set grepprg=rg\ --color=never\ -Hn\ %i\ %a\ %s
" Use fd instead of find
set findprg=fd\ --color=never\ %p\ %s
" What should be saved automatically between vifm runs
set vifminfo=chistory,shistory
" Maximum number of stored items in all histories
set history=100
" Path to trash directory
set trashdir=~/.cache/trash
" Ignore case in search patterns unless
" it contains at least one uppercase letter
set ignorecase smartcase
" Automatically resolve symbolic links on l or Enter
set followlinks
" Highlight search results automatically
set hlsearch
" Use increment searching (search while typing)
set incsearch
" Format for displaying time in file list
set timefmt=%F\ %T
" Set custom status line look
set statusline=' %t%= %A %10u:%-7g %15E %20d '
" Selected color scheme
colorscheme ph
" Set --login flag for bash shell
let $SHELL = '/bin/bash --login'
" Single pane when started via vim plugin
if $MYVIMRC != '' | only | endif
" }}}
" Commands {{{
" The following macros can be used in a command
" %a is replaced with the user arguments
" %c the current file under the cursor
" %C the current file under the cursor in the other directory
" %f the current selected file, or files
" %F the current selected file, or files in the other directory
" %b same as %f %F
" %d the current directory name
" %D the other window directory name
" %m run the command in a menu window
command! df df -h %a %m
command! diff diff %a %b %m
command! make !!make %a
command! run !!./%f %a
command! vdiff nvim -d %a %b
" }}}
" File types {{{
" The file type is for the default programs to be used with a file extension
" The other programs for the file type can be accessed with the :file command
" The command macros %c, %C, %f, %F, %b, %d, %D may be used in the commands
" Documents {{{
filextype *.pdf,*.epub
\ {Zathura} zathura %f %i &,
\ {Okular} okular %f %i &,
\ {MComix} mcomix %f %i &
filextype *.doc,*.docx,*.odt
\ {Calligra} calligrawords %f %i &
filextype *.ppt,*.pptx,*.odp
\ {Calligra} calligrastage %f %i &
filextype *.xls,*.xlsx,*.csv
\ {Calligra} calligrasheets %f %i &
fileviewer *.pdf pdftotext -nopgbrk %c -
fileviewer *.epub pandoc -f epub -t plain %c
fileviewer *.docx pandoc -f docx -t plain %c
fileviewer *.odt pandoc -f odt -t plain %c
fileviewer *.ipynb pandoc -f ipynb -t gfm %c
" }}}
" Audio {{{
filetype *.aac,
\*.au,
\*.axa,
\*.flac,
\*.mid,
\*.midi,
\*.mka,
\*.mp3,
\*.mpc,
\*.oga,
\*.ogg,
\*.ra,
\*.spx,
\*.wav,
\*.xspf
\ {MPV} mpv %f &
fileviewer *.aac,
\*.au,
\*.axa,
\*.flac,
\*.mid,
\*.midi,
\*.mka,
\*.mp3,
\*.mpc,
\*.oga,
\*.ogg,
\*.ra,
\*.spx,
\*.wav,
\*.xspf
\ ffprobe -hide_banner %c 2>&1
" }}}
" Videos {{{
filextype *.anx,
\*.asf,
\*.avi,
\*.axv,
\*.cgm,
\*.dl,
\*.emf,
\*.flc,
\*.fli,
\*.flv,
\*.gl,
\*.m2v,
\*.m4v,
\*.mkv,
\*.mov,
\*.mp4,
\*.mp4v,
\*.mpeg,
\*.mpg,
\*.nuv,
\*.ogm,
\*.ogv,
\*.ogx,
\*.pak,
\*.qt,
\*.rm,
\*.rmvb,
\*.vob,
\*.wmv,
\*.xcf,
\*.xwd,
\*.yuv
\ {MPV} mpv %f &
fileviewer *.anx,
\*.asf,
\*.avi,
\*.axv,
\*.cgm,
\*.dl,
\*.emf,
\*.flc,
\*.fli,
\*.flv,
\*.gl,
\*.m2v,
\*.m4v,
\*.mkv,
\*.mov,
\*.mp4,
\*.mp4v,
\*.mpeg,
\*.mpg,
\*.nuv,
\*.ogm,
\*.ogv,
\*.ogx,
\*.pak,
\*.qt,
\*.rm,
\*.rmvb,
\*.vob,
\*.wmv,
\*.xcf,
\*.xwd,
\*.yuv
\ ffprobe -hide_banner %c 2>&1
" }}}
" Images {{{
filextype *.apng,
\*.bmp,
\*.gif,
\*.ico,
\*.icon,
\*.j2k,
\*.jp2,
\*.jpeg,
\*.jpf,
\*.jpg,
\*.jpm,
\*.jpx,
\*.mng,
\*.pbm,
\*.pcx,
\*.pgm,
\*.png,
\*.ppm,
\*.psd,
\*.tga,
\*.tif,
\*.tiff,
\*.webp,
\*.xbm,
\*.xpm
\ {ImageMagick} display %f %i &,
\ {Eye of Gnome} eog %f %i &,
\ {Gwenview} gwenview %f %i &,
\ {GIMP} gimp %f %i &,
\ {Krita} krita %f %i &
filextype *.svg,*.svgz
\ {ImageMagick} display %f %i &,
\ {Eye of Gnome} eog %f %i &,
\ {Gwenview} gwenview %f %i &,
\ {Inkscape} inkscape %f %i &,
\ {Karbon} karbon %f %i &
fileviewer *.apng,
\*.bmp,
\*.gif,
\*.ico,
\*.icon,
\*.j2k,
\*.jp2,
\*.jpeg,
\*.jpf,
\*.jpg,
\*.jpm,
\*.jpx,
\*.mng,
\*.pbm,
\*.pcx,
\*.pgm,
\*.png,
\*.ppm,
\*.svg,
\*.svgz,
\*.tga,
\*.tif,
\*.tiff,
\*.webp,
\*.xbm,
\*.xpm
\ identify -verbose %c
" }}}
" Archives {{{
filextype *.7z,
\*.apk,
\*.cb7,
\*.cbr,
\*.cbz,
\*.deb,
\*.ear,
\*.jar,
\*.oxt
\*.rar,
\*.rpm,
\*.tar.br
\*.tar.bz2,
\*.tar.gz,
\*.tar.xz,
\*.tar.zst,
\*.tbz2,
\*.tgz,
\*.txz,
\*.war,
\*.zip
\ {Ark} ark %f %i &
filextype *.7z,
\*.cb7,
\*.cbr,
\*.cbz,
\*.rar,
\*.zip
\ {MComix} mcomix %f %i &,
\ {Zathura} zathura %f %i &
filetype *.7z,*.cb7 {Extract} 7z x %f
filetype *.asar {Extract} asar e %f %f:r
filetype *.rar,*.cbr {Extract} unrar %f
filetype *.tar {Extract} tar xf %f
filetype *.tar.br {Extract} tar -I brotli -xf %f
filetype *.tar.bz2,*.tbz2 {Extract} tar xjf %f
filetype *.tar.gz,*.tgz {Extract} tar xzf %f
filetype *.tar.xz,*.txz {Extract} tar xJf %f
filetype *.tar.zst {Extract} tar -I zst -xf %f
filetype *.apk,
\*.cbz,
\*.ear,
\*.jar,
\*.oxt,
\*.war,
\*.zip
\ {Extract} unzip %f
filetype *.pkg.tar,*.pkg.tar.*
\ {Install} sudo pacman -U %f
fileviewer *.7z,*.cb7 7z l %c
fileviewer *.asar asar l %c
fileviewer *.rar,*.cbr unrar v %c
fileviewer *.tar tar tf %c
fileviewer *.tar.br tar -I brotli -tf %c
fileviewer *.tar.bz2,*.tbz2 tar tjf %c
fileviewer *.tar.gz,*.tgz tar tzf %c
fileviewer *.tar.xz,*.txz tar tJf %c
fileviewer *.tar.zst tar -I zst -tf %c
fileviewer *.apk,
\*.cbz,
\*.ear,
\*.jar,
\*.oxt,
\*.war,
\*.zip
\ zip -sf %c
" }}}
" Web {{{
filextype *.html,*.htm
\ {qutebrowser} qutebrowser -- %f %i &,
\ {Firefox} firefox -- %f %i &,
\ {Chromium} chromium -- %f %i &
" }}}
" Hashes {{{
filetype *.b2 {Verify} b2sum -c %f %S
filetype *.md5 {Verify} md5sum -c %f %S
filetype *.sha1 {Verify} sha1sum -c %f %S
filetype *.sha256 {Verify} sha256sum -c %f %S
filetype *.sha384 {Verify} sha384sum -c %f %S
filetype *.sha512 {Verify} sha512sum -c %f %S
" }}}
" Torrents {{{
filetype *.torrent {Aria2} aria2c %f &
filextype *.torrent {qBittorrent} qbittorent %f %i &
fileviewer *.torrent dump_torrent -v %c
" }}}
" GPG files {{{
filetype *.asc,*.sig {Verify} gpg --verify %c
fileviewer *.gpg gpg --decrypt %c
" }}}
" Binary files {{{
filextype *.out,*.exe,*.bin {Okteta} okteta %f %i &
filetype *.class {Decompile} cfr %f --outputdir %d %i &
fileviewer *.out,*.exe,*.bin xxd -u %c
fileviewer *.class cfr %c
fileviewer *.lnk pylnker %c
fileviewer *.o nm %c
" }}}
" IDE projects {{{
filextype *.pro
\ {Qt Creator} qtcreator %f %i &,
\ {CLion} clion %d %i &
filextype .idea/
\ {IntelliJ} intellij-idea-ultimate-edition %d %i &,
\ {CLion} clion %d %i &,
\ {PhpStorm} phpstorm %d %i &,
\ {PyCharm} pycharm %d %i &
" }}}
" Other {{{
filextype */
\ {Dolphin} dolphin %f %i &,
\ {Gwenview} gwenview %f %i &,
\ {MPV} mpv %f &
filetype * {Default} xdg-open
" }}}
" }}}
" Marks {{{
mark c ~/Documents/Code/
mark h ~/
mark t /tmp/
" }}}
" Mappings {{{
" Start shell in current directory
nnoremap S :shell<CR>
" Start terminal in current directory
nnoremap T :!konsole --workdir %d %i &<CR>
" Display sorting dialog
nnoremap s :sort<CR>
" Toggle wrap setting
nnoremap W :set wrap!<CR>
" Toggle visibility of preview window
nnoremap w :view<CR>
vnoremap w :view<CR>gv
" Yank current directory path into the clipboard
nnoremap yd :!printf -- %d | xclip -sel c %i<CR>
" Yank current file path into the clipboard
nnoremap yf :!printf -- %c:p | xclip -sel c %i<CR>
" Yank current file contents into the clipboard
nnoremap yc :!xlip -sel c -i %c %i<CR>
" Open filetype dialog
nnoremap o :file<CR>
" Quit vifm
nnoremap Q :quit<CR>
" }}}
" vim:fdm=marker:fdl=1: