VIFM(1) | General Commands Manual | VIFM(1) |
vifm - vi file manager
vifm [OPTION]...
vifm [OPTION]... path
vifm [OPTION]... path path
Vifm is an ncurses based file manager with vi like keybindings. If you use vi, vifm gives you complete keyboard control over your files without having to learn a new set of commands.
vifm starts in the current directory unless it is given a different directory on the command line or 'vifminfo' option includes "savedirs" (in which case last visited directories are used as defaults).
Specifying two directories triggers split view even when vifm was in single-view mode on finishing previous run. To suppress this behaviour :only command can be put in the vifmrc file.
When only one path argument is found on command-line, the left/top pane is automatically set as the current view.
Paths to files are also allowed in case you want vifm to start with some archive opened.
See "Startup" section below for the explanations on
$VIFM.
The basic vi key bindings are used to move through the files and pop-up windows.
Second character can be entered with or without Control key.
For Ctrl-W +, Ctrl-W -, Ctrl-W <, Ctrl-W >, Ctrl-W | and Ctrl-W _ commands count can be given before and/or after Ctrl-W. The resulting count is a multiplication of those two. So "2 Ctrl-W 2 -" decreases window size by 4 lines or columns.
Ctrl-W | and Ctrl-W _ maximise current view by default.
You can use these characters for marks [a-z][A-Z][0-9].
There are also several special marks that can't be set manually:
Note: vifm uses extended regular expressions for / and ?.
Note: f, F, ; and , wrap around list beginning and end when they are used alone and they don't wrap when they are used as selectors.
There are three basic file filters:
Permanent filter essentially allows defining a group of files names which are not desirable to be seen by default, like temporary or backup files, which might be created alongside normal ones. Just like you don't usually need to see hidden dot files (files starting with a dot). Local filter on the other hand is for temporary immediate filtering of file list at hand, to get rid of uninterested files in the view or to make it possible to use % range in a :command.
For the purposes of more deterministic editing permanent filter is split into two parts:
Files are tested against both parts and a match counts if at least one of the parts matched.
" filter directories which names end with '.files'
:filter /^.*\.files\/$/
" filter files which names end with '.d'
:filter {*.d}
" filter files and directories which names end with '.o'
:filter /^.*\.o\/?$/
Note: vifm uses extended regular expressions.
The basic vim folding key bindings are used for managing filters.
While some of the keys make sense outside of tree-view, they are most useful in trees.
If file under cursor is selected, each selected item is processed, otherwise only current file is updated.
vifm supports multiple registers for temporary storing list of yanked or deleted files.
Registers should be specified by hitting double quote key followed by a register name. Count is specified after register name. By default commands use unnamed register, which has double quote as its name.
Though all commands accept registers, most of commands ignores them (for example H or Ctrl-U). Other commands can fill register or append new files to it.
Presently vifm supports ", _, a-z and A-Z characters as register names.
As mentioned above " is unnamed register and has special meaning of the default register. Every time when you use named registers (a-z and A-Z) unnamed register is updated to contain same list of files as the last used register.
_ is black hole register. It can be used for writing, but its list is always empty.
Registers with names from a to z and from A to Z are named ones. Lowercase registers are cleared before adding new files, while uppercase aren't and should be used to append new files to the existing file list of appropriate lowercase register (A for a, B for b, ...).
Registers can be changed on :empty command if they contain files under trash directory (see "Trash directory" section below).
Registers do not contain one file more than once.
Example:
"a2yy
"Ad
p or "ap or "Ap
Most of selectors are like vi motions: j, k, gg, G, H, L, M, %, f, F, ;, comma, ', ^, 0 and $. But there are some additional ones.
Examples:
When you pass a count to whole command and its selector they are multiplied. So:
Visual mode has two generic operating submodes:
Both modes select files in range from cursor position at which visual mode was entered to current cursor position (let's call it "selection region"). Each of two borders can be adjusted by swapping them via "o" or "O" keys and updating cursor position with regular cursor motion keys. Obviously, once initial cursor position is altered this way, real start position becomes unavailable.
Plain Vim-like visual mode starts with cleared selection, which is not restored on rejecting selection ("Escape", "Ctrl-C", "v", "V"). Contrary to it, selection editing doesn't clear previously selected files and restores them after reject. Accepting selection by performing an operation on selected items (e.g. yanking them via "y") moves cursor to the top of current selection region (not to the top most selected file of the view).
In turn, selection editing supports three types of editing (look at statusbar to know which one is currently active):
No matter how you activate selection editing it starts in "append". One can switch type of operation (in the order given above) via "Ctrl-G" key.
Almost all normal mode keys work in visual mode, but instead of accepting selectors they operate on selected items.
This mode tries to imitate the less program. List of builtin shortcuts can be found below. Shortcuts can be customized using :qmap, :qnoremap and :qunmap command-line commands.
All "Ctrl-W x" keys work the same was as in Normal mode. Active mode is automatically changed on navigating among windows. When less-like mode activated on file preview is left using one by "Ctrl-W x" keys, its state is stored until another file is displayed using preview (it's possible to leave the mode, hide preview pane, do something else, then get back to the file and show preview pane again with previously stored state in it).
These keys are available in all submodes of the command line mode: command, search, prompt and filtering.
Down, Up, Left, Right, Home, End and Delete are extended keys and they are not available if vifm is compiled with --disable-extended-keys option.
The shortcuts listed below insert specified values into current
cursor position. Last key of every shortcut references value that it
inserts:
- c - [c]urrent file
- d - [d]irectory path
- e - [e]xtension of a file name
- r - [r]oot part of a file name
- t - [t]ail part of directory path
- a - [a]utomatic filter
- m - [m]anual filter
- = - local filter, which is bound to "=" in normal mode
Values related to filelist in current pane are available through Ctrl-X prefix, while values from the other pane have doubled Ctrl-X key as their prefix (doubled Ctrl-X is presumably easier to type than uppercase letters; it's still easy to remap the keys to correspond to names of similar macros).
vifm provides a facility to edit several kinds of data, that is
usually edited in command-line mode, in external editor (using command
specified by 'vicmd' or 'vixcmd' option). This has at least two advantages
over built-in command-line mode:
- one can use full power of Vim to edit text;
- finding and reusing history entries becomes possible.
The facility is supported by four input submodes of the
command-line:
- command;
- forward search;
- backward search;
- file rename (see description of cw and cW normal mode keys).
Editing command-line using external editor is activated by the Ctrl-G shortcut. It's also possible to do almost the same from Normal and Visual modes using q:, q/ and q? commands.
Temporary file created for the purpose of editing the line has the following structure:
After editing application is finished the first line of the file is taken as the result of operation, when the application returns zero exit code. If the application returns an error (see :cquit command in Vim), all the edits made to the file are ignored, but the initial value of the first line is saved in appropriate history.
This is the mode that appears when status bar content is so big that it doesn't fit on the screen. One can identify the mode by "-- More --" message at the bottom.
The following keys are handled in this mode:
Commands are executed with :command_name<Enter>
Commented out lines should start with the double quote symbol ("), which may be preceded by whitespace characters intermixed with colons. Inline comments can be added at the end of the line after double quote symbol, only last line of a multi-line command can contain such comment. Not all commands support inline comments as their syntax conflicts with names of registers and fields where double quotes are allowed.
Most of the commands have two forms: complete and the short one. Example:
This means the complete command is nohlsearch, and the short one is noh.
:noh[lsearch]
Most of command-line commands completely reset selection in the current view. However, there are several exceptions:
'|' can be used to separate commands, so you can give multiple commands in one line. If you want to use '|' in an argument, precede it with '\'.
These commands see '|' as part of their arguments even when it's escaped:
:[range]!
:autocmd
:cabbrev
:cmap
:cnoreabbrev
:cnoremap
:command
:dmap
:dnoremap
:filetype
:fileviewer
:filextype
:map
:mmap
:mnoremap
:nmap
:nnoremap
:noremap
:normal
:qmap
:qnoremap
:vmap
:vnoremap
:wincmd
:windo
:winrun
To be able to use another command after one of these, wrap it with the :execute command. An example:
if filetype('.') == 'reg' | execute '!!echo regular file' | endif
same as above, but the command is run in the background using vifm's means.
Programs that write to stderr create error dialogs showing errors of the command.
Note the space before ampersand symbol, if you omit it, command will be run in the background using job control of your shell.
Accepts macros.
{pat} is a comma-separated list of modified globs patterns,
which can contain tilde or environment variables. All paths use slash
('/') as directory separator. The pattern can start with a '!', which
negates it. Patterns that do not contain slashes are matched against the
last item of the path only (e.g. "dir" in
"/path/dir"). Literal comma can be entered by doubling it. Two
modifications to globs matching are as follows:
- * - never matches a slash (i.e., can signify single directory level)
- ** - matches any character (i.e., can match path of arbitrary
depth)
{cmd} is a :command or several of them separated with '|'.
Examples of patterns:
- conf.d - matches conf.d directory anywhere
- *.d - matches directories ending with ".d" anywhere
- **.git - matches something.git, but not .git anywhere
- **/.git/** - matches /path/.git/objects, but not /path/.git
- **/.git/**/ - matches /path/.git/ only (because of trailing slash)
- /etc/* - matches /etc/conf.d/, /etc/X11, but not /etc/X11/fs
- /etc/**/*.d - matches /etc/conf.d, /etc/X11/conf.d, etc.
- /etc/**/* - matches /etc/ itself and any file below it
- /etc/**/** - matches /etc/ itself and any file below it
Path can contain macros that expand to single path (%c, %C, %d, %D) or those that can expand to multiple paths, but contain only one (%f, %F, %rx). The latter is done for convenience on using the command interactively. Complex macros that include spaces (e.g. "%c:gs/ /_") should be escaped.
Available flags:
" use a separate color scheme for panes which are inside FUSE mounts
execute 'colorscheme in-fuse' &fusehome
" good
:command mp3 command
" good
:command mp4 command
:command mp3! command
:command mp4? command
" bad
:command mp command
:command mp44 command
" good
:command mp4c command
User commands are run in a shell by default (see below for
syntax of other options). To run a command in the background you must
mark it as a background command by adding " &" after the
command's action (e.g., `:com rm rm %f &`).
User commands of all kinds have macros expanded in them. See "Command
macros" section for more information.
" display only audio files
:command onlyaudio filter/.+.\(mp3|wav|mp3|flac|ogg|m4a|wma|ape\)$/i
" display everything except audio files
:command noaudio filter!/.+.\(mp3|wav|mp3|flac|ogg|m4a|wma|ape\)$/i
filetype *.zip,*.jar,*.war,*.ear
\ {Mount with fuse-zip}
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
\ {View contents}
\ zip -sf %c | less,
\ {Extract here}
\ tar -xf %c,
Note that on OS X when `open` is used to call an app, vifm is unable to check whether that app is actually available. So if automatic skipping of programs that aren't there is desirable, `open` should be replaced with an actual command.
For example, consider the following settings (the order might seem strange, but it's for the demonstration purpose):
filetype *.html,*.htm
\ {View in lynx}
\ lynx
filextype *.html,*.htm
\ {Open with dwb}
\ dwb %f %i &,
filetype *.html,*.htm
\ {View in links}
\ links
filextype *.html,*.htm
\ {Open with firefox}
\ firefox %f &,
\ {Open with uzbl}
\ uzbl-browser %f %i &,
If you're using vifm inside a terminal emulator that is running in graphical environment (when X is used on *nix; always on Windows), vifm attempts to run application in this order:
1. lynx
2. dwb
3. links
4. firefox
5. uzbl
If there is no graphical environment (checked by presence of non-empty $DISPLAY or $WAYLAND_DISPLAY environment variable on *nix; never happens on Windows), the list will look like:
1. lynx
2. links
Just as if all :filextype commands were not there.
The purpose of such differentiation is to allow comfortable use of vifm with same settings in desktop environment/through remote connection (SSH)/in native console.
Note that on OS X $DISPLAY isn't defined unless you define it, so :filextype should be used only if you set $DISPLAY in some way.
Example for zip archives:
fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c, echo "No zip to preview:"
Example:
" filter all files ending in .o from the filelist.
:filter /.o$/
Example:
:filter //I
All style values as well as color names are case insensitive.
Available style values (some of them can be combined):
- bold
- underline
- reverse or inverse
- standout
- italic (on unsupported systems becomes reverse)
- combine - add attributes of current group to attributes of the parent in
group hierarchy (see below) instead of replacing them
- none
Available group-name values:
- Win - color of all windows (views, dialogs, menus) and default color for
their content (e.g. regular files in views)
- AuxWin - color of auxiliary areas of windows
- OtherWin - color of inactive pane
- Border - color of vertical parts of the border
- TabLine - tab line color (for 'tabscope' set to "global")
- TabLineSel - color of the tip of selected tab (regardless of 'tabscope')
- TopLine - top line color of the other pane
- TopLineSel - top line color of the current pane
- CmdLine - the command line/status bar color
- ErrorMsg - color of error messages in the status bar
- StatusLine - color of the line above the status bar
- JobLine - color of job line that appears above the status line
- WildMenu - color of the wild menu items
- SuggestBox - color of key suggestion box
- CurrLine - line at cursor position in active view
- OtherLine - line at cursor position in inactive view
- OddLine - color of every second entry line in a pane
- LineNr - line number column of views
- Selected - color of selected files
- Directory - color of directories
- Link - color of symbolic links in the views
- BrokenLink - color of broken symbolic links
- HardLink - color of regular files with more than one hard link
- Socket - color of sockets
- Device - color of block and character devices
- Executable - color of executable files
- Fifo - color of fifo pipes
- CmpMismatch - color of mismatched files in side-by-side comparison by path
- User1..User9 - 9 colors which can be used via %* 'statusline' macro
Available colors:
- -1 or default or none - default or transparent
- black and lightblack
- red and lightred
- green and lightgreen
- yellow and lightyellow
- blue and lightblue
- magenta and lightmagenta
- cyan and lightcyan
- white and lightwhite
- 0-255 - corresponding colors from 256-color palette (for ctermfg and
ctermbg)
- #rrggbb - direct ("gui", "true", 24-bit) color in
hex-notation, each of the three compontents are in the range 0x00 to 0xff
(for guifg and guibg)
Light versions of colors are regular colors with bold attribute set automatically in terminals that have less than 16 colors. So order of arguments of :highlight command is important and it's better to put "cterm" in front of others to prevent it from overwriting attributes set by "ctermfg" or "ctermbg" arguments.
For convenience of color scheme authors xterm-like names for 256
color palette is also supported. The mapping is taken from
http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim
Duplicated entries were altered by adding an underscore followed by numerical
suffix.
0 Black 86 Aquamarine1 172 Orange3
1 Red 87 DarkSlateGray2 173 LightSalmon3_2
2 Green 88 DarkRed_2 174 LightPink3
3 Yellow 89 DeepPink4_2 175 Pink3
4 Blue 90 DarkMagenta 176 Plum3
5 Magenta 91 DarkMagenta_2 177 Violet
6 Cyan 92 DarkViolet 178 Gold3_2
7 White 93 Purple 179 LightGoldenrod3
8 LightBlack 94 Orange4_2 180 Tan
9 LightRed 95 LightPink4 181 MistyRose3
10 LightGreen 96 Plum4 182 Thistle3
11 LightYellow 97 MediumPurple3 183 Plum2
12 LightBlue 98 MediumPurple3_2 184 Yellow3_2
13 LightMagenta 99 SlateBlue1 185 Khaki3
14 LightCyan 100 Yellow4 186 LightGoldenrod2
15 LightWhite 101 Wheat4 187 LightYellow3
16 Grey0 102 Grey53 188 Grey84
17 NavyBlue 103 LightSlateGrey 189 LightSteelBlue1
18 DarkBlue 104 MediumPurple 190 Yellow2
19 Blue3 105 LightSlateBlue 191 DarkOliveGreen1
20 Blue3_2 106 Yellow4_2 192 DarkOliveGreen1_2
21 Blue1 107 DarkOliveGreen3 193 DarkSeaGreen1_2
22 DarkGreen 108 DarkSeaGreen 194 Honeydew2
23 DeepSkyBlue4 109 LightSkyBlue3 195 LightCyan1
24 DeepSkyBlue4_2 110 LightSkyBlue3_2 196 Red1
25 DeepSkyBlue4_3 111 SkyBlue2 197 DeepPink2
26 DodgerBlue3 112 Chartreuse2_2 198 DeepPink1
27 DodgerBlue2 113 DarkOliveGreen3_2 199 DeepPink1_2
28 Green4 114 PaleGreen3_2 200 Magenta2_2
29 SpringGreen4 115 DarkSeaGreen3 201 Magenta1
30 Turquoise4 116 DarkSlateGray3 202 OrangeRed1
31 DeepSkyBlue3 117 SkyBlue1 203 IndianRed1
32 DeepSkyBlue3_2 118 Chartreuse1 204 IndianRed1_2
33 DodgerBlue1 119 LightGreen_2 205 HotPink
34 Green3 120 LightGreen_3 206 HotPink_2
35 SpringGreen3 121 PaleGreen1 207 MediumOrchid1_2
36 DarkCyan 122 Aquamarine1_2 208 DarkOrange
37 LightSeaGreen 123 DarkSlateGray1 209 Salmon1
38 DeepSkyBlue2 124 Red3 210 LightCoral
39 DeepSkyBlue1 125 DeepPink4_3 211 PaleVioletRed1
40 Green3_2 126 MediumVioletRed 212 Orchid2
41 SpringGreen3_2 127 Magenta3 213 Orchid1
42 SpringGreen2 128 DarkViolet_2 214 Orange1
43 Cyan3 129 Purple_2 215 SandyBrown
44 DarkTurquoise 130 DarkOrange3 216 LightSalmon1
45 Turquoise2 131 IndianRed 217 LightPink1
46 Green1 132 HotPink3 218 Pink1
47 SpringGreen2_2 133 MediumOrchid3 219 Plum1
48 SpringGreen1 134 MediumOrchid 220 Gold1
49 MediumSpringGreen 135 MediumPurple2 221 LightGoldenrod2_2
50 Cyan2 136 DarkGoldenrod 222 LightGoldenrod2_3
51 Cyan1 137 LightSalmon3 223 NavajoWhite1
52 DarkRed 138 RosyBrown 224 MistyRose1
53 DeepPink4 139 Grey63 225 Thistle1
54 Purple4 140 MediumPurple2_2 226 Yellow1
55 Purple4_2 141 MediumPurple1 227 LightGoldenrod1
56 Purple3 142 Gold3 228 Khaki1
57 BlueViolet 143 DarkKhaki 229 Wheat1
58 Orange4 144 NavajoWhite3 230 Cornsilk1
59 Grey37 145 Grey69 231 Grey100
60 MediumPurple4 146 LightSteelBlue3 232 Grey3
61 SlateBlue3 147 LightSteelBlue 233 Grey7
62 SlateBlue3_2 148 Yellow3 234 Grey11
63 RoyalBlue1 149 DarkOliveGreen3_3 235 Grey15
64 Chartreuse4 150 DarkSeaGreen3_2 236 Grey19
65 DarkSeaGreen4 151 DarkSeaGreen2 237 Grey23
66 PaleTurquoise4 152 LightCyan3 238 Grey27
67 SteelBlue 153 LightSkyBlue1 239 Grey30
68 SteelBlue3 154 GreenYellow 240 Grey35
69 CornflowerBlue 155 DarkOliveGreen2 241 Grey39
70 Chartreuse3 156 PaleGreen1_2 242 Grey42
71 DarkSeaGreen4_2 157 DarkSeaGreen2_2 243 Grey46
72 CadetBlue 158 DarkSeaGreen1 244 Grey50
73 CadetBlue_2 159 PaleTurquoise1 245 Grey54
74 SkyBlue3 160 Red3_2 246 Grey58
75 SteelBlue1 161 DeepPink3 247 Grey62
76 Chartreuse3_2 162 DeepPink3_2 248 Grey66
77 PaleGreen3 163 Magenta3_2 249 Grey70
78 SeaGreen3 164 Magenta3_3 250 Grey74
79 Aquamarine3 165 Magenta2 251 Grey78
80 MediumTurquoise 166 DarkOrange3_2 252 Grey82
81 SteelBlue1_2 167 IndianRed_2 253 Grey85
82 Chartreuse2 168 HotPink3_2 254 Grey89
83 SeaGreen2 169 HotPink2 255 Grey93
84 SeaGreen1 170 Orchid
85 SeaGreen1_2 171 MediumOrchid1
There are two colors (foreground and background) and only one bold attribute. Thus single bold attribute affects both colors when "reverse" attribute is used in vifm run inside terminal emulator. At the same time linux native console can handle boldness of foreground and background colors independently, but for consistency with terminal emulators this is available only implicitly by using light versions of colors. This behaviour might be changed in the future.
Although vifm supports 256 colors in a sense they are supported by UI drawing library, whether you will be able to use all of them highly depends on your terminal. To set up terminal properly, make sure that $TERM in the environment you run vifm is set to name of 256-color terminal (on *nixes it can also be set via X resources), e.g. xterm-256color. One can find list of available terminal names by listing /usr/lib/terminfo/. Number of colors supported by terminal with current settings can be checked via "tput colors" command.
In order to use 24-bit colors one needs a terminal that supports them, corresponding terminfo record (probably ends in "-direct" like in "xterm-direct") and $TERM pointing to it. When vifm detects direct color support "cterm*" values are ignored for groups which have at least one of "gui*" values set, otherwise they are used after translating via a builtin palette.
Here is the hierarchy of highlight groups, which you need to know
for using transparency:
JobLine
SuggestBox
StatusLine
WildMenu
User1..User9
Border
CmdLine
ErrorMsg
Win
OtherWin
AuxWin
OddLine
File name specific highlights
Directory
Link
BrokenLink
HardLink
Socket
Device
Fifo
Executable
Selected
CurrLine
LineNr (in active pane)
OtherLine
LineNr (in inactive pane)
TopLine
TopLineSel
TabLineSel (for pane tabs)
User1..User9
TabLine
TabLineSel
User1..User9
"none" means default terminal color for highlight groups at the first level of the hierarchy and transparency for all others.
Here file name specific highlights mean those configured via globs ({}) or regular expressions (//). At most one of them is applied per file entry, namely the first that matches file name, hence order of :highlight commands might be important in certain cases.
Example:
if $TERM == 'screen.linux'
highlight CurrLine ctermfg=lightwhite ctermbg=lightblack
elseif $TERM == 'tmux'
highlight CurrLine cterm=reverse ctermfg=black ctermbg=white
else
highlight CurrLine cterm=bold,reverse ctermfg=black ctermbg=white
endif
While many things get reset, some basic UI state and current locations are preserved, including tabs.
Note: the command is called screen for historical reasons (when tmux wasn't yet supported) and might be changed in future releases, or get an alias.
the meaning:
- option - turn option on (for boolean) or print its value (for all
others)
- nooption - turn option off
- invoption - invert option state
- option! - invert option state
- option? - print option value
- option& - reset option to its default value
- option=x or option:x - set option to x
- option+=x - add/append x to option
- option-=x - remove (or subtract) x from option
- option^=x - toggle x presence among values of the option
Option name can be prepended and appended by any number of whitespace characters.
change directory to [count]th next sibling directory after current path using value of global sort option of current pane. "!" enables wrapping.
For example, say, you're at /boot and root listing starts like this:
bin/
boot/
dev/
...
Issuing :siblnext will navigate to /dev.
String can contain \0...\9 to link to capture groups (\0 - all match, \1 - first group, etc.).
Pattern is stored in search history.
Available flags:
To leave tree view go up from its root or use gh at any level of the tree. Any command that changes directory will also do, in particular, `:cd ..`.
Tree structure is incompatible with alternative representations, so values of 'lsview' and 'millerview' options are ignored.
The "depth" argument specifies nesting level on which loading of subdirectories won't happen (they will be folded). Values start at 1.
The ranges implemented include:
2,3 - from second to third file in the list (including it)
% - the entire directory.
. - the current position in the filelist.
$ - the end of the filelist.
't - the mark position t.
Examples:
would delete all files in the directory.
:%delete
:2,4delete
would delete the files in the list positions 2 through 4.
:.,$delete
would delete the files from the current position to the end of the filelist.
:3delete4
would delete the files in the list positions 3, 4, 5, 6.
If a backward range is given :4,2delete - an query message is given and user can chose what to do next.
The builtin commands that accept a range are :d[elete] and :y[ank].
The command macros may be used in user commands.
The following dimensions and coordinates are in characters:
Use %% if you need to put a percent sign in your command.
Note that %i, %Iu, %IU, %m, %M, %n, %q, %s, %S, %u, %U and %v macros are mutually exclusive. Only the last one of them on the command will take effect.
Note that %Pl and %Pz are mutually exclusive. Only the last one of them on the command will take effect.
You can use file name modifiers after %c, %C, %f, %F, %b, %d and %D macros. Supported modifiers are:
See ':h filename-modifiers' in Vim's documentation for the detailed description.
Using %x means expand corresponding macro escaping all characters that have special meaning. And %"x means using of double quotes and escape only backslash and double quote characters, which is more useful on Windows systems.
Position and quantity (if there is any) of %m, %M, %S or %s macros in the command is unimportant. All their occurrences are removed from the resulting command.
%c and %f macros are expanded to file names only, when %C and %F are expanded to full paths. %f and %F follow this in %b too.
%m, %M, %s, %S, %u and %U macros cannot be combined with background mark (" &") as it doesn't make much sense.
Copy and move operation can take a lot of time to proceed. That's why vifm supports backgrounding of this two operations. To run :copy, :move or :delete command in the background just add " &" at the end of a command.
For each background operation a new thread is created. Job cancellation can be requested in the :jobs menu via dd shortcut.
You can see if command is still running in the :jobs menu. Backgrounded commands have progress instead of process id at the line beginning.
Background operations cannot be undone.
Note that cancellation works somewhat different on Windows platform due to different mechanism of break signal propagation. One also might need to use Ctrl-Break shortcut instead of Ctrl-C.
There are two types of operations that can be cancelled:
Note that vifm never terminates applications, it sends SIGINT signal and lets the application quit normally.
When one of set of operations is cancelled (e.g. copying of 5th file of 10 files), further operations are cancelled too. In this case undo history will contain only actually performed operations.
Cancelled operations are indicated by "(cancelled)" suffix appended to information message on statusbar.
File system operations
Currently the following commands can be cancelled: :alink, :chmod, :chown, :clone, :copy, :delete, :mkdir, :move, :restore, :rlink, :touch. File putting (on p/P key) can be cancelled as well. It's not hard to see that these are mainly long-running operations.
Cancelling commands when they are repeated for undo/redo operations is allowed for convenience, but is not recommended as further undo/redo operations might get blocked by side-effects of partially cancelled group of operations.
These commands can't be cancelled: :empty, :rename, :substitute, :tr.
Mounting with FUSE
It's not considered to be an error, so only notification on the status bar is shown.
External application calls
Each of this operations can be cancelled: :apropos, :find, :grep, :locate.
If there is a selection, it's stashed before proceeding further unless file under the cursor is part of that selection. This means that when macros are expanded for :filetype or :filextype programs, `%f` and `%F` become equivalent to `%c` and `%C` respectively if current file is not selected. So you run selection by running one of selected files, otherwise you're running a single file even if there are other selected entries.
When running a selection it must not include broken symbolic links, has to be consistent and set of file handlers must be compatible. Consistency means that selection contains either only directories (including links to them) or only files, but not their mix.
Compatibility is a more sophisticated check, but it's defined in a natural way so that you get what you'd expect. The following properties of selection are taken into account while checking it for compatibility and deciding how to handle it:
:highlight, :filetype, :filextype, :fileviewer commands and 'classify' option support globs, regular expressions and mime types to match file names or their paths.
There are six possible ways to write a single pattern:
First five forms can include leading exclamation mark that negates pattern matching.
The last form is implicitly refers to one of others. :highlight does not accept undecorated form, while :filetype, :filextype, :fileviewer, :select, :unselect and 'classify' treat it as list of name globs.
Path patterns receive absolute path of the file that includes its name component as well.
To combine several patterns (AND them), make sure you're using one of the first five forms and write patterns one after another, like this:
Mind that if you make a mistake the whole string will be treated as the sixth form.
<text/plain>{*.vifm}
:filetype, :filextype and :fileviewer commands accept comma-separated list of patterns instead of a single pattern, thus effectively handling OR operation on them:
Forms that accept comma-separated lists of patterns also process them as lists of alternatives.
<text/plain>{*.vifm},<application/pdf>{*.pdf}
Patterns with regular expressions
Regular expression patterns are case insensitive by default, see description of commands, which might override default behaviour.
Flags of regular expressions mean the following:
- "i" makes filter case insensitive;
- "I" makes filter case sensitive. They can be repeated multiple
times, but the later one takes precedence (e.g. "iiiI" is
equivalent to "I" and "IiIi" is the same as
"i").
There are no implicit `^` or `$`, so make sure to specify them explicitly if the pattern should match the whole name or path.
Patterns with globs
"Globs" section below provides short overview of globs and some important points that one needs to know about them.
Patterns with mime-types
Mime type matching is essentially globs matching applied to mime type of a file instead of its name/path. Note: mime types aren't detected on Windows.
Examples
Associate `evince` to PDF-files only inside `/home/user/downloads/` directory (excluding its subdirectories):
:filextype //^/home/user/downloads/[^/]*.pdf$// evince %f
Globs are always case insensitive as it makes sense in general case.
`*`, `?`, `[` and `]` are treated as special symbols in the pattern. E.g.
matches all files. One can use character classes for escaping, so
:filetype * less %c
:filetype [*] less %c
matches only one file name, the one which contains only asterisk symbol.
`*` means any number of any characters (possibly an empty substring), with one exception: asterisk at the pattern beginning doesn't match dot in the first position. E.g.
associates using of `zip` program to preview all files with `zip` or `jar` extensions as listing of their content, but `.file.zip` won't be matched.
:fileviewer *.zip,*.jar zip -sf %c
`?` means any character at this position. E.g.
calls `file` tool for all files which have exactly one character before their extension (e.g. a.out, b.out).
:fileviewer ?.out file %c
Square brackets designate character class, which means that whole character class matches against any of characters listed in it. For example
makes vifm call `highlight` program to colorize source and header files in C language for a 256-color terminal. Equal command would be
:fileviewer *.[ch] highlight -O xterm256 -s dante --syntax c %c
:fileviewer *.c,*.h highlight -O xterm256 -s dante --syntax c %c
Inside square brackets `^` or `!` can be used for symbol class negotiation and the `-` symbol to set a range. `^` and `!` should appear right after the opening square bracket. For example
:filetype *.[!d]/ inspect_dir
associates `inspect_dir` as additional handler for all directories that have one character extension unless it's "d" letter. And
:filetype [0-9].jpg sxiv
associates `sxiv` picture viewer only for JPEG-files that contain single digit in their name.
If you need to include literal comma, which is normally separates multiple globs, double it.
In addition to being local to views, each such option also has two values:
When this option is enabled, more fine grained control over cursor position is available via 'histcursor' option.
At most one item of each pair takes affect, if both or more are present, only the last one matters. When none of pair's elements are present, the behaviour is default (depends on operating system for path completion and on values of 'ignorecase' and 'smartcase' options for file navigation).
This option doesn't affect completion of :cd command.
Example:
This way ":cd bin" will switch to "~/bin" even if directory named "bin" exists in current directory, while ":cd ./bin" command will ignore value of 'cdpath'.
set cdpath=~
Priority rules:
- file name patterns have priority over type patterns
- file name patterns are matched in left-to-right order of their
appearance in this option
Either {prefix} or {suffix} or both can be omitted (which is the default for all unspecified file types), this means empty {prefix} and/or {suffix}. {prefix} and {suffix} should consist of at most eight characters. Elements are separated by commas. Neither prefixes nor suffixes are part of file names, so they don't affect commands which operate on file names in any way. Comma (',') character can be inserted by doubling it. List of file type names can be found in the description of filetype() function.
Size obtained via ga/gA overwrites this setting so seeing count of files and occasionally size of directories is possible.
Note that empty directories always contain "../" entry regardless of value of this option. "../" disappears at the moment at least one file is created.
item default used for
vborder:c ' ' left, middle and right vertical borders
If value is omitted, its default value is used. Example:
set fillchars=vborder:.
macro value/meaning
%s literal arguments of :find or
list of paths to search in
%A empty or
literal arguments of :find
%a empty or
literal arguments of :find or
predicate followed by escaped arguments of :find
%p empty or
literal arguments of :find or
escaped arguments (parameters) of :find
%u redirect output to custom view instead of showing a menu
%U redirect output to unsorted custom view instead of showing a menu
Predicate in %a is "-name" on *nix and "-iname" on Windows.
If both %u and %U are specified, %U is chosen.
Some macros can be added implicitly:
- if %s isn't present, it's appended
- if neither of %a, %A and %p is present, %a is appended
- if neither of %s, %a, %A and %p is present, %s and %a are appended in
this order
The macros slightly change their meaning depending on format
of :find's arguments:
- if the first argument points to an existing directory, %s is assigned
all arguments while %a, %A and %p are left empty
- otherwise:
- %s is assigned a dot (".") meaning current directory or list
of selected file names, if any
- %a, %A and %p are assigned literal arguments when first argument starts
with a dash ("-"), otherwise %a gets an escaped version of the
arguments with a predicate and %p contains escaped version of the
arguments
Starting with Windows Server 2003 a `where` command is available. One can configure vifm to use it in the following way:
As the syntax of this command is rather limited, one can't use :find command with selection of more than one item because the command ignores all directory paths except for the last one.
set findprg="where /R %s %A"
When using find port on Windows, another option is to setup 'findprg' like this:
set findprg="find %s %a"
If you change this option, vifm won't remount anything. It affects future mounts only. See "Automatic FUSE mounts" section below for more information.
Optional %u or %U macro could be used (if both specified %U is chosen) to force redirection to custom or unsorted custom view respectively.
See 'findprg' option for description of difference between %a and %A.
Example of setup to use ack (http://beyondgrep.com/) instead of grep:
or The Silver Searcher (https://github.com/ggreer/the_silver_searcher):
set grepprg='ack -H -r %i %a %s'
set grepprg='ag --line-numbers %i %a %s'
This option has no effect when 'autochpos' is disabled.
Note that the list is not exhaustive and there are other situations when cursor is positioned automatically.
Optional %u or %U macro could be used (if both specified %U is chosen) to force redirection to custom or unsorted custom view respectively.
The command can be passed the following parameters:
- list -- list media
- mount {device} -- mount a device
- unmount {path} -- unmount given mount point
The output of `list` subcommand is parsed in search of lines
that start with one of the following prefixes:
- device= - specifies device path (e.g., "/dev/sde")
- label= - specifies optional device label (e.g., "Memory
card")
- info= - specifies arbitrary text to display next to device (by
default "[label]" is used, if label is provided)
- mount-point= - specifies a mount point (can be absent or appear more
than once)
All other lines are ignored. Each `device=` starts a new section describing a device which should include two other possible prefixes.
`list` subcommand is assumed to always succeed, while exit code of `mount` and `unmount` is taken into account to determine whether operation was performed successfully.
Configures ls-like view.
item used for
transposed filling view grid by columns rather than by lines
Configures miller view.
item default used for
lsize:num 0 left column
csize:num 1 center column (can't be disabled)
rsize:num 0 right column
rpreview:str dirs right column
*size specifies ratios of columns. Each ratio is in the range from 0 to 100 and values are adjusted to fit the limits. Zero disables a column, but central (main) column can't be disabled.
rpreview specifies what file-system objects should be previewed in the right column and can take two values: dirs (only directories) or all. Both options don't include parent directory ("..").
Example of two-column mode which is useful in combination with :view command:
set milleroptions=lsize:1,csize:2
Tweaks how previewing is done (in quick view, miller view's column and view mode).
item default meaning
graphicsdelay:num 0 delay before drawing graphics (microseconds)
hardgraphicsclear unset redraw screen to get rid of graphics
toptreestats unset show file counts before the tree
graphicsdelay is needed if terminal requires some timeout before it can draw graphics (otherwise it gets lost).
hardgraphicsclear seems to be necessary to get rid of sixel graphics in some terminals, where it otherwise lingers. This can cause flicker on the screen due to erasure followed by redrawing.
External command to be used instead of preview programs configured via :fileviewer command.
Example:
" always show git log in preview of files inside some repository
au DirEnter '~/git-repo/**/*' setl previewprg='git log --color -- %c 2>&1'
nonumber number
norelativenumber | first | 1 first
| second | 2 second
| third | 3 third
relativenumber | 1 first | 1 first
| 0 second |2 second
| 1 third | 1 third
Percent sign can be followed by optional minimum field width. Add '-' before minimum field width if you want field to be right aligned.
Optional blocks are ignored unless at least one macro inside of them is expanded to a non-empty value.
Example:
set rulerformat='%2l-%S%[ +%x%]'
Note that using this option to force interactive mode of the shell is most likely a BAD IDEA. In general interactive host and interactive child shell can't share the same terminal session. You can't even run such a shell in background. Consider writing a wrapper for your shell that preloads aliases and commands without making the shell interactive and ending up using it in a way it was not meant to be used.
Note that this option is ignored when 'shell' is set to PowerShell due to the internal use of `-encodedCommand`.
Alternatively 0, 1 and 2 Vim-like values are also accepted and correspond to "never", "multiple" and "always" respectively.
item value meaning
units: iec Use 1024 byte units (K or KiB, etc.).
See 'iec' option.
si Use 1000 byte units (KB, etc.).
precision: i > 0 How many fraction digits to consider.
{not set} Precision of 1 for integer part < 10,
0 otherwise (provides old behaviour).
space {present} Insert space before unit symbols.
This is the default.
nospace {present} Do not insert space before unit symbols.
Numbers are rounded from zero. Trailing zeros are dropped.
Example:
set sizefmt=units:iec,precision:2,nospace
Example for autofs root /mnt/autofs:
set slowfs+=/mnt/autofs
Note: look for st_atime, st_ctime and st_mtime in "man 2 stat" for more information on time keys.
'+' means ascending sort for this key, and '-' means descending sort.
"dir" key is somewhat similar in this regard but it's added implicitly: when "dir" is not specified, sorting behaves as if it was the first key in the list. That's why if one wants sorting algorithm to mix directories and files, "dir" should be appended to sorting option, for example like this:
or
set sort+=dir
set sort=-size,dir
Value of the option is checked to include dir key and default sorting key (name on *nix, iname on Windows). Here is what happens if one of them is missing:
This option also changes view columns according to primary sorting key set, unless 'viewcolumns' option is not empty.
The regular expressions are used to extract substrings of file names to serve as keys for sorting. It is essentially a way to ignore uninteresting parts of file names during sorting by name.
Each expression should contain at least one group or its value will be considered to be always empty. Also, only the first match of regular expression is processed.
The first group divides list of files into sub-groups, each of which is then sorted by substrings extracted using second regular expression and so on recursively.
Example:
this would group files with "-done" in their names and files with "-todo" separately. On ascending sorting, group containing "-done" would appear before the other one.
set sortgroups=-(todo|done).*
On Windows file properties include the following flags (upper case
means flag is on):
A - archive
H - hidden
I - content isn't indexed
R - readonly
S - system
C - compressed
D - directory
E - encrypted
P - reparse point (e.g. symbolic link)
Z - sparse file
set statusline=" %t%= %A %10u:%-7g %15s %20d %{&sort} "
Example with colors:
highlight User1 ctermbg=yellow
highlight User2 ctermbg=blue ctermfg=white cterm=bold
set statusline="%1* %-26t %2* %= %1* %A %2* %7u:%-7g %1* %-5s %2* %d "
When empty, tab label is set to either tab name for named tabs or to view title (usually current path) for unnamed tabs.
The following macros can appear in the format (see below for what a flag is):
Flag macros are a special kind of macros that always expand to an empty value and are ment to be used inside optional blocks to control their visibility.
Optional blocks are ignored unless at least one macro inside of them is expanded to a non-empty value or is a set flag macro.
" %[(%n)%] -- optional name of the tab
" %[ -- optional description of the view
" %[%T{tree}%] -- mark of tree mode
" %[{%c}%] -- description of custom view
" @ -- just an extra separator before the path
' %]
" %p:t -- tail part of view's location
set tablabel=%[(%n)%]%[%[%T{tree}%]%[{%c}%]@%]%p:t
On *nix, if element ends with "%u", the mark is
replaced with real user ID and permissions are set so that only that
only owner is able to use it.
Note that even this setup is not completely secure when combined
with "%r/" and it's overall safer to keep files in home
directory, but that implies cost of copying files between
partitions.
When new file gets cut (deleted) vifm traverses each element of the option in the order of their appearance and uses first trash directory that it was able to create or that is already writable.
Default value tries to use trash directory per mount point and falls back to ~/.vifm/Trash on failure.
Will attempt to create the directory if it does not exist. See "Trash directory" section below.
Each pane title contains the path of the listed directory. If too large, the path is truncated on the left for the active pane and on the right for the other pane. This can be modified with:
l - truncation is always on the left.
r - truncation is always on the right.
Background flag is ignored in certain context where vifm waits for the editor to finish. Such contexts include any command that spawns editor to change list of file names or a command, with :rename being one example. `-f` is also appended to prevent forking in such cases, so the command needs to handle the flag.
Additionally `+{num}` and `+'call cursor()'` arguments are used to position cursor when location is known.
An example of setting the options for both panes (note :windo command):
windo set viewcolumns=-{name}..,6{size},11{perms}
bmarks - named bookmarks (see :bmark command)
bookmarks - marks, except special ones like '< and '>
tui - state of the user interface (sorting, number of windows, quick
view state, active view)
dhistory - directory history
state - file name and dot filters and terminal multiplexers integration
state
cs - primary color scheme
savedirs - save last visited directory
chistory - command line history
shistory - search history (/ and ? commands)
phistory - prompt history
fhistory - history of local filter (see description of the "="
normal mode
command)
dirstack - directory stack overwrites previous stack, unless stack of
current instance is empty
registers - registers content
tabs - global or pane tabs
options - all options that can be set with the :set command (obsolete)
filetypes - associated programs and viewers (obsolete)
commands - user defined commands (see :command description)
(obsolete)
The option affects Alt-D, Alt-B and Alt-F, but not Ctrl-W. This is intentionally to allow two use cases:
- Moving by WORDS and deletion by words.
- Moving by words and deletion by WORDS.
To get the latter use the following mapping:
Also used for abbreviations.
cnoremap <c-w> <a-b><a-d>
Map arguments
LHS of mappings can be preceded by arguments which take the form of special sequences:
nnoremap <wait> tw :set wrap!<cr>
nnoremap <wait> tn :set number!<cr>
nnoremap <wait> tr :set relativenumber!<cr>
Special sequences
Since it's not easy to enter special characters there are several special sequences that can be used in place of them. They are:
Note that due to the way terminals process their input, several keyboard keys might be mapped to single key code, for example:
Most of the time they are defined consistently and don't cause surprises, but <c-h> and <bs> are treated differently in different environments (although they match each other all the time), that's why they correspond to different keys in vifm. As a consequence, if you map <c-h> or <bs> be sure to repeat the mapping with the other one so that it works in all environments. Alternatively, provide your mapping in one form and add one of the following:
" if mappings with <c-h> in the LHS work
map <c-h> <bs>
" if mappings with <bs> in the LHS work
map <bs> <c-h>
Whitespace
vifm removes whitespace characters at the beginning and end of commands. That's why you may want to use <space> at the end of rhs in mappings. For example:
cmap <f1> man<space>
will put "man " in line when you hit the <f1> key in the command line mode.
Supported expressions is a subset of what VimL provides.
Expression syntax summary, from least to most significant:
expr1 expr2
expr2 || expr2 .. logical OR
expr2 expr3
expr3 && expr3 .. logical AND
expr3 expr4
expr4 == expr4 equal
expr4 != expr4 not equal
expr4 > expr4 greater than
expr4 >= expr4 greater than or equal
expr4 < expr4 smaller than
expr4 <= expr4 smaller than or equal
expr4 expr5
expr5 + expr5 .. number addition
expr5 - expr5 .. number subtraction
expr5 expr6
expr6 . expr6 .. string concatenation
expr6 expr7
- expr6 unary minus
+ expr6 unary plus
! expr6 logical NOT
expr7 number number constant
"string" string constant, \ is special
'string' string constant, ' is doubled
&option option value
$VAR environment variable
v:var builtin variable
function(expr1, ...) function call
(expr1) nested expression
".." indicates that the operations in this level can be concatenated.
expr1
-----
expr2 || expr2
Arguments are converted to numbers before evaluation.
Result is non-zero if at least one of arguments is non-zero.
It's right associative and with short-circuiting, so sub-expressions are evaluated from left to right until result of whole expression is determined (i.e., until first non-zero) or end of the expression.
expr2
-----
expr3 && expr3
Arguments are converted to numbers before evaluation.
Result is non-zero only if both arguments are non-zero.
It's right associative and with short-circuiting, so sub-expressions are evaluated from left to right until result of whole expression is determined (i.e., until first zero) or end of the expression.
expr3
-----
expr4 {cmp} expr4
Compare two expr4 expressions, resulting in a 0 if it evaluates to false or 1 if it evaluates to true.
equal ==
not equal !=
greater than >
greater than or equal >=
smaller than <
smaller than or equal <=
Examples:
'a' == 'a' == 1
'a' > 'b' == 1
'a' == 'b' == 0
'2' > 'b' == 0
2 > 'b' == 1
2 > '1b' == 1
2 > '9b' == 0
-1 == -'1' == 1
0 == '--1' == 1
expr4
-----
expr5 + expr5 .. number addition expr5 - expr5 .. number subtraction
Examples:
1 + 3 - 3 == 1
1 + '2' == 3
expr5
-----
expr6 . expr6 .. string concatenation
Examples:
'a' . 'b' == 'ab'
'aaa' . '' . 'c' == 'aaac'
expr6
-----
- expr6 unary minus
+ expr6 unary plus
! expr6 logical NOT
For '-' the sign of the number is changed.
For '+' the number is unchanged.
For '!' non-zero becomes zero, zero becomes one.
A String will be converted to a Number first.
These operations can be repeated and mixed. Examples:
--9 == 9
---9 == -9
-+9 == 9
!-9 == 0
!'' == 1
!'x' == 0
!!9 == 1
expr7
-----
number number constant
-----
Decimal number. Examples:
0 == 0
0000 == 0
01 == 1
123 == 123
10000 == 10000
string
------
"string" string constant
Note that double quotes are used.
A string constant accepts these special characters:
\b backspace <bs>
\e escape <esc>
\n newline
\r return <cr>
\t tab <tab>
\\ backslash
\" double quote
Examples:
"\"Hello,\tWorld!\""
"Hi,\nthere!"
literal-string
--------------
'string' string constant
Note that single quotes are used.
This string is taken as it is. No backslashes are removed or have a special meaning. The only exception is that two quotes stand for one quote.
Examples:
'All\slashes\are\saved.'
'This string contains doubled single quotes ''here'''
option
------
&option option value (local one is preferred, if exists) &g:option
global option value &l:option local option value
Examples:
echo 'Terminal size: '.&columns.'x'.&lines
if &columns > 100
Any valid option name can be used here (note that "all" in ":set all" is a pseudo option). See ":set options" section above.
environment variable
--------------------
$VAR environment variable
The String value of any environment variable. When it is not defined, the result is an empty string.
Examples:
'This is my $PATH env: ' . $PATH
'vifmrc at ' . $MYVIFMRC . ' is used.'
builtin variable
--------------------
v:var builtin variable
Information exposed by vifm for use in scripting.
v:count
count passed to : command, 0 by default. Can be used in mappings to passthe
count to a different command.
v:count1
same as v:count, but 1 by default.
v:jobcount
number of active jobs (as can be seen in the :jobs menu).
v:session
name of the current session or empty string.
v:servername
See below.
function call
-------------
function(expr1, ...) function call
See "Functions" section below.
Examples:
"'" . filetype('.') . "'"
filetype('.') == 'reg'
expression nesting
------------------
(expr1) nested expression
Groups any other expression of arbitrary complexity enforcing order in which operators are applied.
USAGE RESULT DESCRIPTION
chooseopt({opt}) String Queries choose parameters passed on
startup.
executable({expr}) Integer Checks whether {expr} command available.
expand({expr}) String Expands special keywords in {expr}.
extcached({cache}, {path}, {extcmd})
String Caches output of {extcmd} per {cache} and
{path} combination.
filetype({fnum} [, {resolve}])
String Returns file type from position.
fnameescape({expr}) String Escapes {expr} for use in a :command.
getpanetype() String Returns type of current pane.
has({property}) Integer Checks whether instance has {property}.
layoutis({type}) Integer Checks whether layout is of type {type}.
paneisat({loc}) Integer Checks whether current pane is at {loc}.
system({command}) String Executes shell command and returns its output.
tabpagenr([{arg}]) Integer Returns number of current or last tab.
term({command}) String Like system(), but for interactive commands.
chooseopt({opt})
Retrieves values of options related to file choosing. {opt} can be
one of:
files returns argument of --choose-files or empty string
dir returns argument of --choose-dir or empty string
cmd returns argument of --on-choose or empty string
delimiter returns argument of --delimiter or the default one (\n)
executable({expr})
If {expr} is absolute or relative path, checks whether path destination exists and refers to an executable, otherwise checks whether command named {expr} is present in directories listed in $PATH. Checks for various executable extensions on Windows. Returns boolean value describing result of the check.
Example:
" use custom default viewer script if it's available and installed
" in predefined system directory, otherwise try to find it elsewhere
if executable('/usr/local/bin/defviewer')
fileview * /usr/local/bin/defviewer %c
else
if executable('defviewer')
fileview * defviewer %c
endif
endif
expand({expr})
Expands environment variables and macros in {expr} just like it's done for command-line commands. Returns a string. See "Command macros" section above.
Examples:
" percent sign
:echo expand('%%')
" the last part of directory name of the other pane
:echo expand('%D:t')
" $PATH environment variable (same as `:echo $PATH`)
:echo expand('$PATH')
extcached({cache}, {path}, {extcmd})
Caches value of {extcmd} external command automatically updating it as necessary based on monitoring change date of a {path}. The cache is invalidated when file or its meta-data is updated. A single path can have multiple caches associated with it.
{path} value is normalized, but symbolic links in it aren't resolved.
Example:
" display number and size of blocks actually used by a file or directory
set statusline+=" Uses: %{ extcached('uses',
expand('%c'),
expand('stat --format=%%bx%%B %c')) }"
filetype({fnum} [, {resolve}])
The result is a string, which represents file type and is one of
the list:
exe executables
reg regular files
link symbolic links
broken broken symbolic links (appears only when resolving)
dir directories
char character devices
block block devices
fifo pipes
sock *nix domain sockets
? unknown file type (should not normally happen) or
non-file (pseudo-entries in compare view)
The result can also be an empty string in case of invalid argument.
Parameter {fnum} can have following values:
- '.' to get type of file under the cursor in the active pane
- numerical value base 1 to get type of file on specified line number
Optional parameter {resolve} is treated as a boolean and specifies whether symbolic links should be resolved.
fnameescape({expr})
Escapes parameter to make it suitable for use as an argument of a :command. List of escaped characters includes %, which is doubled.
Usage example:
" navigate to most recently modified file in current directory
execute 'goto' fnameescape(system('ls -t | head -1'))
getpanetype()
Retrieves string describing type of current pane. Possible return
values:
regular regular file listing of some directory
custom custom file list (%u)
very-custom very custom file list (%U)
tree tree view
has({property})
Allows examining internal parameters from scripts to e.g. figure
out environment in which application is running. Returns 1 if property is
true/present, otherwise 0 is returned. Currently the following properties
are supported (anything else will yield 0):
unix runs in *nix-like environment (including Cygwin)
win runs on Windows
Usage example:
" skip user/group on Windows
if !has('win')
let $RIGHTS = '%10u:%-7g '
endif
execute 'set' 'statusline=" %t%= %A '.$RIGHTS.'%15E %20d "'
layoutis({type})
Checks whether current interface layout is {type} or not, where
{type} can be:
only single-pane mode
split double-pane mode (either vertical or horizontal split)
vsplit vertical split (left and right panes)
hsplit horizontal split (top and bottom panes)
Usage example:
" automatically split vertically before enabling preview
:nnoremap w :if layoutis('only') | vsplit | endif | view!<cr>
paneisat({loc})
Checks whether position of active pane in current layout matches
one of the following locations:
top pane reaches top border
bottom pane reaches bottom border
left pane reaches left border
right pane reaches right border
system({command})
Runs the command in shell and returns its output (joined standard output and standard error streams). All trailing newline characters are stripped to allow easy appending to command output. Ctrl-C should interrupt the command.
Use this function to consume output of external commands that don't require user interaction and term() for interactive commands that make use of terminal and are capable of handling stream redirection.
Usage example:
" command to enter .git/ directory of git-repository (when ran inside one)
command! cdgit :execute 'cd' fnameescape(system('git rev-parse --git-dir'))
tabpagenr([{arg}])
When called without arguments returns number of current tab page base one.
When called with "$" as an argument returns number of the last tab page base one, which is the same as number of tabs.
term({command})
Same as system() function, but user interface is shutdown during the execution of the command, which makes sure that external interactive applications won't affect the way terminal is used by vifm.
Usage example:
" command to change directory by picking it via fzf
command! fzfcd :execute 'cd'
fnameescape(term('find -type d | fzf 2> /dev/tty'))
When navigating to some path from a menu there is a difference in end location depending on whether path has trailing slash or not. Files normally don't have trailing slashes so "file/" won't work and one can only navigate to a file anyway. On the other hand with directories there are two options: navigate to a directory or inside of it. To allow both use cases, the first one is used on paths like "dir" and the second one for "dir/".
Commands
:range navigate to a menu line.
General
j, Ctrl-N - move down.
k, Ctrl-P - move up.
Enter, l - select and exit the menu.
Ctrl-L - redraw the menu.
Escape, Ctrl-C, ZZ, ZQ, q - quit.
In all menus
The following set of keys has the same meaning as in normal mode.
Ctrl-B, Ctrl-F
Ctrl-D, Ctrl-U
Ctrl-E, Ctrl-Y
/, ?
n, N
[count]G, [count]gg
H, M, L
zb, zt, zz
zh - scroll menu items [count] characters to the right.
zl - scroll menu items [count] characters to the left.
zH - scroll menu items half of screen width characters to the right.
zL - scroll menu items half of screen width characters to the left.
: - enter command line mode for menus (currently only :exi[t], :q[uit], :x[it] and :{range} are supported).
b - interpret content of the menu as list of paths and use it to
create custom view in place of previously active pane. See "Custom
views" section below.
B - same as above, but creates unsorted view.
v - load menu content into quickfix list of the editor (Vim compatible by assumption) or if list doesn't have separators after file names (colons) open each line as a file name.
Below is description of additional commands and reaction on selection in some menus and dialogs.
Apropos menu
Selecting menu item runs man on a given topic. Menu won't be closed automatically to allow view several pages one by one.
Command-line mode abbreviations menu
Type dd on an abbreviation to remove it.
c leaves menu preserving file selection and inserts right-hand side of selected command into command-line.
Color scheme menu
Selecting name of a color scheme applies it the same way as if ":colorscheme <name>" was executed on the command-line.
Commands menu
Selecting command executes it with empty arguments (%a).
dd on a command to remove.
Marks menu
Selecting mark navigates to it.
dd on a mark to remove it.
Bookmarks menu
Selecting a bookmark navigates to it.
Type dd on a bookmark to remove it.
gf and e also work to make it more convenient to bookmark files.
Trash (:lstrash) menu
r on a file name to restore it from trash.
dd deletes file under the cursor.
Trashes (:trashes) menu
dd empties selected trash in background.
Directory history and Trashes menus
Selecting directory name will change directory of the current view as if :cd command was used.
Directory stack menu
Selecting directory name will rotate stack to put selected directory pair at the top of the stack.
File (:file) menu
Commands from vifmrc or typed in command-line are displayed above empty line. All commands below empty line are from .desktop files.
c leaves menu preserving file selection and inserts command after :! in command-line mode.
Grep, find, locate, bookmarks and user menu with navigation (%M macro)
gf - navigate previously active view to currently selected item. Leaves menu mode except for grep menu. Pressing Enter key has the same effect.
e - open selected path in the editor, stays in menu mode.
c - leave menu preserving file selection and insert file name after :! in command-line mode.
User menu without navigation (%m macro)
c leaves menu preserving file selection and inserts whole line after :! in command-line mode.
Grep menu
Selecting file (via Enter or l key) opens it in editor set by 'vicmd' at given line number. Menu won't be closed automatically to allow viewing more than one result.
See above for "gf" and "e" keys description.
Command-line history menu
Selecting an item executes it as command-line command, search query or local filter.
c leaves menu preserving file selection and inserts line into command-line of appropriate kind.
Volumes menu
Selecting a drive navigates previously active pane to the root of that drive.
Fileinfo dialog
Enter, q - close dialog
Sort dialog
h, Space - switch ascending/descending.
q - close dialog
One shortcut per sorting key (see the dialog).
Attributes (permissions or properties) dialog
h, Space - check/uncheck.
q - close dialog
r - (*nix only) (un)set all read bits
w - (*nix only) (un)set all write bits
x - (*nix only) (un)set all execute bits
s - (*nix only) (un)set all special (SetUID, SetGID, Sticky) bits
e - (*nix only) (un)set recursion (for directories only)
Item states:
Jobs menu
dd requests cancellation of job under cursor. The job won't be removed from the list, but marked as being cancelled (if cancellation was successfully requested). A message will pop up if the job has already stopped. Note that on Windows cancelling external programs like this might not work, because their parent shell doesn't have any windows.
e key displays errors of selected job if any were collected. They are displayed in a new menu, but you can get back to jobs menu by pressing h.
Undolist menu
r - reset undo position to group under the cursor.
Media menu
Selecting a device either mounts (if it wasn't mounted yet) or navigates to its first mount point.
Selecting a mount point navigates to it.
Selecting "not mounted" line causes mounting.
Selecting any other line does nothing.
r - reload the list.
m - mount/unmount device (cursor should be positioned on lines under device information).
[ - put cursor on the previous device.
] - put cursor on the next device.
Plugins menu
e - display log messages of selected plugin if any were collected. They are displayed in a new menu, but you can get back to plugins menu by pressing h.
gf - navigate previously active view to the location of selected plugin. Leaves menu mode.
Definition
Normally file views contain list of files from a single directory, but sometimes it's useful to populate them with list of files that do not belong to the same directory, which is what custom views are for.
Presentation
Custom views are still related to directory they were in before custom list was loaded. Path to that directory (original directory) can be seen in the title of a custom view.
Files in same directory have to be named differently, this doesn't hold for custom views thus seeing just file names might be rather confusing. In order to give an idea where files come from and when possible, relative paths to original directory of the view is displayed, otherwise full path is used instead.
Custom views normally don't contain any inexistent files.
Navigation
Custom views have some differences related to navigation in regular views.
gf - acts similar to gf on symbolic links and navigates to the
file at its real
location.
h - go to closes parent node in tree view, otherwise return to the original directory.
gh - return to the original directory.
Opening ".." entry also causes return to the original directory.
History
Custom list exists only while it's visible, once left one can't return to it, so there is no appearances of it in any history.
Filters
Only local filter affects content of the view. This is intentional, presumably if one loads list, precisely that list should be displayed (except for inexistent paths, which are ignored).
Search
Although directory names are visible in listing, they are not searchable. Only file names are taken into account (might be changed in future, searching whole lines seems quite reasonable).
Sorting
Contrary to search sorting by name works on whole visible part of file path.
Highlight
Whole file name is highlighted as one entity, even if there are directory elements.
Updates
Reloads can occur, though they are not automatic due to files being scattered among different places. On a reload, inexistent files are removed and meta-data of all other files is updated.
Once custom view forgets about the file, it won't add it back even if it's created again. So not seeing file previously affected by an operation, which was undone is normal.
Operations
All operations that add files are forbidden for custom views. For example, moving/copying/putting files into a custom view doesn't work, because it doesn't make much sense.
On the other hand, operations that use files of a custom view as a source (e.g. yanking, copying, moving file from custom view, deletion) and operations that modify names are all allowed.
Kinds
:compare can produce four different results depending on
arguments:
- single compare view (ofone and either listall or listdups);
- single custom view (ofone and listunique);
- two compare views (ofboth and either listall or listdups);
- two custom views (ofboth and listunique).
The first two display files of one file system tree. Here duplicates are files that have at least one copy in the same tree. The other two kinds of operation compare two trees, in which duplicates are files that are found in both trees.
Lists of unique files are presented in custom views because there is no file grouping to preserve as all file ids are guaranteed to be distinct.
Creation
Arguments passed to :compare form four categories each with its own prefix and is responsible for particular property of operation.
Which files to compare:
- ofboth - compares files of two panes against each other;
- ofone - compares files of the same directory.
How files are compared:
- byname - by their name only;
- bysize - only by their size;
- bycontents - by data they contain (combination of size and hash of small
chunk of contents is used as first approximation, so don't worry too much
about large files).
Which files to display:
- listall - all files;
- listunique - unique files only;
- listdups - only duplicated files.
How results are grouped (has no effect if "ofone"
specified):
- groupids - files considered identical are always adjacent in output;
- grouppaths - file system ordering is preferred (this also enables
displaying identically named files as mismatches).
Which files to omit:
- skipempty - ignore empty files.
Each argument can appear multiple times, the rightmost one of the group is considered. Arguments alter default behaviour instead of substituting it.
Examples
The defaults corresponds to probably the most common use case of comparing files in two trees with grouping by paths, so the following are equivalent:
:compare
:compare bycontents grouppaths
:compare bycontents listall ofboth grouppaths
Another use case is to find duplicates in the current sub-tree:
:compare listdups ofone
The following command lists files that are unique to each pane:
:compare listunique
Look
The view can't switch to ls-like view as it's unable to display diff-like data.
Comparison views have second column displaying id of the file, files with same id are considered to be equal. The view columns configuration is predefined.
Behaviour
When two views are being compared against each other the following
changes to the regular behaviour apply:
- views are scrolled synchronously (as if 'scrollbind' was set);
- views' cursors are synchronized;
- local filtering is disabled (its results wouldn't be meaningful);
- zd excludes groups of adjacent identical files, 1zd gives usual behaviour;
- sorting is permanently disabled (ordering is fixed);
- removed files hide their counter pairs;
- exiting one of the views terminates the other immediately;
- renaming files isn't blocked, but isn't taken into account and might
require regeneration of comparison;
- entries which indicate absence of equivalent file have empty names and can
be matched as such;
- when unique files of both views are listed custom views can be empty, this
absence of unique files is stated clearly.
One compare view has similar properties (those that are applicable for single pane).
Files are gathered in this way:
- recursively starting at current location of the view;
- dot files are excluded if view hides them at the moment of comparison, file
name filters are obeyed as well so you end up comparing what you see;
- directories are not taken into account;
- symbolic links to directories are ignored.
On startup vifm determines several variables that are used during execution. They are determined in the order they appear below.
On *nix systems $HOME is normally present and used as is. On
Windows systems vifm tries to find correct home directory in the following
order:
- $HOME variable;
- $USERPROFILE variable (on Windows only);
- a combination of $HOMEDRIVE and $HOMEPATH variables (on Windows only).
vifm tries to find correct configuration directory by checking the
following places:
- $VIFM variable;
- parent directory of the executable file (on Windows only);
- $HOME/.vifm directory;
- $APPDATA/Vifm directory (on Windows only);
- $XDG_CONFIG_HOME/vifm directory;
- $HOME/.config/vifm directory.
vifm tries to find correct configuration file by checking the
following places:
- $MYVIFMRC variable;
- vifmrc in parent directory of the executable file (on Windows only);
- $VIFM/vifmrc file.
See "Startup" section above for the explanations on $VIFM and $MYVIFMRC.
The vifmrc file contains commands that will be executed on vifm startup. There are two such files: global and local. Global one is at {prefix}/etc/vifm/vifmrc, see $MYVIFMRC variable description for the search algorithm used to find local vifmrc. Global vifmrc is loaded before the local one, so that the later one can redefine anything configured globally.
Use vifmrc to set settings, mappings, filetypes etc. To use multi line commands precede each next line with a slash (whitespace before slash is ignored, but all spaces at the end of the lines are saved). For example:
set
\smartcase
equals "setsmartcase". When
set<space here>
\ smartcase
equals "set smartcase".
The $VIFM/vifminfo file contains generic state of the application. You can control what is stored in vifminfo by setting 'vifminfo' option. Vifm always writes this file on exit unless 'vifminfo' option is empty. Marks, bookmarks, commands, histories, filetypes, fileviewers and registers in the file are merged with vifm configuration (which has bigger priority).
Generally, runtime configuration has bigger priority during merging, but there are some exceptions:
The $VIFM/scripts directory can contain shell scripts. vifm modifies its PATH environment variable to let user run those scripts without specifying full path. All subdirectories of the $VIFM/scripts will be added to PATH too. Script in a subdirectory overlaps script with the same name in all its parent directories.
The $VIFM/colors/ and {prefix}/etc/vifm/colors/ directories contain color schemes. Available color schemes are searched in that order, so on name conflict the one in $VIFM/colors/ wins.
Each color scheme should have ".vifm" extension. This wasn't the case before and for this reason the following rules apply during lookup:
Sessions provide a way to have multiple persistent runtime configurations. Think of them as second-level vifminfo files in addition to the first-level one used by all sessions. In other words, they aren't a replacement for vifminfo file that exists without sessions, but an addition to it. One can empty 'vifminfo' option and rely solely on sessions, but in practice one might want to share some state among instances in different sessions or have an "out-of-sessions" state for tasks that don't deserve a session of their own.
This leads to a two-level structure where data in session files has higher priority than data in vifminfo files (where this makes sense) following the same rules that merging of vifminfo file obeys. In addition to that, history items from session files are never ordered before history items from vifminfo file.
Format
Sessions have the format of vifminfo files, they do not consist of sequence of command-line commands and are not meant to be sourced via :source command.
Storage and naming
`$VIFM/sessions/` directory serves as a storage for sessions. Consequently names should be valid filenames. The structure of the storage is flat meaning that there are no subdirectories, that's why names of sessions can't contain slashes.
Usage model
Contrary to Vim, vifm automates basic management of sessions. You can start, switch, stop or delete a session using builtin means.
Current session is saved at the same time vifminfo is saved (on normal exits or explicitly on :write command) and right before switching to another session. To avoid saving in those cases use :session command to detach (without saving) from a session before proceeding.
Related topics
Commands: :session, :delsession
Options: 'sessionoptions'
Variables: v:session
vifm has a builtin support of automated FUSE file system mounts. It is implemented using file associations mechanism. To enable automated mounts, one needs to use a specially formatted program line in filetype or filextype commands. These use special macros, which differ from macros in commands unrelated to FUSE. Currently three formats are supported:
1) FUSE_MOUNT This format should be used in case when all information needed for mounting all files of a particular type is the same. E.g. mounting of tar files don't require any file specific options.
Format line:
FUSE_MOUNT|mounter %SOURCE_FILE %DESTINATION_DIR [%FOREGROUND]
Example filetype command:
:filetype FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR
2) FUSE_MOUNT2 This format allows one to use specially formatted files to perform mounting and is useful for mounting remotes, for example remote file systems over ftp or ssh.
Format line:
FUSE_MOUNT2|mounter %PARAM %DESTINATION_DIR [%FOREGROUND]
Example filetype command:
:filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR
Example file content:
root@127.0.0.1:/
3) FUSE_MOUNT3
This format is equivalent to FUSE_MOUNT, but omits unmounting. It is useful for cases, when unmounting isn't needed, like when using AVFS.
Example :filetype command:
:filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz,*.deb
\ {Mount with avfs}
\ FUSE_MOUNT3|mount-avfs %DESTINATION_DIR %SOURCE_FILE
Example `mount-avfs` helper script:
#!/bin/sh
dest=$1
file=$2
rmdir "$dest"
ln -s "$HOME/.avfs$file#/" "$dest"
All % macros are expanded by vifm at runtime and have the
following meaning:
- %SOURCE_FILE is replaced by full path to selected file;
- %DESTINATION_DIR is replaced by full path to mount directory, which is
created by vifm basing on the value of 'fusehome' option;
- %PARAM value is filled from the first line of file (whole line), though in
the future it can be changed to whole file content;
- %FOREGROUND means that you want to run mount command as a regular command
(required to be able to provide input for communication with mounter in
interactive way).
%FOREGROUND is an optional macro. Other macros are not mandatory, but mount commands likely won't work without them.
%CLEAR is obsolete name of %FOREGROUND, which is still supported, but might be removed in future. Its use is discouraged.
Unlike macros elsewhere, these are recognized only if they appear at the end of a command or are followed by a space. There is no way to escape % either. These are historical limitations, which might be addressed in the future.
The mounted FUSE file systems will be automatically unmounted in two cases:
vifm supports displaying of file list view in two different ways:
The look is local for each view and can be chosen by changing value of the 'lsview' boolean option.
Depending on view look some of keys change their meaning to allow more natural cursor moving. This concerns mainly h, j, k, l and other similar navigation keys.
Also some of options can be ignored if they don't affect view displaying in selected look. For example value of 'viewcolumns' when 'lsview' is set.
When this view look is enabled by setting 'lsview' option on, vifm will display files in multiple columns. Number of columns depends on the length of the longest file name present in current directory of the view. Whole file list is automatically reflowed on directory change, terminal or view resize.
View looks close to output of `ls -x` command, so files are listed left to right in rows.
In this mode file manipulation commands (e.g. d) don't work line-wise like they do in Vim, since such operations would be uncommon for file manipulation tasks. Thus, for example, dd will remove only current file.
By default the view is filled by lines, 'lsoptions' can be used to get filling by columns.
Note that tree-view and compare view inhibit ls-like view.
View columns are described by a comma-separated list of column
descriptions, each of which has the following format
[ '-' | '*' ] [ fw ( [ '.' tw ] | '%' ) ] '{' type | literal '}' '.'{0,3}
where fw stands for full width, tw stands for text width, bar is logical or,
square brackets denote optional parts and curly braces define range of
repetitions for a symbol that precedes them.
So it basically consists of four parts:
1. Optional alignment specifier
2. Optional width specifier
3. Mandatory column name
4. Optional cropping specifier
Alignment specifier
It's an optional minus or asterisk sign as the first symbol of the string.
Specifies type of text alignment within a column. Three types are supported:
set viewcolumns=-{name}
set viewcolumns={name}
It's like left alignment, but when the text is bigger than the column, the alignment is made at the right (so the part of the field is always visible).
set viewcolumns=*{name}
Width specifier
It's a number followed by a percent sign, two numbers (second one should be less than or equal to the first one) separated with a dot or a single number.
Specifies column width and its units. There are three size types:
set viewcolumns=-100{name},20.15{ext}
results in two columns with lengths of 100 and 20 and a reserved space of five characters on the left of second column.
set viewcolumns=-80%{name},15%{ext},5%{mtime}
results in three columns with lengths of 80/100, 15/100 and 5/100 of view width.
set viewcolumns=-{name},{ext},{mtime}
results in three columns with length of one third of view width. There is no size adjustment to content, since it will slow down rendering.
Columns of different sizing types can be freely mixed in one view. Though sometimes some of columns can be seen partly or be completely invisible if there is not enough space to display them.
Column contents
This is usually a sorting key surrounded with curly braces, e.g.
{name},{ext},{mtime}
{name} and {iname} types are the same and present both for consistency with 'sort' option.
Following types don't have corresponding sorting keys:
Empty curly braces ({}) are replaced with the default secondary column for primary sort key. So after the next command view will be displayed almost as if 'viewcolumns' is empty, but adding ellipsis for long file names:
set viewcolumns=-{name}..,6{}.
The last kind of column value is a string literal. The literal is used as a column value for every row. The syntax is "{#literal}", for example:
3{#},{#|},{# | }
This can be used to draw column separators. Mind that for convenience literals have different defaults: truncation and automatically determined absolute size, which is what you usually want for them. Example:
set viewcolumns=*{name}..,{#|},6{}.
Cropping specifier
It's from one to three dots after closing curly brace in column format.
Specifies type of text truncation if it doesn't fit in the column. Currently three types are supported:
set viewcolumns=-{name}.
results in truncation of names that are too long too fit in the view.
set viewcolumns=-{name}..
results in that ellipsis are added at the end of too long file names.
set viewcolumns=-{name}...,{ext}
results in that long file names can partially be written on the ext column.
The color schemes in vifm can be applied in two different ways:
Both types are set using :colorscheme command, but of different forms:
Look of different parts of the TUI (Text User Interface) is determined in this way:
There might be a set of local color schemes because they are structured hierarchically according to file system structure. For example, having the following piece of file system:
Two color schemes:
~
`-- bin
|
`-- my
And these three commands in the vifmrc file:
# ~/.vifm/colors/for_bin
highlight Win cterm=none ctermfg=white ctermbg=red
highlight CurrLine cterm=none ctermfg=red ctermbg=black
# ~/.vifm/colors/for_bin_my
highlight CurrLine cterm=none ctermfg=green ctermbg=black
File list will look in the following way for each level:
colorscheme Default
colorscheme for_bin ~/bin
colorscheme for_bin_my ~/bin/my
vifm has support of trash directory, which is used as temporary storage for deleted files or files that were cut. Using trash is controlled by the 'trash' option, and exact path to the trash can be set with 'trashdir' option. Trash directory in vifm differs from the system-wide one by default, because of possible incompatibilities of storing deleted files among different file managers. But one can set 'trashdir' to "~/.local/share/Trash" to use a "standard" trash directory.
There are two scenarios of using trash in vifm:
The first scenario uses deletion ("d") operations to put files to trash and put ("p") operations to restore files from trash directory. Note that such operations move files to and from trash directory, which can be long term operations in case of different partitions or remote drives mounted locally.
The second scenario uses deletion ("d") operations for moving files to trash directory and :empty command-line command to purge all previously deleted files.
Deletion and put operations depend on registers, which can point to files in trash directory. Normally, there are no nonexistent files in registers, but vifm doesn't keep track of modifications under trash directory, so one shouldn't expect value of registers to be absolutely correct if trash directory was modified not by operation that are meant for it. But this won't lead to any issues with operations, since they ignore nonexistent files.
vifm supports remote execution of command-line mode commands, remote changing of directories and expression evaluation. This is possible using --remote and --remote-expr command-line arguments.
To execute a command remotely combine --remote argument with -c <command> or +<command>. For example:
vifm --remote -c 'cd /'
vifm --remote '+cd /'
To change directory not using command-line mode commands one can specify paths right after --remote argument, like this:
vifm --remote /
vifm --remote ~
vifm --remote /usr/bin /tmp
Evaluating expression remotely might be useful to query information about an instance, for example its location:
vifm --remote-expr 'expand("%d")'
If there are several running instances, the target can be specified with --server-name option (otherwise, the first one lexicographically is used):
vifm --server-name work --remote ~/work/project
List of names of running instances can be obtained via --server-list option. Name of the current one is available via v:servername.
When an editor is run to edit list of file names, contents of the temporary file has the following format:
If an operation was rejected due to issues with file names, next time you'll see the following in this order:
Mind that Vim plugin will extract list of original names and show them in a vertical split.
You can cancel renaming by removing all non-comments from the buffer. This also erases information about previous edits.
Plugin for using vifm in vim as a file selector.
Commands:
:EditVifm select a file or files to open in the current buffer.
:Vifm alias for :EditVifm.
:SplitVifm split buffer and select a file or files to open.
:VsplitVifm vertically split buffer and select a file or files to open.
:DiffVifm select a file or files to compare to the current file with
:vert diffsplit.
:TabVifm select a file or files to open in tabs.
Each command accepts up to two arguments: left pane directory and right pane directory. After arguments are checked, vifm process is spawned in a special "file-picker" mode. To pick files just open them either by pressing l, i or Enter keys, or by running :edit command. If no files are selected, file under the cursor is opened, otherwise whole selection is passed to the plugin and opened in vim.
The plugin have only two settings. It's a string variable named g:vifm_term to let user specify command to run GUI terminal. By default it's equal to 'xterm -e'. And another string variable named g:vifm_exec, which equals "vifm" by default and specifies path to vifm's executable. To pass arguments to vifm use g:vifm_exec_args, which is empty by default.
To use the plugin copy the vifm.vim file to either the system wide vim/plugin directory or into ~/.vim/plugin.
If you would prefer not to use the plugin and it is in the system wide plugin directory add
let loaded_vifm=1
to your ~/.vimrc file.
The following command names are reserved and shouldn't be used for user commands.
g[lobal]
v[global]
These environment variables are valid inside vifm and also can be used to configure it by setting some of them before running vifm.
When $MYVIFMRC isn't set, it's made as $VIFM/vifmrc (exception for Windows: vifmrc in the same directory as vifm.exe has higher priority than $VIFM/vifmrc).
See "Startup" section above for more details.
vifm-convert-dircolors(1), vifm-pause(1)
Website: https://vifm.info/
Wiki: https://wiki.vifm.info/
Esperanto translation of the documentation by Sebastian Cyprych:
http://cyprych.neostrada.pl/tekstoj/komputiloj/vifm-help.eo.html
Vifm was written by ksteen <ksteen@users.sourceforge.net>
And currently is developed by xaizek <xaizek@posteo.net>
September 29, 2021 | vifm 0.12 |