https://wiki.archlinux.org/api.php?action=feedcontributions&user=Taiyu&feedformat=atomArchWiki - User contributions [en]2024-03-29T01:30:11ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Vifm&diff=344213Vifm2014-11-10T21:13:51Z<p>Taiyu: changed link to new homepage, and updated the quote</p>
<hr />
<div>[[Category:File managers]]<br />
[[ar:Vifm]]<br />
{{Related articles start}}<br />
{{Related|ranger}}<br />
{{Related articles end}}<br />
From the [http://vifm.info/ Vifm] home page:<br />
:'' Vifm is an ncurses based file manager with vi like keybindings/modes/options/commands/configuration, which also borrows some useful ideas from mutt.<br />
If you use vi, Vifm gives you complete keyboard control over your files without having to learn a new set of commands. ''<br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] {{Pkg|vifm}} from the [[official repositories]].<br />
<br />
Optional, for file previews:<br />
* {{Pkg|tree}} for directory previews<br />
* {{Pkg|mp3info}} for viewing information about mp3 files<br />
* {{Pkg|poppler}} for pdf previews<br />
<br />
== Help file ==<br />
<br />
Basic information about vifm is given in the help file. You can view it by opening vifm and typing<br />
<br />
:h<br />
<br />
Another good source of information is the man page.<br />
<br />
== Customizing Vifm ==<br />
<br />
Vifm creates and populates a .vifm folder in your home directory containing the following:<br />
* vifmrc - a well commented configuration file that can be edited to suit your working style.<br />
* vifm-help.txt - the help text<br />
* vifminfo - bookmarks and trash contents - it is not recommended to edit this file by hand<br />
* Trash/ directory - self explanatory<br />
* colors/ directory - color schemes<br />
** Default - well commented default color scheme - can be copied to create user-created color schemes<br />
<br />
To get started, read the information avaliable in:<br />
* {{ic|/usr/share/vifm/vifm.txt}}<br />
* {{ic|/usr/share/vifm/vifm-help.txt}}<br />
<br />
=== Color schemes ===<br />
<br />
The {{ic|~/.vifm/colors}} directory contains the color schemes. The format is outlined in the file and follows vi/vim syntax highlight format. It is basically:<br />
highlight ''group'' cterm=''attribute'' ctermfg=''color'' ctermbg=''color''<br />
<br />
An example colorscheme looks like:<br />
highlight Win cterm=none ctermfg=white ctermbg=black<br />
highlight Directory cterm=bold ctermfg=cyan ctermbg=none<br />
highlight Link cterm=bold ctermfg=yellow ctermbg=none<br />
highlight BrokenLink cterm=bold ctermfg=red ctermbg=none<br />
highlight Socket cterm=bold ctermfg=magenta ctermbg=none<br />
highlight Device cterm=bold ctermfg=red ctermbg=none<br />
highlight Fifo cterm=bold ctermfg=cyan ctermbg=none<br />
highlight Executable cterm=bold ctermfg=green ctermbg=none<br />
highlight Selected cterm=bold ctermfg=magenta ctermbg=none<br />
highlight CurrLine cterm=bold ctermfg=none ctermbg=blue<br />
highlight TopLine cterm=none ctermfg=black ctermbg=white<br />
highlight TopLineSel cterm=bold ctermfg=black ctermbg=none<br />
highlight StatusLine cterm=bold ctermfg=black ctermbg=white<br />
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black<br />
highlight CmdLine cterm=none ctermfg=white ctermbg=black<br />
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black<br />
highlight Border cterm=none ctermfg=black ctermbg=white<br />
<br />
=== Key mapping ===<br />
<br />
As of 0.6.2 you can customize key bindings in Vifm. These can be set from the command mode using the map command, like so:<br />
:map ] :s<br />
<br />
However, these mappings will not be saved between sessions. To map a key permanently, place them in ~/vifm/vifmrc. More sample mappings can be seen at the end of that file.<br />
<br />
=== Opening filetypes in vifm ===<br />
<br />
You can assign applications to filetypes in vifmrc, eg.<br />
filetype *.jpg,*.jpeg,*.png,*.gif feh %f 2>/dev/null &<br />
filetype *.md5 md5sum -c %f<br />
Several defaults can be found in vifmrc. These can be edited or added to following the same format.<br />
<br />
==== Browse images in current directory with Feh ====<br />
<br />
filextype *.jpg,*.jpeg,*.png,*.gif<br />
\ {View in feh}<br />
\ feh -FZ %d --start-at %d/%c 2>/dev/null<br />
It will display your selected image in feh, but it will enable you to browse all other images in the directory as well, in their default order.<br />
<br />
=== User commands ===<br />
<br />
You can also create custom commands in vifmrc, eg.<br />
command df df -h %m 2> /dev/null<br />
command diff vim -d %f %F<br />
<br />
==== Creating symbolic links ====<br />
<br />
command link ln -s %d/%f %D<br />
When you call <br />
:link<br />
a link of the selected file is made in the other directory (if you are in split view). It even works with multiple files selected with visual (v) or tag (t).<br />
<br />
==== Torrent creation ====<br />
<br />
make a .torrent of the current file in the other tab's dir<br />
command mkt mktorrent -p -a [your announce url here] -o %D/%f.torrent %d/%f<br />
<br />
=== Marks ===<br />
<br />
Marks can be set same as in vi.<br />
To set a mark for current file:<br />
m[a-z][A-Z][0-9]<br />
Go to a file set for mark:<br />
'[a-z][A-Z][0-9]<br />
Vifm will remember the marks between the sessions.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Useful key mappings ===<br />
<br />
Single stroke to access command line<br />
nmap ; :<br />
<br />
=== Non-vim Users ===<br />
{{ic|vifm}} assumes that you are using {{ic|vim}} and will throw errors if it doesn't find it. If you are using {{{ic|vi}}, you need to edit your {{ic|~/.vifm/vifmrc}} file. Comment out the line {{ic|<nowiki>set vicmd=vim</nowiki>}} and replace it with {{ic|<nowiki>set vicmd=vi</nowiki>}}. Note that, just like {{ic|.exrc}}, comment lines are introduced by double quotes.</div>Taiyu