VIFM(1)
๐ VIFM(1) โ the vi file manager, but make it a group chat ๐
General Commands Manual ยท VIFM(1)
โจ NAME โจ
vifm โ vi file manager ๐ธ
โจ SYNOPSIS โจ
vifm [OPTION]...
vifm [OPTION]... path
vifm [OPTION]... path path
โจ DESCRIPTION โจ
Okay bestie, listen. Vifm is an ncurses based file manager with vi like keybindings. ๐ฆ
If you already use vi, this is your moment โ vifm gives you complete keyboard control over your files without having to learn a whole new set of commands. No cap. Your muscle memory is already iconic, we're just pointing it at your filesystem now. ๐
โจ OPTIONS โจ
So vifm starts in the current directory unless you hand it a different directory on the command line, OR unless the 'vifminfo' option includes "savedirs" โ in which case the last visited directories get used as the defaults. iykyk. ๐
-โ Read a list of files from the standard input stream and compose a custom view out of them (peep the "Custom views" section). The current working directory is used as the base for relative paths.<path>โ Starts Vifm in the specified path.<path> <path>โ Starts Vifm in the specified paths.
Specifying two directories triggers split view even when vifm was in single-view mode when you finished your last run. Wanna suppress that behaviour? Just put the :only command in your vifmrc file. ๐
When only one path argument shows up on the command line, the left/top pane is automatically set as the current view. Slay.
Paths to files are also allowed, in case you want vifm to start with some archive already opened. ๐
--select <path>โ Open the parent directory of the given path and select the specified file inside it.-fโ Makes vifm, instead of opening files, write the selection to$VIFM/vimfilesand quit.--choose-files <path>|-โ Sets the output file to write the selection into on exit, instead of opening files.-means standard output. Use an empty value to disable it.--choose-dir <path>|-โ Sets the output file to write the last visited directory into on exit.-means standard output. Use an empty value to disable it.--delimiter <delimiter>โ Sets the separator for the list of file paths written out by vifm. An empty value means the null character. Default is the new line character.--on-choose <command>โ Sets a command to be executed on the selected files instead of opening them. The command may use any of the macros described in the "Command macros" section below. The command is executed once for the whole selection. โจ--plugins-dir <path>โ An additional plugins directory (and yes, it can appear multiple times). The last one added has the highest priority.--logging[=<startup log path>]โ Log some operational details to$XDG_DATA_HOME/vifm/logor$VIFM/log. If the optional startup log path is specified and permissions allow one to open it for writing, then logging of early initialization (before configuration directories are determined) gets put there.--server-listโ List available server names and exit.--server-name <name>โ Name of the target or of this instance (sequential numbers get appended on a name conflict).--remoteโ Sends the rest of the command line to another instance of vifm.--server-nameis treated just like any other argument and should precede--remoteon the command line. When there is no server, it quits silently. There is no limit on how many arguments can be processed. You can combine--remotewith-c <command>or+<command>to execute commands in an already running instance of vifm. See also the "Client-Server" section below. ๐ฅ--remote-exprโ Passes an expression to the vifm server and prints the result. See also the "Client-Server" section below.-c <command>or+<command>โ Run command-line mode<command>on startup. Commands in these arguments are executed in the order they appear on the command line. Commands with spaces or special symbols must be enclosed in double or single quotes, or all special symbols should be escaped (the exact syntax strongly depends on your shell, bestie, so be careful ๐ญ). The"+"argument is equivalent to"$"and thus picks the last item of of the view.--help,-hโ Show a brief command summary and exit vifm.--version,-vโ Show version information and quit.--no-configsโ Skip reading vifmrc and vifminfo. Chaos mode, honestly.
See the "Startup" section below for the explanations on $VIFM.
โจ General keys โจ
- Ctrl+C or Escape โ cancel most operations (see the "Cancellation" section below), and clear all selected files. On top of that, Escape also aborts waiting for more input when the current input isn't enough to determine the shortcut. ๐
- Ctrl+L โ clear and redraw the screen. Can also reload the file list in appropriate modes (like normal and visual). Fresh screen, fresh vibe. โจ
โจ Basic Movement โจ
The basic vi key bindings are used to move through the files and pop-up windows. Yes, the ones you already know. Iconic behaviour. ๐
k,gk, orCtrl-Pโ move the cursor up one line.j,gjorCtrl-Nโ move the cursor down one line.hโ when'lsview'is off, move up one directory (moves to the parent directory node in tree view); otherwise move left one file.lโ when'lsview'is off, move into a directory or launch a file; otherwise move right one file. See the "Selection" section below.ggโ move to the first line of the file list.Gโ move to the last line in the file list.ghโ go up one directory regardless of view representation (regular, ls-like). Can also be used to leave custom views, including tree view. ๐ฆglorEnterโ enter a directory or launch a file. See the "Selection" section below.Hโ move to the first file in the window.Mโ move to the file in the middle of the window.Lโ move to the last file in the window.Ctrl-ForPage Downโ move forward one page.Ctrl-BorPage Upโ move back one page.Ctrl-Dโ jump back one half page.Ctrl-Uโ jump forward one half page.n%โ move to the file that isnpercent from the top of the list (for example25%).0or^โ move the cursor to the first column. See the'lsview'option description.$โ move the cursor to the last column. See the'lsview'option description.Spaceโ switch file lists.gtโ switch to the next tab (wrapping around). ๐{n}gtโ switch to the tab number{n}(wrapping around).gTโ switch to the previous tab (wrapping around).{n}gTโ switch to the{n}-th previous tab.
โจ Movement with Count โจ
Most movement commands also accept a count โ 12j would move down 12 files. Math is giving efficiency. ๐งฎโจ
[count]%โ move to percent of the file list.[count]jโ move down[count]files.[count]kโ move up[count]files.[count]Gor[count]ggโ move to list position[count].[count]hโ go up[count]directories.
โจ Scrolling panes โจ
ztโ redraw the pane with the file at the top of the list.zzโ redraw the pane with the file in the center of the list.zbโ redraw the pane with the file at the bottom of the list.Ctrl-Eโ scroll the pane one line down or column right (in transposed ls-like view).Ctrl-Yโ scroll the pane one line up or column left (in transposed ls-like view).
โจ Pane manipulation โจ
Heads up: the second character can be entered with or without the Control key. So flexible of it. ๐
Ctrl-W Hโ move the pane to the far left.Ctrl-W Jโ move the pane to the very bottom.Ctrl-W Kโ move the pane to the very top.Ctrl-W Lโ move the pane to the far right.Ctrl-W hโ switch to the left pane.Ctrl-W jโ switch to the pane below.Ctrl-W kโ switch to the pane above.Ctrl-W lโ switch to the right pane.Ctrl-W bโ switch to the bottom-right window.Ctrl-W tโ switch to the top-left window.Ctrl-W pโ switch to the previous window.Ctrl-W wโ switch to the other pane.Ctrl-W oโ leave only one pane.Ctrl-W sโ split the window horizontally.Ctrl-W vโ split the window vertically.Ctrl-W xโ exchange panes.Ctrl-W zโ quit the preview pane or view modes.Ctrl-W -โ decrease the size of the view by count.Ctrl-W +โ increase the size of the view by count.Ctrl-W <โ decrease the size of the view by count.Ctrl-W >โ increase the size of the view by count.Ctrl-W |โ set the current view size to count.Ctrl-W _โ set the current view size to count.Ctrl-W =โ make the size of two views equal.
For Ctrl-W +, Ctrl-W -, Ctrl-W <, Ctrl-W >, Ctrl-W | and Ctrl-W _ commands, a 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 the window size by 4 lines or columns. Math ate that one. ๐ฅ
Ctrl-W | and Ctrl-W _ maximise the current view by default.
โจ Marks โจ
Marks are set the same way as they are in vi. Classic. ๐
You can use these characters for marks [a-z][A-Z][0-9].
m[a-z][A-Z][0-9]โ set a mark for the file at the current cursor position.'[a-z][A-Z][0-9]โ navigate to the file set for the mark.
There are also several special marks that can't be set manually:
'(single quote) โ previously visited directory of the view, thus hitting''allows switching between two last locations. Time travel, lowkey. โณ<โ the first file of the last visually selected block.>โ the last file of the last visually selected block.
๐ Searching ๐
okay bestie, searching is literally how you find your files, no cap. Here's the tea: ๐
/regular expression patternโ search for files matching regular expression in forward direction and advance cursor to next match./โ perform forward search with top item of search pattern history. it's giving "reuse that last search" energy. โจ?regular expression patternโ search for files matching regular expression in backward direction and advance cursor to previous match.?โ perform backward search with top item of search pattern history.
Trailing slash for directories is taken into account, so /\/ searches for directories and symbolic links to directories. At the moment // works too, but this can change in the future, so consider escaping the slash if not typing pattern by hand. โ ๏ธ
Matches are automatically selected if 'hlsearch' is set. Enabling 'incsearch' makes search interactive. 'ignorecase' and 'smartcase' options affect case sensitivity of search queries as well as local filter and other things detailed in the description of 'caseoptions'. ๐ธ
[count]nโ go to the next file matching last search pattern. Takes last search direction into account.[count]Nโ go to the previous file matching last search pattern. Takes last search direction into account.
If 'hlsearch' option is set, hitting n/N to perform a search and go to a matching item can reset existing selection in normal mode. It happens when there are no prior search results (i.e., no files with highlighting of the matched part), otherwise the selection is left as is. Resetting search matches in any way (like running :nohlsearch or pressing Escape) will force the search next time n/N is pressed and cause matching files to be selected. ๐ญ
See also "Regular expressions" section.
[count]f[character]โ search forward for file with[character]as first character in name. Search wraps around the end of the list.[count]F[character]โ search backward for file with[character]as first character in name. Search wraps around the end of the list.[count];โ find the next match offorF.[count],โ find the previous match offorF.
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. ๐
๐๏ธ File Filters ๐๏ธ
There are three basic file filters, bestie:
- dot files filter (does not affect
.and..special directories, whose appearance is controlled by the'dotdirs'option), see'dotfiles'option; - permanent filter;
- local filter (see description of the
=normal mode command).
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:
- one edited explicitly via
:filtercommand; - another one which is edited implicitly via
zfshortcut.
Files are tested against both parts and a match counts if at least one of the parts matched.
Each file list has its own copy of each filter.
Filtered files are not checked in / search or :commands.
Files and directories are filtered separately. This is done by appending a slash to a directory name before testing whether it matches the filter. Examples:
" 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\/?$/
See also "Regular expressions" and "Patterns" sections.
The basic Vim folding key bindings are used for managing filters.
zaโ toggle visibility of dot files.zoโ show dot files.zmโ hide dot files.zfโ add selected files to permanent filter.zOโ reset permanent filter.zRโ save and reset all filters.zrโ clear local filter.zMโ restore all filters (undoes lastzR).zdโ exclude selection or current file from a custom view. Does nothing for regular view. For tree view excluding directory excludes that sub-tree. For compare viewszdhides group of adjacent identical files, count can be specified as 1 to exclude just single file or selected items instead. Files excluded this way are not counted as filtered out and can't be returned unless view is reloaded.=regular expressionโ only keep files matching the regular expression. This is called a local filter. Whether view is updated as regular expression is changed depends on the value of the'incsearch'option. This kind of filter is automatically reset when directory is changed.
๐ณ Tree-related Keys ๐ณ
While some of the keys make sense outside of tree-view, they are most useful in trees. ๐ฒ
[zโ go to first sibling of current entry.]zโ go to last sibling of current entry.zjโ go to next directory sibling of current entry or do nothing.zkโ go to previous directory sibling of current entry or do nothing.zxโ toggle fold under the cursor or parent entry of the current file if cursor is not on a directory.
โจ Other Normal Mode Keys โจ
[count]:โ pops you into command line mode, bestie. And[count]generates a range, so you can aim it at a whole bunch of stuff at once. ๐qโ opens an external editor so you can type out a command-line command in comfort. Full deets live in the "Command line editing" section. ๐q/โ same idea, but it prompts for a search pattern to search in the forward direction. See "Command line editing" for the juicy bits.q?โ external editor prompt for a search pattern to search in the backward direction. Also in "Command line editing".q=โ external editor prompt for a filter pattern. Also "Command line editing". Heads up though: unlike the otherq{x}commands, this one does not work in Visual mode. ๐ญ[count]!!and[count]!<selector>โ drop into command line mode with an already-entered!command.[count]modifies the range.Ctrl-Oโ go backwards through the directory history of the current view. Nonexistent directories are automatically skipped, so no sad dead ends. ๐ฆCtrl-Iโ depends on your vibe! If'cpoptions'contains the"t"flag, then<tab>and<c-i>switch the active pane just like<space>does. Otherwise it goes forward through the directory history of the current view. Nonexistent directories get skipped automatically either way. โจShift-Tabโ enter view mode. Only works after you've activated the view pane with the:viewcommand though, so set that up first. ๐gaโ calculate directory size. It uses cached directory sizes whenever it can, for better performance. Special case alert: calculating the size of the".."entry actually calculates the size of the current directory. ๐gAโ likega, but forces an update. It ignores the old stored values of directory sizes. No stale numbers here.- If the file under your cursor is selected, then each selected item gets processed. Otherwise only the current file is updated. iykyk. ๐
gfโ find the link destination. It's likelwith'followlinks'off, except it also finds directories. On Windows it additionally follows.lnkfiles. ๐gFโ same asgf, but it resolves the final path of the whole chain of symbolic links. Deep dive energy.grโ only for MS-Windows. Same as thelkey, but it tries to run the program with administrative privileges. ๐avโ go into visual mode for updating the current selection; any existing selection is preserved. Nothing gets lost.gvโ go into visual mode, restoring the last selection. The comeback era. โจ[reg]gsโ if a register is present, then all the files listed in that register that are visible in the current view get selected.
When no register is specified, it restores the last selection saved for this view (kinda like what gv does, but for visual mode selection). When you leave a directory, its saved selection is remembered for that path, and visiting the directory again restores it. Selection is remembered for up to 10 distinct file-system locations. ๐พ
gu<selector>โ make the names of selected files lowercase.[count]guuand[count]guguโ make the names of[count]files starting from the current one lowercase. Without[count], only the current file is affected. ๐ซถgU<selector>โ make the names of selected files uppercase. LOUD. ๐ข[count]gUUand[count]gUgUโ make the names of[count]files starting from the current one uppercase. Without[count], only the current file gets the treatment.eโ explore the file in the current pane.iโ handle the file, even if it's an executable and the'runexec'option is set. Chaos prevention, iconic. ๐cwโ "change word" โ used to rename a file or files. If multiple files are selected, it behaves as the:renamecommand run without arguments. ๐cWโ "change WORD" โ used to change only the name of the file, without the extension. So the extension stays untouched, periodt.clโ change link target. If multiple files are selected, an editor is spawned to edit paths. โ๏ธcoโ only for *nix. Change file owner.cgโ only for *nix. Change file group.[count]cpโ change file attributes (permissions on *nix and properties on Windows). If[count]is specified, it's treated as a numerical argument for a non-recursivechmodcommand, of the form[0-7]{3,4}. See the "Menus and dialogs" section for controls. ๐ง[count]Cโ clone file(s)[count]times. Duplication glitch but make it legal. ๐ฏ[reg][count]ddโ move files to the trash directory if the'trash'option is set, otherwise delete them permanently. See the "Trash directory" section below. ๐๏ธ
When "s" is present in 'cpoptions', it operates on selected files or, if there's no selection, the current one. When that flag isn't set, it always operates on the current file only.
[reg]d[count]<selector>โ likedd, but it accepts motions/selectors. Flexible queen. ๐[count]DDorD[count]<selector>โ likeddandd<selector>, but it always omits the trash directory (even when the'trash'option is set). Affected by the"s"flag in'cpoptions'.[reg][count]Yor[reg][count]yyโ yank files. ๐
When "s" is present in 'cpoptions', it operates on selected files or, if there's no selection, the current one. When the flag isn't set, it always operates on the current file only.
[reg]y[count]<selector>โ yank files specified by a motion/selector.[reg]pโ copy yanked files to the current directory, or move the files to the current directory if they were deleted withddor:d[elete], or if the files were yanked from the trash directory. See the "Trash directory" and "File copying" sections below. ๐[reg]Pโ move the last yanked files. The advantage of usingPinstead ofdfollowed bypis thatPmoves files only once. That's not a big deal when you're moving files within the same file system your home directory is on, but usingPto move files on some other file system (or file systems โ say you want to move files from fs1 to fs2 and your home is on fs3) can save you real time. โฑ๏ธ[reg]alโ put symbolic links with absolute paths.[reg]rlโ put symbolic links with relative paths.tโ select or unselect (tag) the current file. Tagging era. ๐ท๏ธuโ undo the last change. The classic.Ctrl-Rโ redo the last change. โจdpโ in a compare view of the"ofboth grouppaths"kind, this makes corresponding entries of the other pane equal to the current one. If at least one file is selected, the command processes the selection; otherwise it processes the current file.
The semantics go like this:
- nothing is done for identical entries
- if a file is missing in the current view, its pair gets removed
- if a file is missing or differs in the other view, it's replaced
- file pairs are defined by matching relative paths
File removal obeys the 'trash' option. When that option is enabled, the operation can be undone/redone (although the results won't be visible automatically, so don't panic).
Unlike in Vim, this operation is performed on a single line rather than a set of adjacent changes. ๐คฏ
doโ same asdp, but it applies the changes in the opposite direction. ๐vorVโ enter visual mode, clearing the current selection.[count]Ctrl-Aโ increment the first number in the file name by[count](1 by default). Math but make it fashion. ๐ข[count]Ctrl-Xโ decrement the first number in the file name by[count](1 by default).ZQโ same as:quit!. No saving, no regrets.ZZโ same as:quit..โ repeat the last command-line command (not normal mode command) of this run. It does nothing right after startup or after a:restartcommand. The command doesn't depend on command-line history, so it can be used even with history completely disabled. ๐(โ go to the previous group. Groups are defined by the primary sorting key. Fornameandiname, members of each group have the same first letter; for all other sorting keys, vifm uses size, uid, ... group-together energy. ๐ธ)โ go to the next group. See the(key description above.{โ speeds up navigation to the closest previous entry of the opposite type, by moving to the first file backwards when the cursor is on a directory, and to the first directory backwards when the cursor is on a file. It's essentially a special case of(that's locked on"dirs". ๐ฏ}โ same as{, but in the forward direction.[cโ go to the previous mismatched entry in directory comparison view, orโฆ do nothing. ngl, it's giving "no thoughts".]cโ go to the next mismatched entry in directory comparison view, or do nothing.[dโ go to the previous directory entry, or do nothing.]dโ go to the next directory entry, or do nothing.[rโ same as:siblprev.]rโ same as:siblnext.[Rโ same as:siblprev!.]Rโ same as:siblnext!.[sโ go to the previous selected entry, or do nothing.]sโ go to the next selected entry, or do nothing.[Sโ same as[s, but it wraps. ๐]Sโ same as]s, but it wraps. ๐
๐ Using Count ๐
You can use a count with commands like yy, bestie. It's not just motions that get to have all the fun.
[count]yyโ yankcountfiles starting from the current cursor position downward.
Or you can use a count with motions passed to y, d or D, like this:
d[count]jโ delete(count + 1)files starting from the current cursor position downward. Yes, that's count plus one, don't @ me. ๐
๐ Registers ๐
vifm supports multiple registers to temporarily store lists of yanked and/or deleted files. Think of them as little backpacks for your file lists. ๐
Registers are specified by pressing the double quote key followed by a register name, before you type the command. Count is specified after the register name. By default, commands use the unnamed register, which has double quote as its name. ๐
Though all commands accept registers, most commands ignore them (for example, H or Ctrl-U). Rude, honestly. Other commands fill a register, append new files to it, or use it as a source of a list of files.
Presently vifm supports ", _, a-z and A-Z characters as register names. โจ
As mentioned above, " is the unnamed register and has the special meaning of being the default register. Every time a named register (a-z and A-Z) is used, the unnamed register is updated to contain the same list of files. So it's always keeping receipts.
_ is the black hole register. It can be used for writing, but its list is always empty. Nothing goes in, nothing comes out. ๐ณ๏ธ
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 ones aren't โ so uppercase ones should be used to append new files to the existing file list of the corresponding lowercase register (A for a, B for b, ...). Big letter, big collection. ๐
Registers contain each file at most once. Nonexistent files are dropped from them. In particular, registers can be changed on the :empty command if they include files under the trash directory (see the "Trash directory" section below). ๐๏ธ
Example time:
"a2yy
puts names of two files to register a (and to the unnamed register),
"Add
removes one file and appends its name to register a (and to the unnamed register),
p or "ap or "Ap
inserts previously yanked and deleted files into the current directory. ๐ซถ
โจ SELECTORS โจ
y, d, D, !, gu and gU commands accept selectors, bestie ๐. You can combine them with any of the selectors below to quickly remove or yank a whole bunch of files at once. It's giving "I don't have time to click through 400 files" energy, and honestly? Respect.
Most of the selectors are just like vi motions: j, k, gg, G, H, L, M, %, f, F, ;, comma, ', ^, 0 and $. But there are some additional ones too ๐
aโ all files in current view. the whole roster. every single one.sโ selected files.Sโ all files except selected.
Examples, because examples are the moment:
djโ delete file under cursor and one below;d2jโ delete file under cursor and two below;y6ggโ yank all files from cursor position to 6th file in the list.
And here's the spicy part ๐ถ๏ธ โ when you pass a count to the whole command and its selector, they get multiplied. So:
2d2jโ delete file under cursor and four below;2djโ delete file under cursor and two below;2y6ggโ yank all files from cursor position to 12th file in the list.
Not me doing mental math in the file manager ๐ math really is everywhere fr fr.
๐ VISUAL MODE ๐
Visual mode has two generic operating submodes, and yes you need to know both:
- plain selection as it is in Vim;
- selection editing submode.
Both submodes select files in the range (let's call it the "selection region" โจ) from the cursor position at which visual mode was started, all the way to the current cursor position. Either end of the range can be adjusted by switching the active one via o or O keys and then updating cursor position via regular cursor motion keys. Heads up though: after the initial cursor position is altered in this way it cannot be restored. no take-backs, that's the vibe.
Plain Vim-like visual mode starts by clearing any selection. If the mode is then aborted (via Escape, CTRL-C, v or V), the original selection is not restored automatically. Rude, I know ๐ญ Contrary to it, selection editing preserves previously selected files and restores them in case the mode is aborted. And when you accept a selection by performing an operation on the selected items (e.g., by yanking them via y), the cursor moves to the top of the current selection region โ not to the top-most selected file of the view. Important distinction, don't get got ๐ซถ
Selection editing submode supports three types of editing (the status bar indicates which one is currently active):
- append โ amends selection by selecting elements in the selection region;
- remove โ amends selection by deselecting elements in the selection region;
- invert โ amends selection by inverting selection of elements in the selection region.
No matter how activated, selection editing starts with the "append" operation active. The operations can be cycled through (in the order given above) via CTRL-G. round robin slay ๐
Almost all normal mode keys work in visual mode, but instead of accepting selectors they operate on selected items. iconic behaviour honestly.
Enterโ save selection and go back to normal mode not moving cursor.avโ leave visual mode if in amending mode (restores previous selection), otherwise switch to amending selection mode.gvโ restore previous visual selection.v,V,Ctrl-CorEscapeโ leave visual mode if not in amending mode, otherwise switch to normal visual selection.Ctrl-Gโ switch type of amending by round robin scheme: append -> remove -> invert.:โ enter command line mode. Selection is cleared on leaving the mode.oโ switch active selection bound.Oโ switch active selection bound.gu,uโ make names of selected files lowercase.gU,Uโ make names of selected files uppercase.clโ change target of symbolic link(s).cwโ same as running:renamecommand without arguments.
๐ฆ VIEW MODE ๐ฆ
This mode tries to imitate the less program, bestie. The list of builtin shortcuts can be found below, and you can customize shortcuts using :qmap, :qnoremap and :qunmap command-line commands. personalized pager era ๐
Shift-Tab,Tab,q,Q,ZZโ return to normal mode.[count]e,[count]Ctrl-E,[count]j,[count]Ctrl-N,[count]Enterโ scroll forward one line (or[count]lines).[count]y,[count]Ctrl-Y,[count]k,[count]Ctrl-K,[count]Ctrl-Pโ scroll backward one line (or[count]lines).[count]f,[count]Ctrl-F,[count]Ctrl-V,[count]Spaceโ scroll forward one window (or[count]lines).[count]b,[count]Ctrl-B,[count]Alt-Vโ scroll backward one window (or[count]lines).[count]zโ scroll forward one window (and set window to[count]).[count]wโ scroll backward one window (and set window to[count]).[count]Alt-Spaceโ scroll forward one window, but don't stop at end-of-file.[count]d,[count]Ctrl-Dโ scroll forward one half-window (and set half-window to[count]).[count]u,[count]Ctrl-Uโ scroll backward one half-window (and set half-window to[count]).r,Ctrl-R,Ctrl-Lโ repaint screen.Rโ reload view preserving scroll position.Fโ toggle automatic forwarding. Roughly equivalent to periodic file reload and scrolling to the bottom. The behaviour is similar totail -For F key inless. lowkey the same thing, highkey obsessed.aโ switch to the next viewer. Does nothing for preview constructed via%qmacro.Aโ switch to the previous viewer. Does nothing for preview constructed via%qmacro.iโ toggle raw mode (ignoring of defined viewers). Does nothing for preview constructed via%qmacro.[count]/patternโ search forward for ([count]โth) matching line.[count]?patternโ search backward for ([count]โth) matching line.[count]nโ repeat previous search (for[count]โth occurrence).[count]Nโ repeat previous search in reverse direction (for[count]โth occurrence).[count]g,[count]<,[count]Alt-<โ scroll to the first line of the file (or line[count]).[count]G,[count]>,[count]Alt->โ scroll to the last line of the file (or line[count]).[count]p,[count]%โ scroll to the beginning of the file (or N percent into file).vโ invoke an editor to edit the current file being viewed. The command for editing is taken from the'vicmd'or'vixcmd'option value and extended with middle line number prepended by a plus sign and name of the current file.
All "Ctrl-W x" keys work the same way as in Normal mode. Active mode is automatically changed on navigating among windows. And when less-like mode activated on file preview is left using one of the "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 the previously stored state in it). the memory of it all โจ main character state preservation fr.
๐ COMMAND LINE MODE ๐
These keys are available in all submodes of the command line mode: command, search, prompt and filtering. equal opportunity keys.
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. tragic but true ๐ญ
Esc,Ctrl-Cโ leave command line mode, cancels input. Cancelled input is saved into appropriate history and can be recalled later.Ctrl-M,Enterโ execute command and leave command line mode.Ctrl-I,Tabโ complete command or its argument on editing of a:command, complete file names in file name prompts, move cursor onto the next search match in file search prompt (including in navigation) when'incsearch'is set.Shift-Tabโ complete in reverse order or move cursor onto the previous file search match.Ctrl-_โ stop completion and restore original input.Ctrl-B,Leftโ move cursor to the left.Ctrl-F,Rightโ move cursor to the right.Ctrl-A,Homeโ go to line beginning.Ctrl-E,Endโ go to line end.Alt-Bโ go to the beginning of previous word.Alt-Fโ go to the end of next word.Ctrl-Uโ remove characters from cursor position till the beginning of line.Ctrl-Kโ remove characters from cursor position till the end of line.Ctrl-H,Backspaceโ remove character before the cursor.Ctrl-D,Deleteโ remove character under the cursor.Ctrl-Wโ remove characters from cursor position till the beginning of previous word.Alt-Dโ remove characters from cursor position till the beginning of next word.Ctrl-Tโ swap the order of current and previous character and move cursor forward or, if cursor past the end of line, swap the order of two last characters in the line.Alt-.โ insert last part of previous command to current cursor position. Each next call will insert last part of older command.Ctrl-Gโ edit command-line content in external editor. See "Command line editing" section for details.Ctrl-Nโ recall more recent command-line from history.Ctrl-Pโ recall older command-line from history.Upโ recall more recent command-line from history, that begins as the current command-line.Downโ recall older command-line from history, that begins as the current command-line.Ctrl-]โ trigger abbreviation expansion.Ctrl-R =โ insert result of evaluating an expression. Expression is to be entered via nested command-line prompt (where this key does nothing). Expansion of an erroneous expression is empty.
tiny heads up ๐ that last one is a nested-prompt situation โ if you're already in the nested prompt, Ctrl-R = just does nothing. no drama.
๐ Fast navigation ๐
Okay so picture this: you're cruising around the directory tree and you want it to feel like teleporting. From a search prompt or a local filter prompt you can dip into a special form of command-line mode. Once you're in, hitting Enter opens whatever directory is currently selected and wipes the prompt clean so you're ready for the next chunk of the path. ๐ And if the thing under your cursor is a file? It just opens it and the mode is done. Iconic.
This behaviour is baked right into command-line mode, but heads up: it does not update input histories, it does not expand abbreviations, and it redefines some of the mode's mappings โ all so you get fast file-system zooming instead of stinky command-line editing. When it's on, the prompt gets a "nav" prefix. ๐
You can turn this on by default for search with a mapping like:
nnoremap / /<c-y>
- Ctrl-Y โ enter navigation mode. Only works for search and local filter that were started from a normal mode, and only when
'incsearch'is set (setting'wrapscan'too is nice to have for search). - Ctrl-Y โ return to a regular command-line mode.
- Enter, Right โ either enter a directory under the cursor without leaving the mode and clear the prompt, or leave the mode for files. If
'navoptions'specifies"open:all", a file under the cursor gets opened after leaving the mode. - Ctrl-O, Left โ go to parent directory.
- Ctrl-J โ leave the mode without undoing cursor position or filter state.
- Ctrl-N, Down โ move view cursor down.
- Ctrl-P, Up โ move view cursor up.
- Page Down โ scroll view down.
- Page Up โ scroll view up.
- Home โ move view cursor to the first item.
- End โ move view cursor to the last item.
๐ Pasting special values ๐
The shortcuts below insert specific values right into your current cursor position. The last key of every shortcut tells you what it inserts โ it's giving mnemonic:
c- [c]urrent filed- [d]irectory pathe- [e]xtension of a file namer- [r]oot part of a file namet- [t]ail part of directory patha- [a]utomatic filterm- [m]anual filter=- local filter, which is bound to=in normal mode
Values tied to the filelist in the current pane are yours through the Ctrl-X prefix, while values from the other pane have a doubled Ctrl-X as their prefix (doubled Ctrl-X is presumably easier to type than uppercase letters โ and it's still easy to remap the keys to match names of similar macros, so slay).
- Ctrl-X c โ name of the current file of the active pane.
- Ctrl-X d โ path to the current directory of the active pane.
- Ctrl-X e โ extension of the current file of the active pane.
- Ctrl-X r โ name root of current file of the active pane.
- Ctrl-X t โ the last component of path to the current directory of the active pane.
- Ctrl-X Ctrl-X c โ name of the current file of the inactive pane.
- Ctrl-X Ctrl-X d โ path to the current directory of the inactive pane.
- Ctrl-X Ctrl-X e โ extension of the current file of the inactive pane.
- Ctrl-X Ctrl-X r โ name root of current file of the inactive pane.
- Ctrl-X Ctrl-X t โ the last component of path to the current directory of the inactive pane.
- Ctrl-X a โ value of implicit permanent filter (old name
"automatic") of the active pane. - Ctrl-X m โ value of explicit permanent filter (old name
"manual") of the active pane. - Ctrl-X = โ value of local filter of the active pane.
- Ctrl-X / โ last pattern from search history.
โจ Command line editing โจ
vifm has a little superpower: you can edit several kinds of data โ the stuff you'd normally edit in command-line mode โ inside an external editor (using the command given by the 'vicmd' or 'vixcmd' option). This wins in at least two ways:
- you get the full, unfiltered power of Vim to edit text ๐ง
- finding and reusing history entries actually becomes possible ๐ฅ
This facility is supported by four input submodes of the command-line:
- command;
- forward search;
- backward search;
- file rename (see the description of
cwandcWnormal mode keys).
You fire up external-editor editing of the command-line with the Ctrl-G shortcut. And you can do basically the same from Normal and Visual modes using the q:, q/ and q? commands. Obsessed.
The temporary file created for editing your line has this exact structure:
- First line, which is either empty or contains text already entered in command-line.
- 2nd and all other lines with history items starting with the most recent one. Altering this lines in any way won't change history items stored by vifm.
Once the editing application closes, the first line of the file is taken as the result of the operation โ that's when the application returns a zero exit code. If the application returns an error (see :cquit command in Vim), then all the edits you made to the file are ignored, but the initial value of the first line gets saved in the appropriate history. ๐ญ
๐ค More Mode ๐ค
This is the mode that shows up when the status bar content is so big it doesn't fit on the screen anymore. You can clock it by the "-- More --" message sitting at the bottom. Ngl it's giving "you asked for too much info, bestie".
These keys work here:
- Enter, Ctrl-J, j or Down โ scroll one line down.
- Backspace, k or Up โ scroll one line up.
- d โ scroll one page (half of a screen) down.
- u โ scroll one page (half of a screen) up.
- Space, f or PageDown โ scroll down a screen.
- b or PageUp โ scroll up a screen.
- G โ scroll to the bottom.
- g โ scroll to the top.
- q, Escape or Ctrl-C โ quit the mode.
- : โ switch to command-line mode.
๐ Commands ๐
Commands are executed with :command_name<Enter> โ that's the whole vibe.
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 a double quote symbol, and only the last line of a multi-line command can contain such a comment. Heads up though: not all commands support inline comments, because it's not always possible to identify one unambiguously:
- the syntax conflicts with names of registers
- the syntax conflicts with quoting arguments to commands
- mapping/abbreviation commands can expand to arbitrary sequences which can look like a comment without being one
Most of the commands have two forms: the complete one and the short one. Example:
:noh[lsearch]
This means the complete command is nohlsearch, and the short one is noh. Bestie math. ๐
Parsing of the text after the colon is based on quoting and escaping rules. These rules determine how Vifm splits the entered text into arguments. Note: some commands, such as :echo, interpret their arguments as expressions, which use their own syntax (see "Expression syntax").
Supported mechanisms:
- single quotes
'...'โ the content is taken literally. Backslash escaping does not work inside. However,''inside single quotes is replaced with'(same as in Vim). Everything between the quotes becomes a single argument. - double quotes
"..."โ also form a single argument. A backslash inside double quotes escapes the next character (for example,\"becomes a quote,\\becomes a backslash). Some Cโstyle escape sequences are interpreted (\a,\b,\f,\n,\r,\t,\v).
Example:
:echo "a b c
output:
a b c "x"
- backslash escaping
\โ outside quotes, it allows including spaces, quotes, or a backslash into an argument. Works similarly in double quotes and does not work inside single quotes.
Example (visible behavior):
:command Foo touch a b
defines the Foo command with a single argument: a b
Calling it:
:Foo
creates a file named: a b
After processing quotes and backslashes, most commands split the line into arguments by whitespace. Some commands (such as :substitute or :tr) can use custom characters as separators.
Most of the command-line commands completely reset selection in the current view. But there are a few exceptions, so mark these down:
:invert smost likely leaves some files selected;:viewcommand;:normalcommand (when it doesn't leave command-line mode);:ifand:elsecommands don't affect selection on successful execution.
'|' can be used to separate commands, so you can drop multiple commands in one line. If you want to use '|' inside an argument, precede it with '\'.
These commands see '|' as part of their arguments even when it's escaped:
:[range]!:amap:anoremap:autocmd:cabbrev:cmap:cnoreabbrev:cnoremap:command:dmap:dnoremap:filetype:fileviewer:filextype:keepsel:map:mmap:mnoremap:nmap:nnoremap:noremap:normal:qmap:qnoremap:vmap:vnoremap:wincmd:windo:wingo: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
:[count]
:number
move to the file number.
:12 would move to the 12th file in the list.
:0 moves to the top of the list.
:$ moves to the bottom of the list.
:[count]command
The only builtin :[count]command are :[count]d[elete] and :[count]y[ank].
:d3 would delete three files starting at the current file position moving down.
:3d would delete one file at the third line in the list.
:command [args]
:[range]!program
execute command via shell. Accepts macros.
:[range]!command &
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 the ampersand symbol โ if you omit it, the command will be run in the background using job control of your shell.
Accepts macros.
:!!
:[range]!!command
same as :!, but pauses before returning.
:!! โ repeat the last command.
:alink
:[range]alink[!?]
create absolute symbolic links to files in directory of inactive view. With "?" prompts for destination file names in an editor. "!" forces overwrite. ๐ฅ
:[range]alink[!]
:[range]alink[!] pathโ makes absolute symlinks to the files, and drops them into the directory you name as path (absolute, or relative to the directory of the inactive view). โจ:[range]alink[!] name1 name2...โ makes absolute symlinks of the files in the other view's directory, giving each next link the matching name from your argument list. ๐:[range]alink[!?] -skip ...โ bestie just go read the "-skip parameter" section down below, it's all explained there.
:apropos
:apropos keyword...โ builds a menu out of whatever theaproposcommand hands back. Pick an item and it opens that man page. By default it leans on the externalaproposutility, and you can customize that by changing the value of the'aproposprg'option. Want controls? "Menus and dialogs" section, go go go. ๐ฅ:aproposโ re-runs the last:aproposyou did. periodt. (and yes bb, this form is literally just hanging out way down here next to the autocommands โ I am keeping it exactly where the page puts it, don't @ me ๐)
:autocmd
:au[tocmd] {event} {pat} {cmd}โ registers an autocommand for {event}, which can be:DirEnterโ triggered after the directory is changed
Event name is case insensitive. ๐ฆ
{pat} is a comma-separated list of modified globs patterns, and it can contain tilde or environment variables. All paths use slash (/) as the directory separator. The pattern can start with a !, which negates it. Patterns with no slashes in them get matched against the last item of the path only (like "dir" in "/path/dir"). A literal comma is entered by doubling it. And there are two modifications to how globs match, bestie:
*โ never matches a slash (so it can stand for a single directory level)**โ matches any character (so it can match a path of arbitrary depth)
{cmd} is a :command, or several of them separated with |. ๐
Examples of patterns, icymi:
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 that 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
:au[tocmd] [{event}] [{pat}]โ lists the autocommands that match the given event-pattern combo. {event} and {pat} can both be omitted to list all autocommands. To list any autocommands for a specific pattern, use*as a placeholder in place of {event}. ๐ธ:au[tocmd]! [{event}] [{pat}]โ removes the autocommands matching the given event-pattern combo. Same syntax as the listing form above. ๐ซถ
:bmark
:bmark tag1 [tag2 [tag3...]]โ bookmarks the current directory with the tags you list. ๐:bmark! path tag1 [tag2 [tag3...]]โ same as:bmark, except it lets you bookmark a specific path instead of the current directory. This one's for use invifmrc, and for bookmarking files.
path can contain macros that expand to a single path (%c, %C, %d, %D), or macros that can expand to multiple paths but only contain one (%f, %F, %rx). That second thing is done purely for convenience when you use the command interactively. Complex macros that include spaces (e.g. "%c:gs/ /_") should be escaped. ๐
:bmarks
:bmarksโ shows all your bookmarks in a menu. โญ:bmarks [tag1 [tag2...]]โ shows a menu of the bookmarks that include all the tags you specified. Controls live in the "Menus and dialogs" section.
:bmgo
:bmgo [tag1 [tag2...]]โ when there's more than one match it acts exactly like:bmarks, otherwise it navigates straight to the single match immediately (and fails if there is no match). iconic. โจ
:cabbrev
:ca[bbrev]โ shows a menu of command-line mode abbreviations. Controls: "Menus and dialogs" section.:ca[bbrev] lhs-prefixโ shows the command-line mode abbreviations whose left-hand side starts with the prefix you gave. ๐:ca[bbrev] lhs rhsโ registers a new abbreviation for command-line mode, or overwrites an existing one.rhscan contain spaces and any of the special sequences accepted in therhsof mappings (peep the "Mappings" section below). Abbreviations are expanded non-recursively. ๐ซ
:call
:cal[l] {function}([{expr1}, ...])โ invokes a {function} and just discards its return value. Heads up though: unlike in Vim, a call expression followed by trailing characters is not invoked. ๐
:chistory
:chi[story]โ shows a menu of saved menus. Controls are in "Menus and dialogs", and also check out the "Menus history" section. ๐
:cnoreabbrev
:cnorea[bbrev]โ shows a menu of command-line mode abbreviations. Controls in "Menus and dialogs". ๐ง:cnorea[bbrev] lhs-prefixโ shows the command-line mode abbreviations whose left-hand side starts with the prefix.:cnorea[bbrev] lhs rhsโ same as:cabbrev, except mappings inrhsare ignored during expansion. ๐
:cd
:cdor:cd ~or:cd $HOMEโ changes to the home directory. ๐:cd -โ goes to the last visited directory. ๐:cd ~/dirโ changes directory to~/dir.:cd /curr/dir /other/dirโ changes the current pane's directory to/curr/dirand the other pane's directory to/other/dir. Relative paths are assumed to be relative to the directory of the current view. The command won't fail if one of the directories is invalid. All forms of this command accept macros. no cap. ๐:cd! /dirโ same as:cd /dir /dir. โจ
:cds
:cds[!] pattern stringโ navigates to the path you get by substituting the first match in the current path. Arguments can include slashes, but starting the first argument with a separator activates the form below instead. Specifying!changes the directory of both panes. ๐
Available flags:
iโ ignore case (the'ignorecase'and'smartcase'options are not used)Iโ don't ignore case (the'ignorecase'and'smartcase'options are not used)
:cds[!]/pattern/string/[flags]โ same as above, but with:substitute-like syntax. Other punctuation characters can be used as separators. ๐
:change
:c[hange]โ shows a dialog to alter properties of files. ๐ ๏ธ
:chmod
:[range]chmodโ displays the file attributes change dialog (permissions on *nix and properties on Windows). ๐:[range]chmod[!] arg...โ only for *nix. Changes permissions for files. Seeman 1 chmodfor the arg format.!means set permissions recursively. ๐ฅ
:chown
:[range]chownโ only for *nix. Same as thecokey in normal mode.:[range]chown [user][:][group]โ only for *nix. Changes the owner and/or group of files. Operates on directories recursively. ๐
:clone
:[range]clone[!?]โ clones files in the current directory. With?, vifm opens vi so you can edit the file names.!forces overwrite. Macros are expanded. ๐ฆ:[range]clone[!] pathโ clones files into the directory specified by path (absolute, or relative to the current directory).!forces overwrite. Macros are expanded. ๐ซ:[range]clone[!] name1 name2...โ clones files in the current directory, giving each next clone a corresponding name from the argument list.!forces overwrite. Macros are expanded. โ
:colorscheme
:colo[rscheme]?โ prints the current color scheme name on the status bar. โจ:colo[rscheme]โ displays a menu with a list of available color schemes, where you pick the primary one. The primary scheme is used for the view when no directory specific colorscheme fits the current path. It's also used to set the border color (except view titles) and the colors in menus and dialogs. Controls in "Menus and dialogs". ๐จ:colo[rscheme] color_scheme_nameโ changes the primary color scheme tocolor_scheme_name. If errors happen (like some colors not being supported by your terminal), either nothing is changed or the color scheme is reset to builtin colors to make sure the TUI is left in a usable state. ๐:colo[rscheme] color_scheme_name directoryโ associates a directory with a color scheme. The directory argument can be either an absolute or a relative path when:colorschemeis executed from the command line, but it mandatory should be an absolute path when the command is executed in scripts loaded at startup (until vifm is completely loaded). โ ๏ธ:colo[rscheme] color_scheme_name color_scheme_name...โ loads the first color scheme in the order given that exists and is supported by the terminal. If none matches, the current one remains unchanged. For example:
" use a separate color scheme for panes which are inside FUSE mounts
execute 'colorscheme in-fuse' &fusehome
:comclear
:comc[lear]โ removes all user defined commands. bye bye ๐
:command
:com[mand]โ displays a menu of user commands. Controls in "Menus and dialogs". ๐:com[mand] prefixโ displays the user defined commands that start with the prefix. ๐
๐ฆ :com[mand] name action[ &]
okay bestie, this is THE command-builder command and it's giving DIY-queen energy ๐ It sets or redefines a user command.
Key deets, no cap:
- Use
:com[mand]!to overwrite a previously set command of the same name. Builtin commands can't be redefined, sorry fam ๐ - User commands must start with an upper or lower case letter.
- Command name can't contain special symbols except for a single trailing
?or!. - Numbers are allowed provided that they don't cause parsing ambiguity (no command name prefix that precedes a digit can match an existing command unless it has a digit in the same place). For example:
" 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.
๐ :com[mand] name /pattern
set search pattern. that's it, that's the vibe โจ
๐ธ :com[mand] name =pattern
set local filter value.
๐ง :com[mand] name filter{:filter args}
set file name filter (see :filter command description). For example:
" 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
๐ :com[mand] name :commands
set kind of an alias for internal commands (like in a shell). Passes range given to alias to an aliased command, so running :%cp after
:command cp :copy %a
equals
:%copy
periodt. ๐
๐ :compare
:compare [byname | bysize | bycontents |
listall | listunique | listdups |
ofboth | ofone |
groupids | grouppaths |
skipempty | withicase | withrcase |
showidentical | showdifferent | showuniqueleft |
showuniqueright]...
compare files in one or two views according to the arguments. The default is "bycontents listall ofboth grouppaths showidentical showdifferent showuniqueleft showuniqueright". See "Compare views" section below for details. Diff structure is incompatible with alternative representations, so values of 'lsview' and 'millerview' options are ignored. ๐ญ
๐ :compare!
:compare! (showidentical | showdifferent | showuniqueleft |
showuniqueright)...
this invocation form works only when compare view is active and results in redoing of the previous :compare with toggled state of the passed in options. toggling, bestie, toggling โจ
๐ซถ :cope[n]
reopen the most recently closed navigation menu, if any. See also "Menus history" section. (your accidentally-closed menu said "not today" and you said "actually yes today") ๐
๐ :copy
:[range]co[py][!?][ &]โ copy files to directory of other view. With"?"prompts for destination file names in an editor."!"forces overwrite.:[range]co[py][!] path[ &]โ copy files to directory specified with the path (absolute or relative to directory of other view)."!"forces overwrite.:[range]co[py][!] name1 name2...[ &]โ copy files to directory of other view giving each next file a corresponding name from the argument list."!"forces overwrite:[range]co[py][!?] -skip ...[ &]โ see "-skipparameter" below.
Also see "File copying" section below. ๐
๐ช :cq[uit][!]
same as :quit, but also aborts directory choosing via --choose-dir (empties output file) and returns non-zero exit code. it's a rage quit but make it official ๐
โ๏ธ :cuna[bbrev] lhs
unregister command-line mode abbreviation by its lhs.
โ๏ธ :cuna[bbrev] rhs
unregister command-line mode abbreviation by its rhs, so that abbreviation could be removed even after expansion.
๐งน :delbmarks
:delbmarksโ remove bookmarks from current directory.:delbmarks tag1 [tag2 [tag3...]]โ remove set of bookmarks that include all of the specified tags.:delbmarks!โ remove all bookmarks.:delbmarks! path1 [path2 [path3...]]โ remove bookmarks of listed paths.
spring cleaning but for your bookmarks ๐ธ
๐๏ธ :delc[ommand] user_command
remove user defined command named user_command.
๐ฅ :delete
:[range]d[elete][!][ &]โ delete selected file or files."!"means complete removal (omitting trash).:[range]d[elete][!] [reg] [count][ &]โ delete selected or[count]files to the reg register."!"means complete removal (omitting trash).
โ ๏ธ bestie "!" is the permanent one, no trash can to rescue you, be soooo careful with that one ๐ซฃ
๐ท๏ธ :delm[arks]!
delete all marks.
๐ท๏ธ :delm[arks] marks ...
delete specified marks, each argument is treated as a set of marks.
๐ :delsession
delete specified session if it was stored previously. Deleting current session doesn't detach it. (it's gone from the record but still here in spirit fr fr)
๐ :di[splay]
display menu with registers content.
๐ :di[splay] list ...
display the contents of the numbered and named registers that are mentioned in list (for example "az to display "", "a and "z content).
๐ณ :dirs
display directory stack in a menu. See "Menus and dialogs" section for controls.
๐ฃ๏ธ :ec[ho] [<expr>...]
evaluate each argument as an expression and output them separated with a space. See help on :let command for a definition of <expr>.
๐ :[range]e[dit] [file...]
open selected or passed file(s) in editor. Macros and environment variables are expanded. โจ
๐ :el[se]
execute commands until next matching :endif if all other conditions didn't match. See also help on :if and :endif commands.
๐ :elsei[f] {expr1}
execute commands until next matching :elseif, :else or :endif if conditions of previous :if and :elseif branches were evaluated to zero. See also help on :if and :endif commands.
๐งผ :empty
permanently remove files from all existing non-empty trash directories (see "Trash directory" section below). Trash directories which are specified via %r and/or %u also get deleted completely. Also remove all operations from undolist that have no sense after :empty and remove all records about files located inside directories from all registers. Removal is performed as background task with undetermined amount of work and can be checked via :jobs menu. ๐งน๐จ
๐ :en[dif]
end conditional block. See also help on :if and :else commands.
๐ช :exe[cute] [<expr>...]
evaluate each argument as an expression and join results separated by a space to get a single string which is then executed as a command-line command. See help on :let command for a definition of <expr>. it's giving "build a command out of other commands" main character energy ๐
๐ช :exi[t][!]
same as :quit.
๐ :f[ile][ &]
display menu of programs set for the file type of the current file. " &" forces running associated program in background. See "Menus and dialogs" section for controls.
๐ :f[ile] arg[ &]
run associated command that begins with the arg skipping opening menu. " &" forces running associated program in background.
๐งฌ :filet[ype]
:filet[ype] pattern-list [{descr}]def_prog[ &],[{descr}]prog2[ &],...
associate given program list to each of the patterns. Associated program (command) is used by handlers of l and Enter keys (and also in the :file menu). If you need to insert comma into command just double it (,,). Space followed by an ampersand as two last characters of a command means running of the command in the background. Optional description can be given to each command to ease understanding of what command will do in the :file menu. Vifm will try the rest of the programs for an association when the default isn't found. When program entry doesn't contain any of vifm macros, name of current file is appended as if program entry ended with %c macro on *nix and %"c on Windows. On Windows path to executables containing spaces can (and should be for correct work with such paths) be double quoted. See "Patterns" section below for pattern definition and "Selection" section for how selection is handled. See also "Automatic FUSE mounts" section below. Example for zip archives and several actions:
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. ๐
๐ :filet[ype] filename
list (in menu mode) currently registered patterns that match specified file name. Same as ":filextype filename".
๐งฌ :filextype
๐
:filex[type] pattern-list [{ description }] def_program,program2,...
okay so this one is literally the X-ified twin of :filetype โจ same energy, same everything โ except this command gets completely ignored if you're not running in X. And when you are in X? :filextype is equal to :filetype, periodt. Pattern definition rules live in the "Patterns" section below, selection handling is in the "Selection" section, and there's also a lil "Automatic FUSE mounts" section below you should peek at ๐.
So like, imagine these settings (yes the order looks kinda unhinged, but that's the whole point โ it's for demonstration):
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 running vifm inside a terminal emulator that lives in a graphical environment (that's when X is used on *nix; always on Windows), vifm tries to run the application in this order:
lynxdwblinksfirefoxuzbl
But if there's no graphical environment (checked by presence of non-empty $DISPLAY or $WAYLAND_DISPLAY environment variable on *nix; never happens on Windows), the list is giving:
lynxlinks
Like, as if all the :filextype commands just... weren't there. Poof ๐ช
The whole point of that differentiation? So you can comfortably use vifm with the same settings in a desktop environment, through a remote connection (SSH), or in a native console. Versatile icon behavior fr fr ๐
Heads up bestie: on OS X$DISPLAYisn't defined unless you define it yourself, so only use:filextypeif you've set$DISPLAYsome type of way. No cap.
:filext[ype] filename
lists (in menu mode) the patterns that are currently registered and match the specified file name. Same as :filetype filename. ๐
๐ธ :fileviewer
:filev[iewer] pattern-list command1,command2,...
register that specified list of commands as viewers for each of the patterns. A viewer is a command whose output gets captured and displayed in one of the panes of vifm after you press e or run the :view command. The way that this one works: when the command doesn't contain any of vifm's macros, the name of the current file gets appended as if the command ended with the %c macro. Comma escaping and missing commands processing rules are the same as for :filetype. See the "Patterns" section below for pattern definition. Supports Lua handlers. ๐
Example for zip archives:
fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c, echo "No zip to preview:"
:filev[iewer] filename
lists (in menu mode) currently registered patterns that match the specified filename. ๐ฆ
๐ :filter
:filter[!] {pattern}
filters files matching the pattern out of the directory listings. The '!' controls the state of filter inversion after updating the filter value (peep the 'cpoptions' description too). The filter is matched case sensitively on *nix and case insensitively on Windows. See the "File Filters" and "Patterns" sections. ๐
Example:
" filter all files ending in .o from the filelist.
:filter /.o$/
:filter[!] {empty-pattern}
same as above, but it uses the last search pattern as the pattern value. iconic.
Example:
:filter //I
:filter
resets the filter (sets it to an empty string) and shows all files. everything back out, we love to see it ๐
:filter!
same as :invert. ๐
:filter?
shows information on local, name and auto filters. info dump, but make it cute.
:[range]fin[d] pattern
displays the results of the find command in the menu. It searches among selected files if there are any. Accepts macros. By default the command relies on the external "find" utility, which you can customize by altering the value of the 'findprg' option. ๐ฅ
:[range]fin[d] -opt...
same as :find above, but you (yes you) define all the find arguments. Searches among selected files if any.
:[range]fin[d] path -opt...
same as :find above, but you define all the find arguments. This one ignores selection and range. noted ๐
:[range]fin[d]
repeats the last :find command. muscle memory core.
:fini[sh]
stops sourcing a script. It can only be used in a vifm script file. It's the quick way to skip the rest of the file โ like leaving the group chat mid-sentence, but productive ๐
:go[to]
changes directory if necessary and puts the specified path under the cursor. The path should be an existing non-root path. Macros and environment variables get expanded. ๐
:[range]gr[ep][!] pattern
will show the results of the grep command in the menu. Add "!" to request inversion of the search (i.e. look for lines that do not match the pattern). It searches among selected files if any and no range was given. Ignores binary files by default. By default the command relies on the external "grep" utility, which you can customize by altering the value of the 'grepprg' option. ๐
:[range]gr[ep][!] -opt...
same as :grep above, but you define all the grep arguments, which are not escaped. Searches among selected files if any.
:[range]gr[ep][!]
repeats the last :grep command. And plot twist: the "!" of this command inverts the "!" in the repeated command. chaotic, honestly ๐ญ
:h[elp]
shows the help file. ๐
:h[elp] argument
is the same as using ':h argument' in vim. Use vifm-<something> to get help on vifm (tab completion works, slay). This form of the command doesn't work when the 'vimhelp' option is off. ๐ซถ
:hideui
hides the interface to show previous commands' output. bye interface, hi receipts โจ
:hi[ghlight]
displays information about all highlight groups that are active at the moment.
:hi[ghlight] clear
resets all highlighting to builtin defaults and removes all filename-specific rules.
:hi[ghlight] clear ( {pat1,pat2,...} | /regexp/ )
removes the specified rule.
:hi[ghlight] ( group-name | column:name | {pat1,pat2,...} | /regexp/ )
displays information on the given highlight group or file name pattern of the color scheme used in the active view.
:hi[ghlight] ( group-name | column:name | {pat1,pat2,...} | /regexp/[iI] ) cterm=style | ctermfg=color | ctermbg=color | gui=style | guifg=color | guibg=color
sets the style (cterm, gui), foreground (ctermfg, guifg) and/or background (ctermbg, guibg) parameters of a highlight group or file name pattern for the color scheme used in the active view. ๐
Group names, style values and color names are case insensitive. But note that this does not include column names, because that would make builtin and custom columns indistinguishable. ๐ซ
Available group-name values:
Winโ color of all windows (views, dialogs, menus) and the default color for their content (e.g. regular files in views)AuxWinโ color of auxiliary areas of windowsOtherWinโ color of inactive paneBorderโ color of vertical parts of the borderTabLineโ 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 paneTopLineSelโ top line color of the current paneCmdLineโ the command line/status bar colorErrorMsgโ color of error messages in the status barStatusLineโ color of the line above the status barJobLineโ color of the job line that appears above the status lineWildBoxโ color of the wild menuWildMenuโ color of the selected wild menu itemSuggestBoxโ color of key suggestion boxCurrLineโ line at cursor position in active viewOtherLineโ line at cursor position in inactive viewOddLineโ color of every second entry line in a paneLineNrโ line number column of viewsSelectedโ color of selected filesDirectoryโ color of directoriesLinkโ color of symbolic links in the viewsBrokenLinkโ color of broken symbolic linksHardLinkโ color of regular files with more than one hard linkSocketโ color of socketsDeviceโ color of block and character devicesExecutableโ color of executable filesFifoโ color of fifo pipesCmpMismatchโ color of mismatched files in side-by-side comparison by pathCmpUnmatchedโ comparison file entry that has no pair in the other paneCmpBlankโ entry placeholder in a compare view, paired withCmpUnmatchedUser1..User20โ 20 colors which can be used via the%*'statusline'macro
Column names match the names of columns of the |vifm-'viewcolumns'| option, which in turn are based on values of |vifm-'sort'| and custom columns added from Lua. Regardless of the source, columns get specified as "column:{name}", for example:
highlight column:fileext ctermfg=red
Available style values (some of them can be combined, bestie):
boldunderlinereverseorinversestandoutitalic(on unsupported systems becomesreverse)combineโ add attributes of current group to attributes of the parent in group hierarchy (see below) instead of replacing themnone
Available colors:
-1ordefaultornoneโ default or transparentblackandlightblackredandlightredgreenandlightgreenyellowandlightyellowblueandlightbluemagentaandlightmagentacyanandlightcyanwhiteandlightwhite0-255โ corresponding colors from the 256-color palette (forctermfgandctermbg)#rrggbbโ direct ("gui","true", 24-bit) color in hex-notation, each of the three components are in the range0x00to0xff(forguifgandguibg)
Light versions of colors are just regular colors with the bold attribute set automatically in terminals that have less than 16 colors. So the order of arguments of the :highlight command is important โ and it's better to put "cterm" in front of the others to prevent it from overwriting attributes set by the "ctermfg" or "ctermbg" arguments. Order matters, don't argue with the algorithm ๐โจ
OK bestie, for all of you who write your own color schemes (the color scheme authoresses, the palette girlies, the ones who live in hex codes ๐
): xterm-like names for the 256 color palette are also supported. The mapping is taken from http://vim.wikia.com/wiki/Xterm256_color_names_for_console_Vim, and duplicated entries were altered by adding an underscore followed by a numerical suffix. Periodt. Here's the whole vibe:
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
Now, tea time โ because this next bit is a whole saga. There are two colors (foreground and background) and only one bold attribute. So that single bold attribute affects both colors when the "reverse" attribute is used in vifm run inside a terminal emulator. Meanwhile, the 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 โ so don't @ me, bestie, it's just how it is rn. ๐
So: although vifm supports 256 colors, in the sense that they are supported by the UI drawing library, whether you'll actually be able to use all of them highly depends on your terminal. To set up your terminal properly, make sure that $TERM in the environment you run vifm in is set to the name of a 256-color terminal (on *nixes it can also be set via X resources), e.g. xterm-256color. You can find a list of available terminal names by listing /usr/lib/terminfo/. And the number of colors your terminal supports with current settings can be checked via the tput colors command. Slay. โจ
Wanna go even further?? 24-bit colors, babes. ๐ In order to use 24-bit colors you need a terminal that supports them, the 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.
โจ The highlight group hierarchy โจ
Here's the hierarchy of highlight groups, which you need to know for using transparency ๐ซถ:
JobLine
SuggestBox
StatusLine
WildBox
WildMenu
User1..User20
Border
CmdLine
ErrorMsg
Win
OtherWin
AuxWin
OddLine
Column highlights
File name specific highlights
Directory
Link
BrokenLink
HardLink
Socket
Device
Fifo
Executable
CmpMismatch
CmpUnmatched
CmpBlank
Selected
CurrLine
LineNr (in active pane)
OtherLine
LineNr (in inactive pane)
TopLine
TopLineSel
TabLineSel (for pane tabs)
User1..User20
TabLine
TabLineSel
User1..User20
"none" means default terminal color for highlight groups at the first level of the hierarchy, and transparency for all the others. iykyk ๐
And just so we're clear: here, "file name specific highlights" means those configured via globs ({}) or regular expressions (//). At most one of them is applied per file entry โ namely the first one that matches the file name โ hence the order of :highlight commands might be important in certain cases. Lowkey important, don't skip it.
๐ฐ๏ธ :history
๐ :his[tory]
displays a menu with a list of visited directories. See the "Menus and dialogs" section for controls ๐
๐ :his[tory] x
x can be:
d[ir]or.โ show directory history.c[md]or:โ show command line history.s[earch]or/โ show search history and search forward on thelkey.f[search]or/โ show search history and search forward on thelkey.b[search]or?โ show search history and search backward on thelkey.i[nput]or@โ show prompt history (e.g. on one file renaming).fi[lter]or=โ show local filter history (see description of the=normal mode command).e[xprreg]โ show expression register history (see description of Ctrl+R=in command-line mode).mc[cmd]โ show command-line history of menus.
See the "Menus and dialogs" section for controls ๐ซถ
๐ :histnext
โจ :histnext
same as <c-i>. And the main use case for this command is to work around that common pain point of <tab> and <c-i> being the same ASCII character ๐ญ. So here's the hack: you could alter your terminal emulator settings to emit, for example, the F1 keycode when Ctrl+I is pressed, then :noremap <f1> :histnext<cr> in vifm, add the "t" flag to the 'cpoptions', and thus have both <c-i> and <tab> working as expected. Iconic problem-solving energy, honestly. ๐
๐ :histprev
โจ :histprev
same as <c-o>.
๐ธ :if
๐ :if {expr1}
starts a conditional block, bestie. Commands are executed until the next matching :elseif, :else or :endif command if {expr1} evaluates to non-zero โ otherwise they are just ignored ๐. And an error during evaluation of {expr1} results in not taking any conditional branches (not even an else-branch). Yeah. So be careful with that one. See also help on the :else and :endif commands.
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
:invert [f]โ flips your file name filter, no take-backsies ๐:invert? [f]โ bestie I wanna see the current filter state, so this shows it ๐:invert sโ invert the selection, iconic behavior:invert oโ flip the sorting order of your primary sorting key:invert? oโ shows you the sorting order of the primary sorting key
:jobsโ pops open a menu of the currently backgrounded processes. The controls live in the "Menus and dialogs" section, iykyk ๐ง:keepsel [command...]โ keeps your selection alive during some:commandby default. Real talk though: this doesn't like, save-and-restore your selection so it's unbreakable โ it just stops the selection from getting cleared at the end of a command, so it won't save you if the selection gets explicitly cleared mid-operation. ๐
Example:
:keepsel view
:let $ENV_VAR = <expr>โ set an environment variable. โ ๏ธ Heads up: setting an environment variable to an empty string on Windows straight up removes it, bestie.:let $ENV_VAR .= <expr>โ append a value to an environment variable:let &[l:|g:]opt = <expr>โ assign an option:let &[l:|g:]opt .= <expr>โ append a value to a string option:let &[l:|g:]opt += <expr>โ increase an option value, adding sub-values:let &[l:|g:]opt -= <expr>โ decrease an option value, removing sub-values
Where <expr> can be a single-quoted string, a double-quoted string, an environment variable, a function call, or a concatenation of any of those in any order using the '.' operator. Any whitespace? Straight up ignored. โจ
:locate filenameโ uses the"locate"command to build you a menu of filenames. Pick a file from the menu and vifm reloads the current file list to show it. By default this leans on the external"locate"utility (it's assumed its database is already built โ no pressure), and you can customize that by swapping the value of the'locateprg'option. Controls are in the "Menus and dialogs" section. ๐ฆ:locateโ reruns the last:locatecommand, periodt
:lsโ lists the windows of an active terminal multiplexer, if you've got one going. It does this by firing a proper command off to the terminal multiplexer, so bestie, that list? Not handled by vifm at all. ๐
:lstrashโ shows a menu listing the files in a trash. Each element in that list is the original path of a deleted file, which means the list can totally have duplicates in it. Controls are in the "Menus and dialogs" section. ๐
:[range]ma[rk][?] x [/full/dir/path [filename]]โ sets mark x (that'sa-zA-Z0-9) at/full/dir/pathand filename. By default it uses the current file in the current directory. If you didn't give a filename and the/full/dir/pathis the current directory, then it grabs the last file of the[range]instead. The question mark stops the command from overwriting a mark that's already there. Macros and environment variables get expanded. ๐ธ:marksโ makes a pop-up menu of your marks. Controls are in the "Menus and dialogs" section.:marks list ...โ displays the contents of the marks you named in list ๐
:mediaโ only for *nix. Displays the media management menu. Controls are in the "Menus and dialogs" section, and go peek at the'mediaprg'option too. ๐
:mes[sages]โ displays the history of the status bar messages (up to 50 items, so plenty of receipts)
:[line]mkdir[!] dir ...โ creates directories at the paths you specify. The[line]lets you pick a node in a tree-view. The"!"means make parent directories as needed, slay. Macros get expanded. โจ
:[range]m[ove][!?][ &]โ moves files into the directory of the other view. With"?"it prompts for destination file names in an editor."!"forces overwrite, no chill.:[range]m[ove][!] path[ &]โ moves files into the directory specified by path (absolute, or relative to the directory of the other view)."!"forces overwrite.:[range]m[ove][!] name1 name2...[ &]โ moves files into the directory of the other view, handing each next file a corresponding name from the argument list."!"forces overwrite.:[range]m[ove][!?] -skip ...[ &]โ see the"-skip parameter"section below ๐
:noh[lsearch]โ clears the selection in the current pane
:norm[al][!] commandsโ executes normal mode commands. If you throw a"!"in there, user defined mappings get ignored. An unfinished last command gets aborted as if you'd typed esc or c-c. A":"should be completed too. Commands can't start with a space, so drop a count of 1 (one) before it. ๐
:on[ly]โ switches you to a one window view, main character energy ๐
:[range]o[pen]โ opens the current file, the selection, or the files in the range, exactly as if Enter was pressed
:plugin loadโ loads all the plugins. Meant to be used in a configuration file so you can manually load plugins earlier. Note bestie: plugins can only be loaded once, so extra calls just do nothing. ๐:plugin blacklist {plugin}โ adds{plugin}to the ignore list ๐ซ:plugin whitelist {plugin}โ adds{plugin}to the list of plugins to load while ignoring every other plugin. Normally this list should be empty.
:pluginsโ opens the plugins menu. Controls are in the "Menus and dialogs" section. ๐ง
:popdโ removes pane directories from the stack
:pushd[!] /curr/dir [/other/dir]โ adds pane directories to the stack and processes the arguments just like the:cdcommand does:pushdโ exchanges the top two items of the directory stack ๐
:[line]pu[t][!] [reg] [ &]โ puts files from the specified register ("by default) into the current directory. The[line]lets you pick a node in a tree-view. The"!"moves files from their original location instead of copying them. Heads up: during this operation no confirmation dialogs get shown โ all the checks happen beforehand. ๐ซถ
:pw[d]โ shows the present working directory
:qa[ll][!]โ exits vifm (add!to skip saving changes and to skip checking for active backgrounded commands)
:q[uit][!]โ if there's more than one tab, closes the current one; otherwise exits vifm (add!to skip saving state and skip checking for active backgrounded commands)
:redr[aw]โ redraws the screen immediately, right this second โจ
:rege[dit] [{reg}]โ edits register contents using an external editor. If{reg}is omitted, the unnamed register gets edited by default. Edited paths get normalized (no extra.,..,/, etc.) and every relative path is treated as starting in the directory of the current view. ๐
:reg[isters]โ displays a menu with the registers content:reg[isters] list ...โ displays the contents of the numbered and named registers you mention in list (for example,"azdisplays the"aand"zcontent) ๐
:regularโ switch to regular view, leaving custom view behind ๐ฆ
:[range]rename[!]โ renames files by editing their names in an editor."!"renames files recursively in subdirectories. Check the "External Renaming" section for the deets. ๐:[range]rename name1 name2...โ renames each of the selected files to a corresponding name
:restartโ frees a lot of stuff (histories, commands, etc.), rereadsvifminfo,vifmrcand session files, and runs the startup commands passed in the argument list โ which means you lose all unsaved changes (like recent history or keys you mapped after starting this instance). A session that wasn't stored yet gets reset. ๐ญ
While tons of things get reset, some basic UI state and current locations are preserved, including tabs.
:restart fullโ a variation of:restartthat makes no attempt to preserve anything. It's giving fresh start, no survivors. ๐
:[range]restoreโ restores a file from the trash directory. Heads up: this doesn't work outside one of the trash directories. See the "Trash directory" section below. โป๏ธ
:[range]rlink[!?]โ creates relative symbolic links to files in the directory of the other view. With"?"it prompts for destination file names in an editor."!"forces overwrite.:[range]rlink[!] pathโ creates relative symbolic links of files in the directory specified by path (absolute, or relative to the directory of the other view)."!"forces overwrite.:[range]rlink[!] name1 name2...โ creates relative symbolic links of files in the directory of the other view, giving each next link a corresponding name from the argument list."!"forces overwrite.:[range]rlink[!?] -skip ...[ &]โ see the"-skip parameter"section below ๐
:screen
:screenโ toggles whether vifm uses a terminal multiplexer or not. little vocab moment: a terminal multiplexer uses pseudo terminals so you can juggle multiple windows in the console or inside one single xterm. Start vifm from a terminal multiplexer with the right support switched on and vifm will open a whole new terminal multiplexer window for every new file you edit or every program you launch from vifm. โจ This needs screen version 3.9.9 or newer for thescreen -Xargument, or tmux (1.8 or newer is recommended).:screen!โ enable integration with terminal multiplexers.:screen?โ display whether integration with terminal multiplexers is enabled.
Note ๐: the command is called screen for historical reasons (back when tmux wasn't supported yet, bestie) and it might get changed in future releases, or get an alias. Not us living in the past ๐.
:[range]selectโ select the files in the given range (just the current file if you don't give a range).:select {pattern}โ select every file that matches the pattern you gave. The possible{pattern}forms are all written up in the "Patterns" section below ๐. Trailing slash for directories gets taken into account too, so:select! */ | invert sselects only files. Iconic.:select //[iI]โ same as the item above, but it reuses the last search pattern.:select !{external command}โ select files from the list your external command hands over. Files get matched by full paths, and relative paths are converted to absolute ones beforehand.:[range]select! [{pattern}]โ same as above, but it resets everything previously selected before it proceeds.
:session?โ print the name of the current session.:sessionโ detach the current session without saving it. Resetsv:session.:session nameโ create a session with that name, or load it and switch to it. The name can't contain slashes ๐ซ. The session that's active right now gets saved before the switch. Sessions also get saved automatically when you quit the app the usual ways. Setsv:session.:session -โ switch to the previous session, but only if it still exists (i.e. it wasn't removed, or detached from without saving).
:se[t]โ display every option that differs from its default value.:se[t] allโ display all the options.:se[t] opt1=val1 opt2='val2' opt3="val3" ...โ sets the options you list. For local options, both values get set. You can use this syntax:- for all options โ
option,option?andoption& - for boolean options โ
nooption,invoptionandoption! - for integer options โ
option=x,option+=xandoption-=x - for string options โ
option=xandoption+=x - for string list options โ
option=x,option+=x,option-=xandoption^=x - for enumeration options โ
option=x,option+=xandoption-=x - for set options โ
option=x,option+=x,option-=xandoption^=x - for charset options โ
option=x,option+=x,option-=xandoption^=x
- for all options โ
and here's the meaning of each:
optionโ turn the option on (if it's boolean) or print its value (for all the others)nooptionโ turn the option offinvoptionโ invert the option stateoption!โ invert the option stateoption?โ print the option's valueoption&โ reset the option to its default valueoption=xoroption:xโ set the option toxoption+=xโ add/appendxto the optionoption-=xโ remove (or subtract)xfrom the optionoption^=xโ togglex's presence among the option's values
The option name can be prepended and appended by any number of whitespace characters, no cap ๐ .
:setg[lobal]โ display all the global options that differ from their default value.:setg[lobal] allโ display all the global options.:setg[lobal] opt1=val1 opt2='val2' opt3="val3" ...โ same as:set, but it changes/prints only global options or the global values of local options. Heads up ๐ซถ: changes to those local option global values might not be visible until you change directory.
:setl[ocal]โ display all the local options that differ from their default value.:setl[ocal] allโ display all the local options.:setl[ocal] opt1=val1 opt2='val2' opt3="val3" ...โ same as:set, but it changes/prints only the local values of local options.
:sh[ell][!]โ start a shell in the current directory. The!suppresses spawning a dedicated terminal multiplexer window for that shell. And to make vifm adaptive to your environment, it uses$SHELLif that's defined, otherwise the'shell'value is used. ๐
:[count]siblnext[!]โ change directory to the[count]th next sibling directory after the current path, using the value of the global sort option of the current pane. The!enables wrapping.
Example time, say you're at /boot and the root listing starts like this:
bin/
boot/
dev/
...
Issuing :siblnext will navigate you to /dev. Slay.
:[count]siblprev[!]โ same as:siblnext, but heading in the opposite direction.
:sor[t]โ display a dialog with the different sorting methods, where you can pick the primary sorting key. When the'viewcolumns'option is empty and'lsview'is off, changing the primary sorting key will also affect how the view looks (specifically, the second column of the view gets changed). Controls are in the "Menus and dialogs" section.
:so[urce] fileโ read command-line commands from the file.
:sp[lit]โ switch to a two window horizontal view.:sp[lit]!โ toggle horizontal window splitting.:sp[lit] pathโ splits the window horizontally so both file directories show at once. It also changes the other pane to path (absolute, or relative to the current directory of the active pane).
:st[op]โ suspend vifm (same thing as pressing Ctrl+Z). It does nothing if this instance isn't running in a shell. The command exists purely so you can map something to the action of Ctrl+Z. ๐ค
:[range]s[ubstitute]/pattern/string/[flags]โ for each file in the range, replace a match of pattern with string.
The string can contain \0...\9 to link to capture groups (\0 = the whole match, \1 = the first group, etc.). Fr fr, that's the good stuff.
The pattern is stored in the search history.
Available flags ๐ฉ:
iโ ignore case (the'ignorecase'and'smartcase'options are not used)Iโ don't ignore case (the'ignorecase'and'smartcase'options are not used)gโ substitute all matches in each file name (everygtoggles this)
:[range]s[ubstitute]/patternโ substitute the pattern with an empty string.:[range]s[ubstitute]//string/[flags]โ use the last pattern from the search history.:[range]s[ubstitute]โ repeat the previous substitution command. โช
:sync [relative path]โ change the other pane to the current pane's directory, or to some path relative to the current directory. Using macros is allowed โจ.:sync!โ change the other pane to the current pane's directory and synchronize the cursor position. If the current pane is displaying a custom list of files, the position from before entering it is used (the current one might not make any sense). ๐ญ:sync! [location | cursorpos | localopts | filters | filelist | tree | all]...โ change the enumerated properties of the other pane so they match the corresponding properties of the current pane. The arguments mean:locationโ the current directory of the pane;cursorposโ cursor position (doesn't make sense without"location");localoptsโ all local options;filtersโ all filters;filelistโ list of files for custom view (implies"location");treeโ tree structure for tree view (implies"location");allโ all of the above. ๐
:tabc[lose]โ close the current tab, unless it's the only one open at the current scope.
:tabm[ove] [N]โ with no argument, or with$as the argument, the current tab becomes the last tab. With an argument, the current tab gets moved after the tab with the specified number. An argument of0moves the current tab to the first position.
:tabname [name]โ set, update, or reset (when you give no argument) the name of the current tab.
:tabnew [path]โ create a new tab. It accepts an optional path for the new tab. Macros and environment variables get expanded. ๐
:tabn[ext]โ switch to the next tab (wrapping around).:tabn[ext] {n}โ go to the tab number{n}. Tab numeration starts with1.
:tabo[nly]โ close all tabs but the current one. It closes pane tabs only at the active side.
:tabp[revious]โ switch to the previous tab (wrapping around).:tabp[revious] {n}โ go to the{n}-th previous tab. Careful โ ๏ธ::tabnexthandles its argument <hhotpink>differently than this one does.
:[line]touch file...โ create files at the specified paths. It aborts on errors. It doesn't update the time of files that already exist. The[line]can be used to pick a node in a tree-view. Macros are expanded. ๐ซฐ
:[range]tr/pattern/string/โ for each file in the range, transliterate the characters that appear in pattern to the corresponding character in string. When string is shorter than pattern, it gets padded with its own last character. โจ
:trashes๐ฆ
:trashes</p>
:trashes
lists every valid trash directory in a menu. Only the ones that are non-empty and writable show up โ empty or locked dirs can stay home ๐
. Fun fact bestie: this is literally the exact list of directories that get wiped when you run :empty ๐ฅ.
:trashes?</p>
:trashes?
same as :trashes, but it also shows you the size of each trash directory. nosy in the best way ๐.
:tree
:tree
turns the pane into a tree view with the current directory as its root ๐ณ. Lowkey magical: the tree view is built on top of a custom view, but it's automatically kept in sync with file system state and it respects all the filters. So the structure you see matches what you'd get if you went and visited those directories manually, no cap. One special case though โ for trees built out of a custom view, file-system tracking isn't performed.
To leave tree view you go up from its root, or hit gh at any level of the tree. Any command that changes directory also works, :cd .. included โจ.
Tree structure is incompatible with alternative representations, so the values of'lsview'and'millerview'are just ignored. Sorry icon ๐.
The "depth" argument sets the nesting level at which loading of subdirectories won't happen (they stay folded). Values start at 1.
:tree!
:tree!
toggle the current view in and out of tree mode ๐ฆ.
:undol[ist]
:undol[ist]
displays the list of latest changes ๐. Use "!" to see the actual commands. For controls, see the "Menus and dialogs" section (iykyk).
:unl[et][!] {var}...
:unl[et][!] {var}...
removes one or more environment ($VAR) or global (g:global) variables ๐งน. Add "!" to skip the warnings about variables that don't exist.
:unselect
:[range]unselectโ unselect files in the given range (just the current file if you don't give a range).:unselect {pattern}โ unselect the files that match the specified pattern. All the possible{pattern}forms live in the "Patterns" section below. Trailing slashes for directories are taken into account, so:unselect */unselects directories ๐ .:unselect !{external command}โ unselect files from the list the external command hands you. Files are matched by full paths, and relative paths get converted to absolute ones beforehand.:unselect //[iI]โ same as the item right above, but it reuses your last search pattern โจ.
:ve[rsion]
:ve[rsion]
shows a menu with version info, the classic.
:vifm
:vifm
same as :version.
:vie[w]
:vie[w]
toggle the quick file view on and off (that's the preview of the file's contents ๐). See also the 'quickview' option.
:vie[w]!
:vie[w]!
turn quick file view on if it's off. One-directional, slay.
:volumes
:volumes
only for MS-Windows โ displays a menu with the volume list ๐ฝ. Hitting l (or Enter) opens that volume in the current pane. Controls live in the "Menus and dialogs" section.
:vs[plit]
:vs[plit]โ switch to a two window vertical view ๐ช๐ช.:vs[plit]!โ toggle window vertical splitting.:vs[plit] pathโ split the window vertically so both file directories show, and change the other pane topath(absolute, or relative to the current directory of the active pane).
:[count]winc[md] {arg}
:[count]winc[md] {arg}
same as running Ctrl+W [count] {arg} โจ.
:windo [command...]
:windo [command...]
execute a command for each pane (same as :winrun % command).
:wingo {id} [{substr}]
:wingo {id} [{substr}]
navigate to a view by its id number ๐ฏ. The {substr} part is used for completion (it can be any number of words, only leading whitespace gets removed). The view becomes the current one by switching to the corresponding tab and pane. Matching is a case sensitive substring search in the view title or its full current path (with ~ expanded regardless of any settings).
:wingo {substr}
:wingo {substr}
this form navigates to a view that is uniquely identified by {substr} โ or it errors ๐ญ. Note: this form will not be used if the first word of {substr} is a valid number that starts with a digit (meaning no + or - in front).
:winrun type [command...]
:winrun type [command...]
execute a command for the pane(s) picked by the type argument:
^โ top-left pane$โ bottom-right pane%โ all panes.โ current pane,โ other pane
:w[rite]
:w[rite]
write the current state to vifminfo and the session files (if a session is active) ๐พ.
:wq[!]
:wq[!]
same as :quit, but ! only disables the check of backgrounded commands โ the state of the application is always written.
:wqa[ll][!]
:wqa[ll][!]
same as :qall, but ! only disables the check of backgrounded commands, while the state of the application is always written.
:xa[ll][!]
:xa[ll][!]
same as :qall.
:x[it][!]
:x[it][!]
same as :quit.
:[range]y[ank] [reg] [count]
:[range]y[ank] [reg] [count]
will yank files to the reg register ๐.
:map lhs rhs and friends
:map lhs rhs
map the lhs key sequence to rhs in normal and visual modes.
:map! lhs rhs
map the lhs key sequence to rhs in command line mode.
:amap :cmap :dmap :mmap :nmap :qmap :vmap
:amap lhs rhsโ maplhstorhsin navigation mode.:cm[ap] lhs rhsโ maplhstorhsin command line mode.:dm[ap] lhs rhsโ maplhstorhsin dialog modes.:mm[ap] lhs rhsโ maplhstorhsin menu mode.:nm[ap] lhs rhsโ maplhstorhsin normal mode.:qm[ap] lhs rhsโ maplhstorhsin view mode.:vm[ap] lhs rhsโ maplhstorhsin visual mode.
:*map โ the listing era
:amapโ list all maps in navigation mode.:cm[ap]โ list all maps in command line mode.:dm[ap]โ list all maps in dialog modes.:mm[ap]โ list all maps in menu mode.:nm[ap]โ list all maps in normal mode.:qm[ap]โ list all maps in view mode.:vm[ap]โ list all maps in visual mode.
:*map beginning
:amap beginningโ list all maps in navigation mode that start withbeginning.:cm[ap] beginningโ list all maps in command line mode that start withbeginning.:dm[ap] beginningโ list all maps in dialog modes that start withbeginning.:mm[ap] beginningโ list all maps in menu mode that start withbeginning.:nm[ap] beginningโ list all maps in normal mode that start withbeginning.:qm[ap] beginningโ list all maps in view mode that start withbeginning.:vm[ap] beginningโ list all maps in visual mode that start withbeginning.
:noremap โ no expanding, bestie
:no[remap] lhs rhs
map the key sequence lhs to rhs for normal and visual modes, but don't expand user mappings in rhs ๐
โโ๏ธ.
:no[remap]! lhs rhs
map the key sequence lhs to rhs for command line mode, but don't expand user mappings in rhs.
:anoremap :cnoremap :dnoremap :mnoremap :nnoremap :qnoremap :vnoremap
:anoremap lhs rhsโ map the key sequencelhstorhsfor navigation mode, but don't expand user mappings inrhs.:cno[remap] lhs rhsโ map the key sequencelhstorhsfor command line mode, but don't expand user mappings inrhs.:dn[oremap] lhs rhsโ map the key sequencelhstorhsfor dialog modes, but don't expand user mappings inrhs.:mn[oremap] lhs rhsโ map the key sequencelhstorhsfor menu mode, but don't expand user mappings inrhs.:nn[oremap] lhs rhsโ map the key sequencelhstorhsfor normal mode, but don't expand user mappings inrhs.:qn[oremap] lhs rhsโ map the key sequencelhstorhsfor view mode, but don't expand user mappings inrhs.:vn[oremap] lhs rhsโ map the key sequencelhstorhsfor visual mode, but don't expand user mappings inrhs.
:unmap โ bye bye mapping ๐
:unm[ap] lhs
remove the user mapping of lhs from normal and visual modes.
:unm[ap]! lhs
remove the user mapping of lhs from command line mode.
:aunmap :cunmap :dunmap :munmap :nunmap :qunmap :vunmap
:aunmap lhsโ remove the user mapping oflhsfrom navigation mode.:cu[nmap] lhsโ remove the user mapping oflhsfrom command line mode.:du[nmap] lhsโ remove the user mapping oflhsfrom dialog modes.:mu[nmap] lhsโ remove the user mapping oflhsfrom menu mode.:nun[map] lhsโ remove the user mapping oflhsfrom normal mode.:qun[map] lhsโ remove the user mapping oflhsfrom view mode.:vu[nmap] lhsโ remove the user mapping oflhsfrom visual mode.
Ranges ๐ซ
okay bestie so a range is literally just a sequence of one or more address elements stitched together with commas (,) or semicolons (;). The addresses get chewed through left-to-right to spit out a two-element range where the first element is not numerically larger than the second one:
- a single-element range
Xis equivalent toX,X - a range with more than two elements is reduced to the last two, for example:
X;Y,ZbecomesY,Z(yetXis not completely ignored as it can affect evaluation ofYand thenZthrough offsets) - a user is prompted to determine whether a decreasing range should be swapped instead of being rejected
A range will be deemed invalid (๐ซ not on my watch) if:
- its second element is less than the first one
- it references a mark which doesn't point within the current file list
Each address can take several forms described below, but all of them can be followed by an unspecified number of offsets: increments (+{n}) or decrements (-{n}). When an element starts with an offset, the offset is applied to either the current position or the preceeding address depending on the separator:
- for
,the current cursor position is used - for
;the previous range element is used
Addresses are positive integers in the range from 1 (the first item, which could be ../) to the number of items in the list (inclusive, represents the last item). All values are normalized to fit this range. no overflowing the list, periodt.
The following addresses are supported:
.โ position of the cursor{n}โ position{n}$โ position of the last item'tโ position of the markt
The following shorthand range also exists:
%โ all items in the list (equivalent to1,$)
Examples, enjoy ๐:
:.gr[ep] ... grep the file under the cursor.
:.d[elete] delete the file under the cursor.
:%d[elete] delete all visible files.
:1,4d[elete] delete the files at the list positions 1, 2, 3 and 4.
Note: parent directory ../ is not handled by operations and can be safely included as part of various ranges.
:2,4d[elete] delete the files at the list positions 2, 3 and 4.
:2d[elete]4 delete the files at the list positions 2, 3, 4 and 5.
:.,$d[elete] delete the files from the current position to the end of the filelist.
:'a+1y[ank] yank the file below the file marked with 'a.
:+1,+1y[ank] yank the file below the cursor.
:+1;+1y[ank] yank two files below the cursor.
:+1;+1;+1y[ank] skip two files below and yank the next two.
:-3;+1 move two files up.
All commands documented with [range] in front of them accept and handle ranges. Those which accept a position use only the last element of the range. ๐
:command parameters ๐
Some of the command-line commands accept parameters in the form of -paramname. Arguments of such commands can be split into two groups: parameters and positional arguments. Items from the two groups cannot be interleaved and parameters always come first. List of parameters is terminated implicitly by the first argument that doesn't start with a dash ("-") or explicitly via "--" separator (needs to be a separate argument), which is just discarded. These strict rules allow arbitrary positional arguments, such as file names that start with a dash. iconic behaviour honestly.
-skipparameter โ This parameter makes:copy,:move,:alinkand:rlinkautomatically skip source files that already exist at the destination rather than refusing to perform the operation.
Command macros ๐
The command macros may be used in user commands.
%aโ User arguments. When user arguments contain macros, they are expanded before performing substitution of%a.%c,%"cโ The current file under the cursor.%C,%"Cโ The current file under the cursor in the other directory.%f,%"fโ All of the selected files or the current file, but see "Selection" section below.%F,%"Fโ Same as%f,%"f, but for the inactive pane.%l,%"lโ List of selected files. Unlike%ffrom above, this is only for explicit selection (i.e., not via a range) and is empty if no files are selected.%L,%"Lโ Same as%l,%"l, but for the inactive pane.%b,%"bโ Same as%f%F.%d,%"dโ Full path to current directory.%D,%"Dโ Full path to other file list directory.%rx,%"rxโ Full paths to files in the register{x}. In case of invalid symbol in place of{x}, it's processed with the rest of the line and default register is used.%mโ Show command output in a menu.%Mโ Same as%m, butl(or Enter) key is handled like for:locateand:findcommands.%uโ Process command output as list of paths and compose custom view out of it.%Uโ Same as%u, but implies less list updates inside vifm, which is absence of sorting at the moment.%Iuโ Same as%u, but gives up terminal before running external command.%IUโ Same as%U, but gives up terminal before running external command.%Sโ Show command output in the status bar.%qโ Redirect command output to quick view, which is activated if disabled.%sโ Execute command in horizontally split window of active terminal multiplexer (ignored if not running inside one).%vโ Same as%s, but splits vertically.%nโ Forbid use of terminal multiplexer to run the command.%Nโ Do not detach viewer from terminal session (keeps/dev/ttyavailable) or process group (keeps the command in the set of foreground clients of the terminal). This flag is a workaround for rare commands/terminals which might need a working TTY for:fileviewercommand to operate correctly and has no effect otherwise.%iโ Run in background and suppress error dialogs, but collect errors internally for viewing via:jobsmenu. This macro doesn't detach the command from terminal session (/dev/tty) on its own, add" &"to leave the command without access to the terminal.%Plโ Pipe list of files to standard input of a command.%Pzโ Same as%Pl, but separates paths by null ('\0') character.%pcโ Marks the end of the main command and the beginning of the clear command for graphical preview, which is invoked on closing preview of a file.%pdโ Marks a preview command as one that directly communicates with the terminal. Beware that this is for things like sixel which are self-contained sequences that depend only on current cursor position, using this with anything else is likely to mangle terminal state. ๐ญ%puโ Uncached preview. Intended to be used for commands that just send file path somewhere for preview.
The following dimensions and coordinates are in characters:
%pxโ x coordinate of top-left corner of preview area.%pyโ y coordinate of top-left corner of preview area.%pwโ width of preview area.%phโ height of preview area.
Use %% if you need to put a percent sign in your command.
Note that%i,%Iu,%IU,%m,%M,%n,%q,%s,%S,%u,%Uand%vmacros are mutually exclusive. Only the last one of them in the command will take effect. ๐ซถ
Note that%Pland%Pzare mutually exclusive. Only the last one of them in the command will take effect.
Note that a previewer containing%pdis considered a pass-through previewer, otherwise a previewer containing both%pxand%pyis considered to be a graphical previewer, the rest are treated as text previewers.
You can use file name modifiers after %c, %C, %f, %F, %b, %d and %D macros. Supported modifiers are:
:pโ full path:uโ UNC name of path (e.g."\\server"in"\\server\share"), Windows only. Expands to current computer name for not UNC paths.:~โ relative to the home directory:.โ relative to current directory:hโ head of the file name:tโ tail of the file name:rโ root of the file name (without last extension):eโ extension of the file name (last one):s?pat?sub?โ substitute the first occurrence of pat with sub. You can use any character for?, but it must not occur in pat or sub.:gs?pat?sub?โ like:s, but substitutes all occurrences of pat with sub.
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 relative paths, while %C and %F are always expanded to full paths. The same applies to %f and %F implicitly used by %b.
:com move mv %f %D
set the :move command to move all of the files selected in the current directory to the other directory.
The %a macro is replaced with any arguments given to an alias command. All arguments are considered optional.
:com lsl !!ls -l %a
- set the
lslcommand to executels -lwith or without an argument.
:lsl<Enter>
will list the directory contents of the current directory.
:lsl filename<Enter>
will list only the given filename.
The macros can also be used in directly executing commands. ":!mv %f %D" would move the current directory selected files to the other directory. โจ
Appending & to the end of a command causes it to be executed in the background. Typically you want to run two kinds of external commands in the background:
- GUI applications that doesn't fork thus block vifm (
:!sxiv %f &); - console tools that do not work with terminal (
:!mv %f %D &).
You don't want to run terminal commands, which require terminal input or output something in background because they will mess up vifm's TUI. Anyway, if you did run such a command, you can use Ctrl+L key to update vifm's TUI.
Rewriting the example command with macros given above with backgrounding:
%m, %M, %s, %S, %u and %U macros cannot be combined with background mark (" &") as it doesn't make much sense. ๐
๐ Command backgrounding ๐
okay so bestie, file system operations can take a lot of time to proceed โ like, sitting there watching a progress bar energy ๐ญ. That's exactly why vifm supports backgrounding them! To run :copy, :move or :delete in the background, just append " &" to it. That's it. Slay.
For each background operation a new thread is created โจ. Job cancellation can be requested in the :jobs menu via the dd shortcut. Iconic.
You can check if a command is still running in the :jobs menu โ backgrounded commands have progress instead of process id at the beginning of the line. Cute little progress bar moment ๐.
โ ๏ธ Background operations cannot be undone. No cap. Do not come for me if you background a delete and regret it ๐.
See the "File copying" section below ๐.
โจ Cancellation โจ
Heads up bestie โ cancellation works somewhat different on Windows platform due to different mechanism of break signal propagation ๐. You also might need to use Ctrl+Break shortcut instead of Ctrl+C over there.
There are two types of operations that can be cancelled:
- file system operations;
- mounting with FUSE (but not unmounting, as it can cause loss of data);
- calls of external applications.
(Yeah the original says two and lists three, we don't question it, it's giving mystery ๐ )
Note that vifm never terminates applications โ it sends SIGINT signal and lets the application quit normally. So polite of it ๐ซถ.
When one of a 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. Facts only.
Cancelled operations are indicated by "(cancelled)" suffix appended to information message on status bar. So you can see exactly what ghosted you ๐ญ.
๐ฅ 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 โ like, obviously, the girlies that take forever ๐
.
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. Lowkey a trap bestie, don't do it.
These commands can't be cancelled: :empty, :rename, :substitute, :tr. Periodt.
๐ธ Mounting with FUSE ๐ธ
It's not considered to be an error, so only a notification on the status bar is shown. Chill vibes only.
๐ External application calls ๐
Each of these operations can be cancelled: :apropos, :find, :grep, :locate.
๐ Selection ๐
So if there is a selection, it's stashed before proceeding further โ unless the file under the cursor is part of that selection. Which means: 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 basically โ you run selection by running one of the selected files; otherwise you're running a single file even if there are other selected entries. Main character energy: only the file under cursor gets the spotlight if it's not in the group.
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 โ pick a lane bestie.
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:
- If there any files for which handler isn't defined, then all files are opened using
'vicmd'or'vixcmd'. - If all handlers match the following criteria:
- backgrounded
- include
%c/%"cand/or%C/%"C - include neither
%f/%"fnor%F/%"F
then each file is executed independently of the rest.
- If all handlers are equal, the common handler is executed. This handler might ignore selection and process only file under the cursor.
- Otherwise, an error is reported, because handlers differ and they don't support parallel execution. ๐
๐ฆ Patterns ๐ฆ
:highlight, :filetype, :filextype, :fileviewer commands and 'classify' option support globs, regular expressions and mime types to match file names or their paths โจ. Directory paths get an implicit trailing slash on matching against a pattern โ keep that in mind for globs or regular expressions that end with $! Very important bestie, this is the classic gotcha ๐.
There are six possible ways to write a single pattern:
[!]{comma-separated-name-globs}[!]{{comma-separated-path-globs}}[!]/name-regular-expression/[iI][!]//path-regular-expression//[iI][!]<comma-separated-mime-type-globs>undecorated-pattern
First five forms can include leading exclamation mark that negates pattern matching. The last form implicitly refers to one of the others ๐. :highlight does not accept undecorated form, while :filetype, :filextype, :fileviewer, :select, :unselect and 'classify' treat it as a 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:
<text/plain>{*.vifm}
Mind that if you make a mistake the whole string will be treated as the sixth form ๐ญ. So be careful, the vibes will betray you.
:filetype, :filextype and :fileviewer commands accept comma-separated list of patterns instead of a single pattern, thus effectively handling OR operation on them:
<text/plain>{*.vifm},<application/pdf>{*.pdf}
Forms that accept comma-separated lists of patterns also process them as lists of alternatives. ๐
๐ 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") โจ. Last one wins, periodt.
There are no implicit ^ or $, so make sure to specify them explicitly if the pattern should match the whole name or path. Don't assume bestie, spell it out ๐
.
โญ Patterns with globs โญ
The "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 โ sorry Windows besties ๐.
๐ Examples ๐
Associate evince to PDF-files only inside /home/user/downloads/ directory (excluding its subdirectories):
:filextype //^/home/user/downloads/[^/]*.pdf$// evince %f
๐ซ Regular expressions ๐ซ
All regular expressions are modern/extended โจ. See man 7 regex for more details on what's supported.
The following special sequences are additionally parsed:
\cforces matching ignoring case of letters\Cforces matching respecting case of letters
\c and \C have the highest priority in determining whether case is matched or not, and exist to override 'ignorecase', 'smartcase' and i/I flags when necessary ๐.
If multiple sequences are present, the one which appears later takes precedence. Last one wins, always.
Note that unlike in Vim, character classes are affected by settings and sequences that control case sensitivity in regular expressions. Fr fr, vim girlies this will trip you up ๐ญ.
๐ง Globs ๐ง
Globs are always case insensitive as it makes sense in general case. Facts.
*, ?, [ and ] are treated as special symbols in the pattern. E.g.
:filetype * less %c
matches all files ๐ฅ. One can use character classes for escaping, so
:filetype [*] less %c
matches only one file name, the one which contains only asterisk symbol. Sneaky but valid โจ.
* 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.
:fileviewer *.zip,*.jar zip -sf %c
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. Hidden file stays hidden, that's the rule ๐
.
? means any character at this position. E.g.
:fileviewer ?.out file %c
calls file tool for all files which have exactly one character before their extension (e.g. a.out, b.out) ๐.
Square brackets designate character class, which means that whole character class matches against any of characters listed in it. For example
:fileviewer *.[ch] highlight -O xterm256 -s dante --syntax c %c
makes vifm call highlight program to colorize source and header files in C language for a 256-color terminal ๐. Equal command would be
:fileviewer *.c,*.h highlight -O xterm256 -s dante --syntax c %c
Inside square brackets ^ or ! can be used for symbol class negation 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 normally separates multiple globs, double it. That's the escape, bestie ๐ .
๐ธ :set options ๐ธ
๐ Local options ๐
These are kind of options that are local to a specific view โจ. So you can set ascending sorting order for left pane and descending order for right pane. Main character energy per pane, we love to see it.
In addition to being local to views, each such option also has two values:
- local to current directory (value associated with current location);
- global to current directory (value associated with the pane).
The idea is that current directory can be made a temporary exception to regular configuration of the view, until directory change ๐. Use :setlocal for that. :setglobal changes view value not affecting settings until directory change. :set applies changes immediately to all values. Slay ๐
.
๐ 'aproposprg' ๐
- type:
string - default:
"apropos %a"
Specifies format for an external command to be invoked by the :apropos command ๐ซถ. The format supports expanding of macros, specific for a particular *prg option, and %% sequence for inserting percent sign literally. This option should include the %a macro to specify placement of arguments passed to the :apropos command. If the macro is not used, it will be implicitly added after a space to the value of this option. No cap, it just does that โจ.
๐ 'autocd' ๐
- type:
boolean - default:
false
When enabled unknown command-line commands are interpreted as implicit invocation of :cd with one argument and no escaping ๐ธ. Tilde is expanded, but not macros or environment variables. Very specific, very iconic, we love the โจlimitedโจ scope bestie.
๐ธ 'autochpos'
- type: boolean
- default: true
When you turn this off, vifm yeets the cursor to the first line of the view after :cd and :pushd instead of going back to the saved cursor spot. Disabling it also makes vifm clear out all the info about cursor position in the view history on :cd and :pushd commands (and on startup too, if 'autochpos' is disabled over in the vifmrc). And the l key in the ":history ." and ":trashes" menus gets treated like a :cd command, iykyk.
This option also affects marks, so navigating to a mark won't restore the cursor position either.
When it's on, though, you get way more fine-grained control over cursor position via the 'histcursor' option โจ
๐ 'columns' 'co'
- type: integer
- default: terminal width on startup
Terminal width, in characters. That's it, that's the vibe ๐
๐ฆ 'caseoptions'
- type: charset
- default:
""
This one's all about extra control over case sensitivity โ letting you override the default behaviour to either always be case sensitive or always be case insensitive. The possible values come in pairs of lower and upper case letters that each configure a specific aspect of behaviour:
pโ always ignore case of paths during completion.Pโ always match case of paths during completion.gโ always ignore case of characters forf/F/;/,.Gโ always match case of characters forf/F/;/,.
At most one item of each pair takes effect, so if both (or more) are present, only the last one matters. And when none of a pair's elements are present, the behaviour is just default โ which depends on the operating system for path completion, and on the values of 'ignorecase' and 'smartcase' options for file navigation. Slay ๐
๐ 'cdpath' 'cd'
- type: string list
- default: value of
$CDPATHwith commas instead of colons
Specifies locations to check when changing directory with a relative path that doesn't start with "./" or "../". When it's non-empty, the current directory gets examined after the directories listed in the option.
Heads up bestie: this option does not affect completion of the :cd command.
Example:
set cdpath=~
So this way ":cd bin" will switch to "~/bin" even if a directory named "bin" exists in the current directory โ while ":cd ./bin" will ignore the value of 'cdpath' entirely. The way it just does that ๐ญ
๐ 'chaselinks'
- type: boolean
- default: false
When enabled, the path of the view is always resolved to the real path (with all symbolic links expanded). No shortcuts, no illusions, just the real you ๐ซถ
๐ 'classify'
- type: string list
- default:
":dir:/"
Specifies file name prefixes and suffixes depending on file type or name (mind that directory names have an implicit trailing slash, ok gorl). The format is either of:
[{prefix}]:{filetype}:[{suffix}][{prefix}]::{pattern}::[{suffix}]
Possible {pattern} forms are described in the "Patterns" section above ๐
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. A comma (',') character can be inserted by doubling it. The list of file type names can be found in the description of the filetype() function. Periodt ๐
๐ 'confirm' 'cf'
- type: set
- default:
delete,permdelete
Defines which operations require confirmation before they go through:
deleteโ moving files to trash (ondor:delete);permdeleteโ permanent deletion of files (onDor:delete!command or on undo/redo operation).
Better safe than sorry, bestie ๐
๐ 'cpoptions' 'cpo'
- type: charset
- default:
"fst"
Contains a sequence of single-character flags. Each flag enables behaviour of older versions of vifm โ a little nostalgia trip fr fr:
fโ when included, running:filtercommand results in not inverted (matching files are filtered out) and:filter!in inverted (matching files are left) filter; when omitted, meaning of the exclamation mark changes to the opposite;sโ when included,yy,Y,ddandDDnormal mode commands act on selection if there is any, otherwise they operate on the current file; when omitted, those commands always operate on the current file;tโ when included,<tab>(thus<c-i>) behave as<space>and switch the active pane, otherwise<tab>and<c-i>go forward in the view history. It's possible to make both<tab>and<c-i>work as expected by setting up the terminal to emit a custom sequence when<c-i>is pressed; see:histnextfor details ๐ง
๐ 'cvoptions'
- type: set
- default:
Specifies whether entering/leaving custom views triggers events that normally happen on entering/leaving directories:
autocmdsโ trigger autocommands on entering/leaving custom views;localoptsโ reset local options on entering/leaving custom views;localfilterโ reset local filter on entering/leaving custom views.
Custom views entering their main character era โจ
๐ 'deleteprg'
- type: string
- default:
""
Specifies the program to run on files that are permanently removed. When it's empty, files are removed as usual โ otherwise this command is invoked on each file by appending its name. If the command doesn't remove files, they will remain on the file system (no magic cleanup, sorry bestie ๐ญ).
๐ 'dirsize'
- type: enumeration
- default:
size
Controls how the size of directories is displayed in file views. Possible values:
sizeโ size of directory (i.e., the size used to store the list of files)nitemsโ number of entries in the directory (excluding.and..)
Size obtained via ga/gA overwrites this setting, so seeing the count of files and occasionally the size of directories is possible. Both, bc we can have it all ๐
๐ซถ 'dotdirs'
- type: set
- default:
nonrootparent,treeleafsparent
Controls displaying of dot directories. Possible values:
rootparentโ show"../"in root directory of file systemnonrootparentโ show"../"in non-root directories of file systemtreeleafsparentโ show"../"in empty directories of tree view
Note that empty directories always contain a"../"entry regardless of the value of this option. That"../"disappears the moment at least one file is created. Iconic behaviour honestly ๐
๐ฆ 'dotfiles'
- type: boolean
- default: false
Whether dot files are shown in the view. Can be controlled with z* bindings. The hidden ones stay hidden unless you say otherwise ๐
โญ 'fastrun'
- type: boolean
- default: false
With this turned on you can run partially entered commands with an unambiguous beginning using :! โ e.g. :!Te instead of :!Terminal or :!Te<tab>. Lazy girl core and we respect it ๐
๐ 'fillchars' 'fcs'
- type: string list
- default:
""
Sets the characters used to fill borders. Here's the lineup:
hborder:cโ default''โ middle horizontal bordermillersep:cโ default''โ separator of miller columnsvborder:cโ default' 'โ left, middle and right vertical borders
An empty string for millersep or vborder is equivalent to a space.
An empty string for hborder omits the horizontal border. Gone. Poof โจ
Example:
set fillchars=vborder:".",hborder:"",millersep:"|"
๐ฅ 'findprg'
- type: string
- default:
"find %s %a"
Specifies the format for an external command to be invoked by the :find command. The format supports expansion of macros specific for this particular option, plus the %% sequence for inserting a percent sign literally. Here are the macros:
%sโ literal arguments of:findor list of paths to search in%Aโ empty or literal arguments of:find%aโ empty or literal arguments of:findor predicate followed by escaped arguments of:find%pโ empty or literal arguments of:findor 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, lowkey convenient:
- if
%sisn't present, it's appended - if neither of
%a,%Aand%pis present,%ais appended - if neither of
%s,%a,%Aand%pis present,%sand%aare appended in this order
The macros slightly change their meaning depending on the format of :find's arguments:
- if the first argument points to an existing directory,
%sis assigned all arguments while%a,%Aand%pare left empty - otherwise:
%sis assigned a dot (".") meaning current directory, or a list of selected file names, if any%a,%Aand%pare assigned literal arguments when the first argument starts with a dash ("-"), otherwise%agets an escaped version of the arguments with a predicate and%pcontains the 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:
set findprg="where /R %s %A"
As the syntax of this command is rather limited, one can't use the :find command with a selection of more than one item, because the command ignores all directory paths except for the last one ๐
When using the find port on Windows, another option is to setup 'findprg' like this:
set findprg="find %s %a"
'followlinks'โ type: boolean ยท default:true๐ฆ
Bestie, when this is on, hitting l or Enter on a link follows it โ like, you actually go to the destination file instead of treating the link like it is the target file. ๐ Heads up though: it does not affect links to directories, those are always entered no matter what (for those, use the gf key). Periodt.
'fusehome'โ type: string ยท default:"($XDG_DATA_HOME/vifm | $VIFM)/fuse/"๐ธ
This is the directory that gets used as the root dir for FUSE mounts. The value can contain environment variables in the form "$envname", and those get expanded โ but if you want to prevent expansion, just prepend it with a slash. ๐ซถ The value should expand to an absolute path, no cap.
Lowkey important: if you change this option, vifm won't remount anything. It only affects future mounts. Peep the "Automatic FUSE mounts" section below for the tea. โจ
'gdefault','gd'โ type: boolean ยท default:false๐
When it's on, the g flag is on for :substitute by default. Simple as that, icon.
'grepprg'โ type: string ยท default:"grep -n -H -I -r %i %a %s"๐
Specifies the format for an external command to be invoked by the :grep command. The format supports expanding of macros, specific for a particular *prg option, plus the %% sequence for inserting a percent sign literally. ๐
This option should include:
- the
%imacro โ to specify placement of the"-v"string when inversion of results is requested - the
%aor%Amacro โ to specify placement of arguments passed to the:grepcommand - the
%smacro โ to specify placement of the list of files to search in
If some of the macros are not used, they will be implicitly added after a space to the value of the 'grepprg' option in the following order: %i, %a, %s. Note that when neither %a nor %A are specified, it's %a which is added implicitly. ๐ซ
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 the 'findprg' option for a description of the difference between %a and %A. ๐ง
Example of setup to use ack (http://beyondgrep.com/) instead of grep:
set grepprg='ack -H -r %i %a %s'
or The Silver Searcher (https://github.com/ggreer/the_silver_searcher):
set grepprg='ag --line-numbers %i %a %s'
'histcursor'โ type: set ยท default:startup,dirmark,direnter๐
Defines situations when the cursor should be moved according to directory history:
startupโ on loading file lists during startupdirmarkโ after navigating to a mark that doesn't specify filedirenterโ on opening directory from a file list
This option has no effect when 'autochpos' is disabled. ๐
Note that the list is not exhaustive and there are other situations when the cursor is positioned automatically. Just so you know, bestie. ๐
'history','hi'โ type: integer ยท default:15โญ
Maximum number of stored items in all histories. That's it, that's the whole vibe.
vifm-'hloptions'โ type: string list ยท default:"filehi:onerow"โจ
Configures behaviour of highlighting.
| item | default |
okay so in list form, since we don't do tables here:
filehi:strโ defaultonerow
The "filehi" item specifies which columns of the view get colored according to file type and its name:
pathโ highlight columns that display file path, name, root or extensiononerowโ same as"path"and also highlight all columns of the current lineallrowsโ highlight all columns of each row
'hlsearch','hls'โ type: boolean ยท default:true๐ฅ
Automatically select files that are search matches. The way it just highlights everything for you?? Obsessed. ๐
'iec'โ type: boolean ยท default:false๐ฆ
Use KiB, MiB, ... suffixes instead of K, M, ... when printing size in human-friendly format.
'ignorecase','ic'โ type: boolean ยท default:false๐ธ
Ignore case in search patterns (:substitute, / and ? commands), local filter (but not the rest of filters) and other things detailed in the description of 'caseoptions'. ๐ซถ
'incsearch','is'โ type: boolean ยท default:false๐
When this option is set, search and view update for local filter is be performed starting from initial cursor position each time search pattern is changed. โจ
'iooptions'โ type: set ยท default:datasync๐
Controls details of file operations. The following values are available:
datasyncโ periodically synchronize writes on copying files when'syscalls'is set. (This makes copying last as long as it takes to actually write data to the medium, which is slower than you might expect; however, this also prevents system hanging due to filling memory with file-system cache.) ๐ญfastfilecloningโ perform fast file cloning (copy-on-write), when available (available on Linux and btrfs file system). โก
'laststatus','ls'โ type: boolean ยท default:true๐
Controls if status bar is visible. Your main character status bar, slay.
'lines'โ type: integer ยท default: terminal height on startup ๐ซ
Terminal height in lines. Literally just that.
'locateprg'โ type: string ยท default:"locate %a"๐
Specifies the format for an external command to be invoked by the :locate command. The format supports expanding of macros, specific for a particular *prg option, plus the %% sequence for inserting percent sign literally. This option should include the %a macro to specify placement of arguments passed to the :locate command. If the macro is not used, it will be implicitly added after a space to the value of this option. ๐ง
Optional %u or %U macro could be used (if both specified, %U is chosen) to force redirection to custom or unsorted custom view respectively.
'mediaprg'โ type: string ยท default: path to bundled script that supports udevil, udisks and udisks2 (using udisks2 requires python with dbus module installed); OS X: path points to a python script that uses diskutil โ {only for *nix} ๐
Specifies command to be used to manage media devices. Used by the :media command.
The command can be passed the following parameters:
listโ list mediamount {device}โ mount a deviceunmount {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 the exit code of mount and unmount is taken into account to determine whether the operation was performed successfully. ๐ซถ
'lsoptions'โ type: string list ยท default:""ยท scope: local ๐ธ
Configures ls-like view.
columncountโ used for fixed number of columns to display, or0transposedโ used for filling view grid by columns rather than by lines
'lsview'โ type: boolean ยท default:falseยท scope: local โจ
When this option is set, directory view will be displayed in multiple columns with file names similar to output of the ls -x command. See the "ls-like view" section below for format description. This option has no effect if 'millerview' is on. ๐
'milleroptions'โ type: string list ยท default:"lsize:1,csize:1,rsize:1,rpreview:dirs"ยท scope: local ๐
Configures miller view.
lsize:numโ default0โ left columncsize:numโ default1โ center column (can't be disabled)rsize:numโ default0โ right columnrpreview:strโ defaultdirsโ 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 the central (main) column can't be disabled. ๐
rpreview specifies what file-system objects should be previewed in the right column and takes three values: dirs (only directories), files (only files) or all. Neither value enables preview of parent directory (".."). ๐ญ
Example of two-column mode which is useful in combination with :view command:
set milleroptions=lsize:1,csize:2
'millerview'โ type: boolean ยท default:falseยท scope: local ๐
When this option is set, directory view will be displayed in multiple cascading columns. Ignores 'lsview'. The drama?? Iconic.
'mintimeoutlen'โ type: integer ยท default:150๐ซ
The fracture of 'timeoutlen' in milliseconds that is waited between subsequent input polls, which affects various asynchronous operations (detecting changes made by external applications, monitoring background jobs, redrawing UI). There are no strict guarantees, however the higher this value is, the less is CPU load in idle mode. ๐ง
'mouse'โ type: charset ยท default:""๐ฑ๏ธ๐ธ
Contains a sequence of single-character flags:
aโ all supported modes (a shorthand for all the rest and future additions)cโ command-line mode (includes navigation mode)mโ menu modenโ normal modeqโ view modevโ visual mode
'navoptions'โ type: string list ยท default:"open:dirs"๐ฆ
Configures behaviour of navigation mode.
open:strโ defaultdirs
The "open" item specifies what file-system objects should be opened on Enter and can take two values: dirs (only directories) or all. ๐
'number' 'nu'
type: booleandefault:falsescope: local
Slaps a line number in front of every file name โ but ONLY when 'lsview' is turned off, okay? Turn 'lsview' on and this does absolutely nothing. Want to control how wide that little number column is? That's 'numberwidth''s job. Also go peek at 'relativenumber' if you wanna be fancy ๐
'numberwidth' 'nuw'
type: integerdefault:4scope: local
The minimum number of characters reserved for the line number field. That's it, that's the whole vibe. Tiny but iconic ๐
'previewoptions'
type: string listdefault:"graphicsdelay:50000"
This one tweaks how previewing works โ we're talking quick view, miller view's column, and view mode, all of it bestie โจ
graphicsdelay:numโ default0โ delay before drawing graphics (microseconds)hardgraphicsclearโ default unset โ redraw screen to get rid of graphicsmaxtreedepth:numโ default0โ max number of levels in preview treetoptreestatsโ default unset โ show file counts before the tree
So graphicsdelay? You need it when your terminal requires a lil timeout before it can actually draw graphics, otherwise the graphics just get lost ๐ญ gone, evaporated, not coming back.
hardgraphicsclear seems to be necessary to get rid of sixel graphics in some terminals, where it otherwise just lingers there like an ex that won't leave. Lowkey annoying but: this can cause flicker on the screen, because erasure followed by redrawing is a whole production.
0 for maxtreedepth means "unlimited", 1 only shows you the selected directory, 2 adds its children, and so forth, forever and ever ๐
And the default value gets used when an item is missing from the option. So if you forget something, vifm got you ๐ซถ
'previewprg'
type: stringdefault:""scope: local
An external command that gets used INSTEAD of the preview programs you configured via the :fileviewer command. So like, override the whole thing, main character energy ๐
Example:
" always show git log in preview of files inside some repository
au DirEnter '~/git-repo/**/*' setl previewprg='git log --color -- %c 2>&1'
'quickview'
type: booleandefault:false
Whether quick view (:view) is currently active or not. Simple as that ๐
'relativenumber' 'rnu'
type: booleandefault:falsescope: local
Prints the relative line number in front of each file name when the 'lsview' option is turned off. Again, use 'numberwidth' to control the width of the line number field. And the way the various combinations of 'number' and 'relativenumber' play together gives you results like this:
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
Honestly? Chef's kiss. Obsessed ๐ญ
'rulerformat' 'ruf'
type: stringdefault:"%l/%S "
This determines the content of the ruler. Its minimal width is 13 characters, and it's right aligned (yes, always, no negotiating). These macros are supported:
%=โ separation point between left and right aligned halves of the line%lโ file number%Lโ total number of files in view (including filtered out ones)%xโ number of files excluded by filters%0-โ old name for%xmacro%Pโ percentage through file list (All,Top,xx%orBot), always 3 in length%Sโ number of displayed files%=โ separation point between left and right align items%%โ literal percent sign%[โ designates beginning of an optional block%]โ designates end of an optional block
A percent sign can be followed by an optional minimum field width. And add a - before that minimum field width if you want the field to be right aligned, bestie.
Optional blocks? They're ignored unless at least one macro inside of them expands to a non-empty value. No content, no block, periodt.
Example:
set rulerformat='%2l-%S%[ +%x%]'
'runexec'
type: booleandefault:false
Runs the executable file when you hit Enter, l or Right Arrow. The behaviour of the last two depends on the value of the 'lsview' option, so go check that one too, iykyk ๐ฆ
'scrollbind' 'scb'
type: booleandefault:false
When this is set, vifm will try to keep the difference of scrolling positions of the two windows constant. So they scroll together like a lil duo ๐ซถ
'scrolloff' 'so'
type: integerdefault:0
The minimal number of screen lines to keep above and below the cursor. Want the cursor line to ALWAYS be in the middle of the view (except at the beginning or end of the file list, obviously)? Set this to some large value โ like 999. Go wild โจ
'sessionoptions' 'ssop'
- type: set
- default:
tui,state,tabs,savedirs,dhistory
The equivalent of 'vifminfo' but for sessions โ it uses the same values, so if you know that one you already know this one ๐
When BOTH options include the same value, data from the session file has higher priority. (And ngl, data from vifminfo isn't necessarily completely discarded โ instead it's merged with the state of a session the same way state of multiple instances is merged on exit. Cute, right? ๐ธ)
'shell' 'sh'
type: stringdefault:$SHELLor"/bin/sh"or"cmd"(on MS-Windows)
Full path to the shell that gets used to run external commands. And heads up โ on *nix a shell argument can be supplied too, so the shell isn't limited to just a plain path ๐
'shellcmdflag' 'shcf'
type: stringdefault:"-c"or"/C"(forcmd.exeon MS-Windows)
The command-line option used to pass a command to 'shell'. It's used in contexts where the command comes from you, the user.
Okay listen. Using this option to force interactive mode of the shell is most likely a BAD IDEA. In general an interactive host and an interactive child shell can't share the same terminal session. You can't even run such a shell in background. So instead: 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. Please bestie, I'm begging ๐ญ
Also PSA: this option is ignored when 'shell' is set to PowerShell, because of the internal use of -encodedCommand. So don't come for me when it doesn't do anything there ๐
'shortmess' 'shm'
type: charsetdefault:"p"
Holds a sequence of single-character flags. Each flag enables shortening of some message that vifm displays in the TUI. The flags:
Lโ display only last directory in tab line instead of full path.Mโ shorten titles in windows of terminal multiplexers created by vifm down to file name instead of using full path.Tโ truncate status bar messages in the middle if they are too long to fit on the command line."..."will appear in the middle.pโ use tilde shortening in view titles.
Tiny letters, big vibes ๐
'showtabline' 'stal'
type: enumerationdefault:multiple
Speficies when the tab line should be displayed. Possible values:
neverโ never display tab linemultipleโ show tab line only when there are at least two tabsalwaysโ display tab line always
Alternatively 0, 1 and 2 โ the Vim-like values โ are also accepted, and they correspond to "never", "multiple" and "always" respectively. So pick your fighter, you literally can't lose ๐
'sizefmt'
type: string listdefault:"units:iec"
Configures the way size is formatted in that human-friendly way we all love ๐
units:โ valueiecโ Use 1024 byte units (KorKiB, etc.). See the'iec'option.units:โ valuesiโ Use 1000 byte units (KB, etc.).precision:โ valuei > 0โ How many fraction digits to consider.precision:โ value{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. No leftovers, no crumbs โจ
Example:
set sizefmt=units:iec,precision:2,nospace
'slowfs'
type: string listdefault:""- only for *nix
A list of mounter fs name beginnings (first column in /etc/mtab or /proc/mounts) or path prefixes for fs/directories that work TOO slow for you. Think of it as telling vifm "hey bestie, don't bother those ones, they're doing their best but slowly" ๐
This option can be used to stop vifm from making some requests to particular kinds of file systems that can slow down file browsing. Currently this means: don't check if directory has changed, skip check if target of symbolic links exists, assume that link target located on slow fs to be a directory (allows entering directories and navigating to files via gf). If you set the option to "*", it means ALL the systems are considered slow (useful for cygwin, where all the checks might render vifm very slow if there are network mounts).
Example for autofs root /mnt/autofs:
set slowfs+=/mnt/autofs
'smartcase' 'scs'
type: booleandefault:false
Overrides the ignorecase option if a pattern contains at least one upper case character. Only used when the 'ignorecase' option is enabled. So type a capital letter and suddenly case matters โ it's giving โจselectiveโจ and honestly, relatable ๐ธ
โจ 'sort' โจ
type: string list default: +name on *nix and +iname on Windows scope: local
okay bestie this one sets the list of sorting keys โ first item is the primary key, second is the secondary key, and so on down the line ๐ it's giving "ranked list but for file ordering". The available keys are:
[+-]extโ extension of files and directories[+-]fileextโ extension of files only[+-]nameโ name (including extension)[+-]inameโ name (including extension, ignores case)[+-]typeโ file type (dir/reg/exe/link/char/block/sock/fifo)[+-]dirโ directory grouping (directory < file)[+-]gidโ group id (*nix only)[+-]gnameโ group name (*nix only)[+-]modeโ file type derived from its mode (*nix only)[+-]permsโ permissions string (*nix only)[+-]uidโ owner id (*nix only)[+-]unameโ owner name (*nix only)[+-]nlinksโ number of hard links (*nix only)[+-]inodeโ inode number (*nix only)[+-]sizeโ size[+-]nitemsโ number of items in a directory (zero for files)[+-]groupsโ groups extracted via regexps from'sortgroups'[+-]targetโ symbolic link target (empty for other file types)[+-]atimeโ time accessed (e.g., read, executed)[+-]ctimeโ time changed (changes in metadata, like mode)[+-]mtimeโ time modified (when file contents is changed)
๐ธ note bestie: go look forst_atime,st_ctimeandst_mtimeinman 2 statif you want the full tea on the time keys.
+ means ascending sort for that key, and - means descending sort. periodt.
The dir key is kinda 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 literally why if you want your sorting algorithm to mix directories and files together, you append dir to the sorting option, like this:
set sort+=dir
or
set sort=-size,dir
The value of the option gets checked to include the dir key and the default sorting key (name on *nix, iname on Windows). Here's what happens if one of them is missing, no cap:
typekey is added at the beginning;- default key is added at the end;
all other keys are left untouched (at most they are moved). ๐ซถ
This option also changes view columns according to the primary sorting key set, unless the 'viewcolumns' option is not empty โจ
๐ข 'sortnumbers' ๐ข
type: boolean default: false scope: local
Natural sort of (version) numbers within text. yeah it just gets it.
๐ 'sortgroups' ๐
type: string default: "" scope: local
Sets a comma-separated list of regular expressions for the group type of sorting. Double the comma to insert it literally ๐
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 โ iconic behaviour honestly.
Each expression should contain at least one group or its value will be considered to be always empty. Also, only the first match of the regular expression is processed. ๐
The first group divides the list of files into sub-groups, each of which is then sorted by substrings extracted using the second regular expression and so on recursively. it's giving nesting dolls but for sorting ๐
Example:
set sortgroups=-(todo|done).*
this would group files with -done in their names and files with -todo separately. On ascending sorting, the group containing -done would appear before the other one. slay.
๐ 'sortorder' ๐
type: enumeration default: ascending Sets sort order for primary key: ascending, descending.
๐ 'statusline' 'stl' ๐
type: string default: "" Determines the content of the status line (the line right above the command-line). Empty string means use the same format like in previous versions. The following macros are supported, bestie, take notes:
%Nโ line break (increases height of the status line accordingly), ignores%[%]blocks%tโ file name (considering value of the'classify'option)%Tโ symbolic link target (empty for other filetypes)%fโ file name relative to current directory (considers'classify')%Aโ file attributes (permissions on *nix or properties on Windows)%oโ file permissions in octal form on *nix (nothing on Windows)%uโ user name or uid (if it cannot be resolved)%gโ group name or gid (if it cannot be resolved)%sโ file size in human readable format%Eโ size of selected files in human readable format, same as%swhen no files are selected, except that it will never show size of../in visual mode, since it cannot be selected%dโ file modification date (uses'timefmt'option)%Dโ path of the other pane for single-pane layout%aโ amount of free space available on current FS%cโ size of current FS%zโ short tips/tricks/hints that chosen randomly after one minute period%{<expr>}โ evaluate arbitrary vifm expression<expr>, e.g.'&sort'orexpand('%d'); a raw}can be inserted as\}(mind that the slash doesn't need to be doubled to be inserted literally)%*โ resets or applies one ofUser1..User20highlight groups; reset happens when width field is 0 or not specified, one of the groups gets picked when width field is in the range from 1 to 20- all
'rulerformat'macros
Percent sign can be followed by optional minimum field width. Add - before minimum field width if you want the field to be right aligned ๐
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
Example without colors:
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 "
๐ก 'suggestoptions' ๐ก
type: string list default: (empty)
Controls when, for what and how suggestions are displayed. The following values are available:
normalโ in normal mode;visualโ in visual mode;viewโ in view mode;otherpaneโ use other pane to display suggestions, when available;delay[:num]โ display suggestions after a small delay (to do not annoy if you just want to type a fast shortcut consisting of multiple keys),numspecifies the delay in ms (500 by default),'timeoutlen'at most;keysโ include shortcuts (commands and selectors);foldsubkeysโ fold multiple keys with common prefix;marksโ include marks;registers[:num]โ include registers, at mostnumfiles (5 by default).
๐ 'syncregs' ๐
type: string default: "" Specifies identifier of a group of instances that share registers among each other. When several instances of vifm have this option set to an identical value, they automatically synchronize contents of their registers on operations which use them. besties sharing secrets fr fr ๐ซถ
โ๏ธ 'syscalls' โ๏ธ
type: boolean default: false When disabled, vifm will rely on external applications to perform file-system operations, otherwise system calls are used instead (much faster and supports progress tracking). The option should eventually be removed. Mostly *nix-like systems are affected. ngl the "will be removed" is giving deprecated energy, so don't get too attached ๐
๐ท๏ธ 'tablabel' ๐ท๏ธ
type: string default: "" When non-empty and 'tabline' isn't set, determines the format of the main part of a single tab's label.
When empty, the tab label is set to either the tab name for named tabs or to the view title (usually current path) for unnamed tabs.
The following macros can appear in the format (see below for what a flag is):
%Cโ flag of a current tab%Nโ number of the tab%Tโ flag of a tree mode%cโ description of a custom view%nโ name of the tab%pโ path of the view (handles filename modifiers)%tโ title of the view (affected by'shortmess'flags)%%โ literal percent sign%[โ designates beginning of an optional block%]โ designates end of an optional block%*,%0*โ resets highlighting%1*-%20*โ applies one ofUser1..User20highlight groups
In global tabs, the view in the bullets above refers to the currently active view of that tab ๐
Flag macros are a special kind of macro that always expand to an empty value and are meant 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
๐ 'tabline' 'tal' ๐
type: string default: "" When non-empty, determines the format of the tab line. Note that mouse clicks won't be handled when this option is non-empty. ๐ซ
The following macros can appear in the format:
%*,%0*โ resets highlighting%1*-%20*โ applies one ofUser1..User20highlight groups
'tabprefix'
- type: string
- default:
"[%N:"
bestie this is literally just the lil' intro bit of a tab's label ๐
it decides the prefix of a tab's label, and the formatting is done exactly the same way as for the 'tablabel' option, no cap.
'tabscope'
- type: enumeration
- default: global
this one picks the style of tabs, and that style is what defines what a single tab actually contains ๐
possible values, periodt:
- global โ a tab describes the complete UI of two views and how they are arranged
- pane โ a tab is located "inside" a pane and manages it and quick view
'tabstop' 'ts'
- type: integer
- default: value from curses library
how many spaces does a Tab in the file count for? this many, bestie ๐
'tabsuffix'
- type: string
- default:
"]"
the matching outro to 'tabprefix' โ it determines the suffix of a tab's label, and the formatting is done as for the 'tablabel' option ๐ธ
'timefmt'
- type: string
- default:
"%m/%d %H:%M"
the format of time in the file list โฐ see man 1 date or man 3 strftime for the details, iykyk.
'timeoutlen' 'tm'
- type: integer
- default:
1000
the time in milliseconds that gets waited for a mapped key when the key sequence you already typed is ambiguous ๐ญ she's patient but not that patient.
'title'
- type: boolean
- default: true when title can be restored, false otherwise
when it's enabled, the title of the terminal (or the terminal multiplexer's window) gets updated according to the current location ๐
because not every terminal supports setting the title, this only works if $TERM matches one of these conditions:
- equals
"xterm"or starts with"xterm-" - equals
"rxvt"or starts with"rxvt-" - equals
"screen"or starts with"screen-" - equals
"aterm" - equals
"Eterm"
'trash'
- type: boolean
- default: true
use the trash directory ๐๏ธ see the "Trash directory" section below, bestie.
'trashdir'
- type: string
- default:
on *nix:
"%r/.vifm-Trash-%u,$XDG_DATA_HOME/vifm/Trash,%r/.vifm-Trash"
or
"%r/.vifm-Trash-%u,$VIFM/Trash,%r/.vifm-Trash"
on Windows:
"%r/.vifm-Trash,$XDG_DATA_HOME/vifm/Trash"
or
"%r/.vifm-Trash,$VIFM/vifm/Trash"
it's a list of trash directory path specifications, separated with commas ๐ each list item either defines an absolute path to the trash directory, or a path relative to a mount point root when the list element starts with "%r/". the value of the option can contain environment variables (of the form "$envname"), which get expanded โ prepend $ with a slash to stop the expansion. environment variables are expanded when the option is set.
on *nix, if an element ends with "%u", the mark is replaced with the real user ID and permissions are set so that only that owner is able to use it ๐
ngl, even this setup is not completely secure when combined with "%r/", and it's overall safer to keep files in the home directory โ but that implies the cost of copying files between partitions ๐ฌ
when a new file gets cut (deleted), vifm traverses each element of the option in the order of their appearance and uses the first trash directory that it was able to create, or that's already writable โจ
the default value tries to use a trash directory per mount point and falls back to the common trash directory on failure.
it will attempt to create the directory if it doesn't exist ๐ซถ see the "Trash directory" section below.
'tuioptions' 'to'
- type: charset
- default:
"psv"
each flag here configures some aspect of the TUI's appearance ๐
pโ when included:- the file list inside a pane gets additional single character padding on left and right sides;
- quick view and view mode get single character padding.
sโ when included, left and right borders (side borders, hence the "s" character) are visible.uโ use Unicode characters in the TUI (Unicode ellipsis instead of"...").vโ vary the width of the vertical middle border to equalize view sizes.
each pane title contains the path of the listed directory. if it's too large, the path is truncated on the left for the active pane and on the right for the other pane ๐ and this can be modified with:
lโ truncation is always on the left.rโ truncation is always on the right.
'uioptions'
- type: set
- default:
tweaks UI behaviour ๐ the following values are available:
- iodetails โ show the I/O progress details dialog automatically instead of displaying progress on the statusbar until the user presses
"i"to see the dialog.
'undolevels' 'ul'
- type: integer
- default:
100
the maximum number of changes that can be undone ๐ญ note that here a single file operation is used as a unit, not the operation itself โ i.e. deleting 101 files will exceed the default limit. she stays bookkeeping fr fr.
'vicmd'
- type: string
- default:
"vim"
the command used to edit files in various contexts ๐๏ธ an ampersand sign at the end (regardless of whether it's preceded by a space or not) means backgrounding of the command.
the background flag is ignored in certain contexts where vifm waits for the editor to finish ๐ such contexts include any command that spawns an editor to change the 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 the cursor when the location is known โจ
'viewcolumns'
- type: string
- default:
"" - scope: local
a format string containing the list of columns in the view ๐ when this option is empty, the view columns to show get chosen automatically using the sorting keys (see 'sort') as a base. the value of this option is ignored if 'lsview' is set. see the "Column view" section below for the format description.
an example of setting the options for both panes (note the :windo command):
windo set viewcolumns=-{name}..,6{size},11{perms}
'vixcmd'
- type: string
- default: value of
'vicmd'
same as 'vicmd', but it takes precedence over it when running inside a graphical environment ๐
'vifminfo'
- type: set
- default:
bookmarks,bmarks
controls what will be saved in the $VIFM/vifminfo file ๐พ
- bmarks โ named bookmarks (see
:bmarkcommand) - bookmarks โ marks, except for special ones like
'<and'> - cs โ primary color scheme
- dirstack โ directory stack (overwrites previous stack, unless stack of current instance is empty)
- registers โ registers content
- savedirs โ last visited directory
- state โ file name and dot filters and terminal multiplexers integration state
- tabs โ global or pane tabs
- tui โ state of the user interface (sorting, number of windows, quick view state, active view)
- chistory โ command line history
- dhistory โ directory history
- ehistory โ expression register history (see description of Ctrl+R = in command-line mode)
- fhistory โ history of local filter (see description of the
"="normal mode command) - mchistory โ command line history of menus
- phistory โ prompt history
- shistory โ search history (
/and?commands) - commands โ user defined commands (see
:commanddescription) (obsolete) - filetypes โ associated programs and viewers (obsolete)
- options โ all options that can be set with the
:setcommand (obsolete)
'vimhelp'
- type: boolean
- default: false
use vim help format ๐ that's it, that's the whole vibe.
'wildinc'
- type: string
- default:
""
a comma-separated list of globs which defines what should be completed incrementally โจ currently, it can only be :commands, which are matched with the colon in front of their name. for such commands, completion is always active and is displayed even if there's only one completion item ๐
examples:
" for all :commands
set wildinc=:*
" only for these two
set wildinc=:wingo,:bmgo
see the "Patterns" and "Globs" sections for more info on the syntax ๐ซถ
'wildmenu' 'wmnu'
- type: boolean
- default: false
controls whether possible matches of completion will be shown above the command line ๐ธ
'wildstyle'
- type: enumeration
- default: bar
picks the presentation style of the wild menu ๐ possible values:
- bar โ one-line with left-to-right cursor
- popup โ multi-line with top-to-bottom cursor
'wordchars'
- type: string list
- default:
"1-8,14-31,33-255"(that is all non-whitespace characters)
specifies which characters in command-line mode should be considered as part of a word ๐ค the value of the option is a comma-separated list of ranges. if both endpoints of a range match, a single endpoint is enough (e.g. "a" = "a-a"). both endpoints are inclusive. there are two accepted forms: the character representing itself, or a number encoding the character according to the ASCII table ๐ in the case of ambiguous characters (dash, comma, digit), use the numeric form. accepted characters are in the range from 0 to 255. any Unicode character with code greater than 255 is considered to be part of a word.
the option affects Alt+D, Alt+B and Alt+F, but not Ctrl+W. this is intentional, 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:
cnoremap <c-w> <a-b><a-d>
also used for abbreviations โจ
'wrap'
- type: boolean
- default: true
controls whether to wrap text in quick view ๐ฆ
'wrapscan' 'ws'
- type: boolean
- default: true
searches wrap around the end of the list ๐ iconic behaviour, honestly.
โจ Mappings โจ
okay bestie, mappings are literally the group chat of keybinds ๐
A user mapping like nnoremap lhs rhs defines a substitution of the left-hand-side (LHS) with the right-hand-side (RHS) in the input stream. A regular mapping (without "nore" in :command's name) expands recognized sequences in the RHS, while a *noremap mapping always interprets RHS as if no user mappings were defined and each key has its builtin meaning. In most cases you want to use the noremap variant, and if your RHS includes LHS, only the noremap variant will work because recursion in a mapping is not allowed. no cap ๐ซ๐
In order to define a mapping, determine in which mode you want to activate it and use an appropriate *noremap :command (e.g., :nnoremap for a normal mode mapping). RHS doesn't have to limit itself to the mode in which the mapping was started and can span multiple modes. it's giving main character energy across modes fr fr โจ
๐ Map arguments ๐
LHS of mappings can be preceded by arguments which take the form of special sequences:
<silent>โ Postpone UI updates until RHS is completely processed. lowkey polite, honestly ๐ซถ<wait>โ In case of builtin mapping causing conflict for a user-defined mapping (e.g.,tbuiltin to a partially typedtauser-defined mapping), ignore the builtin mapping and wait for input indefinitely as opposed to default behaviour of triggering the builtin mapping after a delay defined by'timeoutlen'. Example:
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:
<cr>โ Enter key. โ<esc>โ Escape key. ๐ณ<space>โ Space key. ๐ซง<lt>โ Less-than character (<).<nop>โ provides a way to disable a mapping (by mapping it to<nop>). iconic ๐ซ<bs>โ Backspace key (see key conflict description below).<tab><s-tab>โ Tabulation and Shift+Tabulation keys.<home><end>โ Home/End.<left><right><up><down>โ Arrow keys.<pageup><pagedown>โ PageUp/PageDown.<del><delete>โ Delete key.<del>and<delete>mean different codes, but<delete>is more common.<insert>โ Insert key.<s-home><s-end>/<s-left><s-right><s-up><s-down>/<s-pageup><s-pagedown>/<s-delete><s-insert>โ Shift + one of the keys from above, if terminal and its terminfo supports it.<c-a>,<c-b>,...,<c-z>,<c-[>,<c->,<c-]>,<c-^>,<c-_>โ Control + some key (see key conflict description below).<c-@>{only for *nix}โ Control + Space.<a-a>,<a-b>,...,<a-z>/<m-a>,<m-b>,...,<m-z>/<a-0>,<a-1>,...,<a-9>{only for *nix}/<m-0>,<m-1>,...,<m-9>{only for *nix}โ Alt + some key.<a-s-a>,<a-s-b>,...,<a-s-z>{only for *nix}/<s-a-a>,<s-a-b>,...,<s-a-z>{only for *nix}/<m-s-a>,<m-s-b>,...,<m-s-z>{only for *nix}/<s-m-a>,<s-m-b>,...,<s-m-z>{only for *nix}โ Alt + Shift + some key.<a-c-a>,<a-c-b>,...,<a-c-z>{only for *nix}/<m-c-a>,<m-c-b>,...,<m-c-z>{only for *nix}โ Alt + Ctrl + some key.<f0>-<f63>โ functional keys. These also correspond to keys like<c-f1>and can be used in their place.<c-f1>-<c-f12>โ functional keys with Control key pressed.<a-f1>-<a-f12>,<m-f1>-<m-f12>โ functional keys with Alt key pressed.<s-f1>-<s-f12>โ functional keys with Shift key pressed.
Note that whether and how functional keys work might depend on the terminal and corresponding terminfo record. fr fr, terminal lore is real ๐ง
Note that due to the way terminals process their input, several keyboard keys might be mapped to single key code, for example:
<cr>and<c-m>;<tab>and<c-i>;<c-h>and<bs>and<del>;- etc.
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>
Also sometimes neither of them might work and it's <del> key which corresponds to your backspace (don't mind the name). ๐
๐ง 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. periodt ๐ซถ
โจ Expression syntax โจ
okay so bestie, vifm has its own lil expression language and here's the tea: it's a subset of what VimL gives you. Not the whole buffet, just the good parts. ๐ซถ
Here's the entire syntax summary, ordered from least significant to most significant (so the ones at the top bind the loosest, the ones at the bottom latch on the tightest):
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
g:var global variable
v:var builtin variable (read-only)
function(expr1, ...) function call
(expr1) nested expression
And that ".." situation? It means the operations at that level can be concatenated, like, endlessly. Stack 'em up. ๐
expr1
expr2 || expr2 โ this is the logical OR babe.
- Both arguments get converted to numbers before anything gets evaluated.
- The result is non-zero if at least one of the arguments is non-zero. One lil truthy guy is all it takes. โจ
- It's right associative and it short-circuits, so sub-expressions get evaluated from left to right until the result of the whole expression is determined (i.e., until the first non-zero) or until we run out of expression.
expr2
expr3 && expr3 โ logical AND, the picky one.
- Arguments are converted to numbers before evaluation.
- The result is non-zero only if both arguments are non-zero. Both. No exceptions. Both.
- Also right associative, also short-circuiting, so sub-expressions are evaluated from left to right until the result of the whole expression is determined (i.e., until the first zero) or the expression ends.
expr3
expr4 {cmp} expr4 โ comparison era.
You compare two expr4 expressions and you get 0 if it evaluates to false, or 1 if it evaluates to true. That's it. Binary queen. ๐
- equal โ
== - not equal โ
!= - greater than โ
> - greater than or equal โ
>= - smaller than โ
< - smaller than or equal โ
<=
Examples, because seeing it > reading it:
'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 additionexpr5 - expr5 ..โ number subtraction
Basic math, we love her. ๐
Examples:
1 + 3 - 3 == 1
1 + '2' == 3
expr5
expr6 . expr6 .. โ string concatenation. That's the lone dot, bestie, do not confuse her with the .. situation.
Examples:
'a' . 'b' == 'ab'
'aaa' . '' . 'c' == 'aaac'
expr6
The unary corner of the language. Three icons:
- expr6โ unary minus+ expr6โ unary plus! expr6โ logical NOT
The deets:
- For
-the sign of the number is changed. - For
+the number is unchanged. (Yes it literally just vibes there.) - For
!non-zero becomes zero, zero becomes one. - A String will be converted to a Number first.
These operations can be repeated and mixed, and honestly that's where it gets fun. Examples:
--9 == 9
---9 == -9
-+9 == 9
!-9 == 0
!'' == 1
!'x' == 0
!!9 == 1
expr7
This is the bottom of the food chain, the most significant level โ the actual values. expr7 can be any of these:
numberโ number constant"string"โ string constant,\is special'string'โ string constant,'is doubled&optionโ option value$VARโ environment variableg:varโ global variablev:varโ builtin variable (read-only)function(expr1, ...)โ function call(expr1)โ nested expression
Now let's meet each one properly. ๐
number
number โ a number constant. It's decimal. That's the whole vibe.
Examples:
0 == 0
0000 == 0
01 == 1
123 == 123
10000 == 10000
string
"string" โ a string constant. Note that double quotes are used here, not the single ones. ๐
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' โ also a string constant, but single quotes this time.
This string is taken as it is. No backslashes are removed, none of them have a special meaning, nothing. The only exception is that two quotes stand for one quote.
Examples:
'All\slashes\are\saved.'
'This string contains doubled single quotes ''here'''
option
Reading a setting right out of the config, no cap:
&optionโ option value (local one is preferred, if it 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, she's not a real one). See the :set options section above if you need a refresher. โจ
environment variable
$VAR โ environment variable.
The String value of any environment variable. And when it's not defined? The result is an empty string. No drama, just silence. ๐
Examples:
'This is my $PATH env: ' . $PATH
'vifmrc at ' . $MYVIFMRC . ' is used.'
global variable
g:var โ global variable.
A typed storage of data for use in scripting. Can be created/removed dynamically (via :let and :unlet) and used in expressions. Build her up, tear her down. ๐ฆ
builtin variable
v:var โ builtin variable.
Information exposed by vifm for use in scripting. Such variables are predefined and read-only, but not necessarily constant. The full roster:
v:countโ count passed to:command, 0 by default. Can be used in mappings to pass the count to a different command.v:count1โ same asv:count, but 1 by default.v:jobcountโ number of active jobs (as can be seen in the:jobsmenu).v:sessionโ name of the current session or empty string.v:servernameโ See below.v:versionโ version of the application as an integer. Versionx.y.zbecomes numberx*100*100 + y*100 + z, examples:- v0.14 (that is v0.14.0) is 1400 (leading zeroes omitted)
- v1.0.2 is 10002
Release candidates aren't real releases, they report the number of a corresponding release.
function call
function(expr1, ...) โ function call. See the "Functions" section below, bestie, there's a whole cast of characters down there. ๐
Examples:
"'" . filetype('.') . "'"
filetype('.') == 'reg'
expression nesting
(expr1) โ nested expression.
Groups any other expression of arbitrary complexity enforcing order in which operators are applied. Basically parentheses doing parentheses things. Main character energy for a couple of curved lines, honestly. ๐
โจ FUNCTIONS โจ
Okay bestie, THIS is where it gets fun ๐
these are the built-in functions you can call from your expressions. Think of them as your little toolbox of โจmagicโจ that you drop into :execute, statuslines, mappings, all of it. Each one gives you back a value, and here's the whole vibe check first:
chooseopt({opt})โ String โ queries the choose parameters that got passed at startup ๐escape({string}, {chars})โ String โ hands you back {string} after escaping {chars} inside itexecutable({expr})โ Integer โ checks whether the {expr} command is actually available ๐expand({expr})โ String โ expands special keywords in {expr}extcached({cache}, {path}, {extcmd})โ String โ caches the output of {extcmd} per {cache} and {path} combo, no capfilereadable({path})โ Integer โ checks whether {expr} points to a non-directory that can be read ๐filetype({file} [, {resolve}])โ String โ returns the file type from a position or a pathfnameescape({expr})โ String โ escapes {expr} so it's safe to use in a:commandgetpanetype()โ String โ returns the type of the current panehas({property})โ Integer โ checks whether this instance has {property}input({prompt} [, {initial} [, {completion}]])โ String โ prompts the user for input right on the command-line ๐ฌlayoutis({type})โ Integer โ checks whether the layout is of type {type}paneisat({loc})โ Integer โ checks whether the current pane is at {loc}selected()โ Integer โ returns the number of files currently selectedsystem({command})โ String โ runs a shell command and gives you back its outputtabpagenr([{arg}])โ Integer โ returns the number of the current or the last tabterm({command})โ String โ likesystem(), but for interactive commands ๐ฅ๏ธ
๐ธ chooseopt({opt})
Gets you the values of the options related to file choosing. {opt} can be any one of these:
filesโ returns the argument of--choose-files, or an empty stringdirโ returns the argument of--choose-dir, or an empty stringcmdโ returns the argument of--on-choose, or an empty stringdelimiterโ returns the argument of--delimiter, or the default one (\n)
๐ธ escape({string},{chars})
Escapes every single occurrence of {chars} in {string} by sticking a slash (\) in front of them. Real talk though: the slash itself does not get escaped unless it shows up in {chars}. So don't come for me when your backslashes are still unbothered ๐
๐ธ executable({expr})
If {expr} is an absolute or relative path, it checks whether that path's destination exists and refers to something executable. Otherwise it checks whether a command named {expr} is present in the directories listed in $PATH. On Windows it also checks for various executable extensions. Either way you get a boolean value describing the 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} โ in that order, bestie, don't mix it up. Returns a string. Check the "Command macros" section above if you need a refresher ๐ฆ
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')
" full path to the current file with backslashes
:echo expand('%c:p:gs!/!\!')
๐ธ extcached({cache}, {path}, {extcmd})
Caches the value of the {extcmd} external command and auto-updates it as needed, based on monitoring the change date of a {path}. The cache gets invalidated whenever the file or its meta-data is updated. And yes, a single path can have multiple caches associated with it โ she contains multitudes ๐
The {path} value is normalized, but symbolic links inside it are not 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')) }"
๐ธ filereadable({path})
Checks whether {path} exists, refers to a non-directory entry, and has permissions that allow reading. Returns a boolean value describing the result of the check. Simple as that, periodt โจ
๐ธ filetype({file} [, {resolve}])
Checks the type of a view's entry, or of a file specified by its path.
The {file} parameter can take these forms:
.to get the type of the file under the cursor in the active pane- a numerical value base 1, to get the type of the file on that specified line number (only works if there are no characters other than
+-0123456789) - a path (prepend
./to force a number or.to be interpreted as a path instead)
The optional {resolve} parameter is treated as a boolean and says whether symbolic links should be resolved.
The result is a string representing the file type, and it's one of these:
exeโ executablesregโ regular fileslinkโ symbolic linksbrokenโ broken symbolic links (only appears when resolving)dirโ directoriescharโ character devicesblockโ block devicesfifoโ pipessockโ *nix domain sockets?โ unknown file type (should not normally happen) or a non-file (those pseudo-entries in compare view)
The result can also be an empty string if you handed it an invalid argument ๐
๐ธ fnameescape({expr})
Escapes a parameter to make it suitable for use as an argument of a :command. The list of escaped characters includes %, which gets doubled.
Usage example:
" navigate to most recently modified file in current directory
execute 'goto' fnameescape(system('ls -t | head -1'))
๐ธ getpanetype()
Gets you a string describing the type of the current pane. Possible return values:
regularโ regular file listing of some directorycustomโ custom file list (%u)very-customโ very custom file list (%U)treeโ tree viewcompareโ compare view
๐ธ has({property})
Lets you peek at internal parameters from scripts, so you can figure out stuff like the environment the app is running in. Returns 1 if the property is true/present, otherwise you get 0. Right now these are the supported properties (anything else will just hand you a 0):
unixโ runs in a *nix-like environment (including Cygwin)winโ runs on Windows#*โ whether a particular Lua handler exists
Usage example:
" skip user/group on Windows
if !has('win')
let $RIGHTS = '%10u:%-7g '
endif
execute 'set' 'statusline=" %t%= %A '.$RIGHTS.'%15E %20d "'
๐ธ input({prompt} [, {initial} [, {completion}]])
Creates a command-line prompt to grab the user's input ๐ฌ You can supply an initial value as the optional second parameter โ otherwise an empty string is used.
The optional third parameter specifies the kind of completion, which can be one of:
dirโ paths to directoriesfileโ paths to files and directories""โ (empty string, the default) no completion at all
Heads up bestie: the behaviour here differs from Vim. In Vim, executing a mapping likennoremap j :echo input('text: ')<cr>inputleaves you sitting in a prompt mode withinputtyped in. Vifm? She will wait for you to leave the prompt and then continue executing the mapping. Different girl, different energy ๐
Usage example:
nnoremap ,m : let $DIR_NAME = input('mkdir: ', '', 'dir')
\| if $DIR_NAME != ''
\| execute 'mkdir' fnameescape($DIR_NAME)
\| endif<cr>
๐ธ layoutis({type})
Checks whether the current interface layout is {type} or not โ where {type} can be:
onlyโ single-pane modesplitโ 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 the position of the active pane in the current layout matches one of these locations:
topโ pane reaches the top borderbottomโ pane reaches the bottom borderleftโ pane reaches the left borderrightโ pane reaches the right border
๐ธ selected()
Gets you the number of files selected in the active pane. That's it, that's the whole function, and she ate ๐
๐ธ system({command})
Runs the command in a shell and returns its output (the standard output and standard error streams joined together). All trailing newline characters get stripped, so you can easily append stuff to the command's output. Ctrl+C should interrupt the command, fr fr.
Use this function to consume the output of external commands that don't need user interaction โ and use term() for interactive commands that make use of the terminal and are capable of handling stream redirection. Pick the right girl for the job ๐
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 you call it with no arguments, it returns the number of the current tab page, base one.
When you call it with "$" as the argument, it returns the number of the last tab page, base one โ which is the same as the number of tabs. Iconic โจ
๐ธ term({command})
Same as the system() function, but the user interface gets shut down while the command executes, which makes absolutely sure that external interactive applications won't mess with the way the terminal is used by vifm. Main character energy for your terminal ๐ฅ๏ธ๐
Usage example:
" command to change directory by picking it via fzf
command! fzfcd :execute 'cd'
\ fnameescape(term('find -type d | fzf 2> /dev/tty'))
๐ Menu commands ๐
:range โ navigate to a menu line, that's it bestie.
:chi[story] โ pops open a menu of all your saved menus. โจ For the controls, go peek at the "Menus and dialogs" section, and the "Menus history" section too.
:col[der] โ loads an older navigation menu, but only if one exists. See also "Menus history" section. ๐
:cnew[er] โ loads a newer navigation menu, if there's one kicking around.
:fin[d] โ does exactly what the non-menu :find does, except no range is accepted here. If your active view was holding a selection before you entered menu mode, this command takes it into account. ๐
:gr[ep] โ same deal as non-menu :grep, but again, no range accepted. And yeah, if the active view had a selection before menu mode, it factors that in. ๐ซถ
:exi[t][!] :q[uit][!] :x[it][!] โ all three just leave menu mode. bye ๐
:noh[lsearch] โ resets the search match highlighting. clean slate โจ
:w[rite] {path} โ writes all menu lines out into the file at {path}.
๐ Common keys of all menus and dialogs ๐
j, Ctrl+N โ move the cursor down. โฌ๏ธk, Ctrl+P โ move the cursor up. โฌ๏ธ- Enter โ select and, usually, close the menu/dialog.
- Ctrl+L โ redraw the menu/dialog. ๐๏ธ
- Escape, Ctrl+C
ZZ,ZQqโ close menu/dialog. ๐ช
๐ Common keys of all menus ๐
- Ctrl+B, Ctrl+F
- Ctrl+D, Ctrl+U
- Ctrl+E, Ctrl+Y
/,?n,N[count]G,[count]ggH,M,Lzb,zt,zzโ all of these mean exactly the same thing they do in normal mode. no cap. ๐[count]zhโ scroll menu items [count] characters (default is 1) to the right. โก๏ธ[count]zlโ scroll menu items [count] characters (default 1) to the left. โฌ ๏ธzHโ scroll menu items half the screen width to the right.zLโ scroll menu items half the screen width to the left.:โ enter command line mode for menus.bโ treats the content of the menu as a list of paths and uses it to create a custom view in place of the previously active pane. ๐ Check the "Custom views" section below.Bโ same asb, but makes an unsorted view.vโ loads menu content into the quickfix list of an editor (Vim-compatible, assumed), or, if that list has no separators after file names (colons), it opens each line as a file name. ๐ฅ
๐ฆ Navigation menus ๐ฆ
This whole vibe applies to these menus:
:bmarks,:bmgo:find:grep:locate- user menu with navigation (the
%Mmacro)
Keys:
gfโ navigate the previously active view to the currently selected item. Leaves menu mode... except for the:grepmenu. Pressing Enter orldoes the exact same thing.eโ open selected path in an editor, and stays in menu mode. ๐cโ leave menu preserving file selection, then insert the file name after:!in command-line mode. Does absolutely nothing in:bmarksand:bmgo. ๐
Heads up bestie: each of these menus can have extra keys too, peep below.
โจ History menus (:history *) โจ
๐ธ Command-line history menu
- Enter,
lโ execute the item as a command-line command, a search query, or a local filter. cโ leave the menu preserving file selection, and insert the item into the command-line of the appropriate kind.
๐ธ Directory history menu
- Enter,
lโ navigate into the selected directory.
๐ธ Menu commands history menu
- Enter,
lโ execute command without leaving the menu. cโ insert menu item into the command-line for editing.
๐ Other menus ๐
Apropos (:apropos) menu
- Enter,
lโ runmanon a given topic. The menu won't close automatically, so you can vibe through several pages one by one. ๐
Bookmarks (:bmarks, :bmgo) menu
- Enter,
lโ navigate to the selected bookmark. ddโ remove bookmark under the cursor. ๐๏ธ
Also see the gf and e keys from above. ๐
Command-line mode abbreviations (:cabbrev) menu
ddโ remove abbreviation under the cursor.
Color scheme (:colorscheme) menu
- Enter,
lโ apply the selected colorscheme exactly as if:colorscheme <name>had been typed on the command-line. ๐จ
Commands (:command) menu
- Enter,
lโ execute the command with empty arguments (the%amacro). ddโ remove command under the cursor.cโ leave menu preserving file selection, and insert the right-hand side of the selected command into the command-line.
Directory stack (:dirs) menu
- Enter,
lโ rotate the stack to put the selected directory pair at the top. ๐
File (:file) menu
Commands from vifmrc, or ones you typed on the command-line, show up above an empty line โ if that empty line is there. Everything below the empty line comes from .desktop files. ๐
Commands detected as available get a "[present]" to their left. โ
- Enter,
lโ run the selected command (doesn't matter whether it was detected as present or not). cโ leave menu preserving file selection, and insert command after:!in command-line mode.
Grep (:grep) menu
- Enter,
lโ open file in an editor set by'vicmd'at the given line number. The menu won't close automatically, so you can check more than one result. ๐
Also see the gf, e and c keys above.
Jobs (:jobs) menu
ddโ request cancellation of the job under the cursor. The job won't be removed from the list, it just gets marked as being cancelled (if cancellation was successfully requested). A message pops 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โ display errors of the selected job, if any were collected. They show up in a new menu, but you can get back to the jobs menu by pressingh.rโ reload the list of jobs.
Marks (:marks) menu
- Enter,
lโ navigate to selected mark. ddโ remove mark under the cursor.
Media (:media) menu
- Enter,
lโ behaviour differs by line kind:- mount an unmounted device
- navigate to the first mount point of a mounted device
- navigate to a mount point
- do nothing for
"not mounted"or an empty line
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.
Menus history (:chistory) menu
- Enter,
lโ load selected menu.
Plugins (:plugins) menu
eโ display log messages of the selected plugin, if any were collected. They show up in a new menu, but you can return to the plugins menu by pressingh.gfโ navigate the previously active view to the location of the selected plugin. Leaves the menu mode. ๐ง
Trash (:lstrash) menu
rโ restore a file from the trash to its original location. โป๏ธddโ delete file under the cursor.
Trashes (:trashes) menu
- Enter,
lโ navigate into current trash directory. ddโ start emptying the selected trash in the background.
Undolist (:undolist) menu
rโ reset undo position to the group under the cursor.
User menu without navigation (%m macro)
cโ leave menu preserving file selection, and insert the whole line after:!in command-line mode.
Volumes (:volumes) menu
only for MS-Windows ๐ช
- Enter,
lโ navigate into the root of the selected drive.
๐ Dialog-specific operations ๐
Attributes (permissions or properties) dialog
h, Space โ check/uncheck. โ๏ธqโ close the 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).
Possible item states:
*โ checked flag.Xโ selected files have an inconsistent value of this flag.d(*nix only) โ (only for execute flags) meansu-x+X,g-x+Xoro-x+Xargument for thechmodprogram. If you're not on OS X and want to remove the execute permission bit from all files, but preserve it for directories, set all execute flags to'd'and check the'Set Recursively'flag. ๐
Fileinfo (Ctrl+G) dialog
- Enter,
qโ close the dialog.
Sort (:sort) dialog
h, Space โ switch ascending/descending order. ๐qโ close the dialog.
There's also a shortcut per sorting key (it's drawn right on the dialog). โจ
๐ธ Menus history
Okay so bestie, menus get used all the time to show you results of stuff โ finding files, grepping, all that. And once you close one? Poof. Gone. Sure, you could recreate it by re-running the command, but that's lowkey a nightmare: you might have to change directory first, then remember the command, then find your spot in the menu again. It's giving unpaid labor. ๐ญ
So vifm keeps up to 25 of the last such menus, and gives you a familiar little set of Vim commands to recall them. Iconic.
Now, as hinted above, this doesn't apply to every menu. Things like :version or :commands lean purely on internal data and don't need saving. Only menus that come from external sources and support navigation (like via gf) get remembered. ๐
Navigating through history
To re-open the last viewed menu of the relevant type, run :copen. Once it's open, :colder takes you to older menus and :cnewer takes you to newer ones.
Close a menu after roaming through the history? It remembers your position, so running :copen again opens the last viewed menu and lets you keep exploring in both directions. ๐ฆ
The history is always sorted oldest โ newest. Once you open more than 25 menus, the oldest one is likely to be forgotten โ but it's not guaranteed, because viewing an older menu makes your new entry replace all the more recent ones. Example time, assume the history looks like this:
1. :find 1
2. :find 2
...
23. :find 23 (current element)
24. :find 24
25. :find 25
Running :find 11 results in:
1. :find 1
2. :find 2
...
23. :find 23
24. :find 26 (current element)
25. None
For convenience, :colder and :cnewer work any time you're in a menu, not just after :copen. :cnewer only works if the current menu can't be saved and you've moved back in the menus history before. And :colder be like:
- if the current menu can be stashed, it behaves as a
:quit,:copen,:coldersequence (the current menu gets stashed the same way as described above); - if the current menu can't be stashed, it behaves as a
:quit,:copensequence.
Viewing history
Rather than brute-force enumerating menus hunting for the right one, you can use :chistory to get an overview of saved menus, maybe search for one, and then open it. And yes โ the command is also available in menu mode. ๐
Related topics
Commands: :chistory, :copen Menu commands: :chistory, :colder, :cnewer
๐ง Custom views
Definition
Normally file views show you a list of files from one single directory. But sometimes it's genuinely useful to fill them with files from totally unrelated places. That is mainly what custom views are for, periodt.
Presentation
Custom views are still tied to the directory they were in before the custom list was loaded. That directory (the original directory) shows up in the title of the custom view.
Files in the same directory have to be named differently, but custom views are free from that constraint โ which means seeing bare file names could get pretty confusing. So, to hint where files came from, paths relative to the original directory of the view are used; when that's not possible, full paths get shown.
Custom views normally don't contain any inexistent files. โจ
Navigation/exiting
Navigating custom views is a bit different from regular views:
gf- acts likegfon symbolic links and navigates to the file at its real location.h- goes to the closest parent node in the tree view, or terminates the custom view and returns you to the original directory.gh- terminates the custom view and returns you to the original directory.
Going to the parent directory in other ways (whether by opening the .. entry or running :cd ..) also causes termination and a return to the original location.
All other ways of changing location (e.g., marks, bookmarks, :cd, :sync) also cause termination of the custom view.
History
A custom list exists only while it's visible. Once you leave it, you can't come back, so there are no traces of it in any history. ๐
Filters
Only the local filter affects the contents of the view. This is intentional. Presumably if you load a particular list, precisely that list should be displayed (except for inexistent paths, which get ignored).
Search
Even though directory names are visible in the listing, they are not searchable. Only file names are taken into account (this might change in the future โ searching whole lines seems quite reasonable).
Sorting
Contrary to search, sorting by name works on the whole visible part of the file path.
Highlight
The whole file name is highlighted as one entity, even if there are directory elements in it.
Updates
Reloads can happen, though they're not automatic since files are scattered across different places. On a reload, inexistent files are removed and meta-data of all other files is updated.
Once a custom view forgets about a file, it won't add it back even if it's created again. So not seeing a file that was previously affected by an operation which was later undone? Completely normal, bestie.
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 that's not a real file system location. ๐ซ
On the other hand, operations that use files of a custom view as a source (e.g., yanking, copying, moving a file from a custom view, deletion) and operations that modify names are all allowed. Slay.
๐ Compare views
Kinds
:compare can produce four different results depending on its arguments:
- single compare view (
ofoneand eitherlistallorlistdups); - single custom view (
ofoneandlistunique); - two compare views (
ofbothand eitherlistallorlistdups); - two custom views (
ofbothandlistunique).
The first two display files of a single file system tree. Here, duplicates are files that have at least one copy in the same tree. The other two kinds compare two trees, in which duplicates are files found in both trees.
Lists of unique files are presented in custom views because there's no file grouping to preserve โ all file ids are guaranteed to be distinct. See the "Custom views" section.
Creation
Arguments passed to :compare form seven categories, each with its own prefix, and each one is responsible for a particular property of the 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 the data they contain (a combination of size and a hash of a small chunk of contents is used as a first approximation, so don't worry too much about large files; non-regular files like pipes are assumed to be empty).
Which files to display:
listall- all files;listunique- unique files only;listdups- only duplicated files.
How results are grouped (has no effect if ofone is 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.
Comparison tweaks:
withicase- ignore case when comparing file names/paths;withrcase- respect case when comparing file names/paths.
Which results to show (has no effect for single pane comparison):
showidentical- control visibility of identical files;showdifferent- control visibility of changed files;showuniqueleft- control visibility of unique top/left files;showuniqueright- control visibility of unique bottom/right files.
Each argument can appear multiple times โ the rightmost one of the group defines the behaviour. And all arguments alter default behaviour instead of substituting it.
When neither withicase nor withrcase is specified, case depends on the running operating system and the file system on which the files are located.
Exiting
Comparing two views results in them entering a special state implemented on top of custom views. Both views leave this state when either of them stops being custom. Custom views terminate on changing to a different location โ or as a result of a command like :regular โ and going into the parent directory (like with the h key or the :cd .. command) returns to a regular state without changing the location. See the "Custom views" section for more details.
Examples
The defaults correspond to probably the most common use case โ comparing files in two trees with grouping by paths โ so the following are all equivalent:
:compare
:compare bycontents grouppaths
:compare bycontents listall ofboth grouppaths
:compare showidentical showdifferent showuniqueleft showuniqueright
Another use case is finding 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, because it's unable to display diff-like data. ๐
Comparison views have a second column displaying the id of the file โ files with the same id are considered equal. The view columns configuration is predefined.
The status bar displays only the initial result of the comparison and can be out of date.
Behaviour
When two views are being compared against one another, these changes to 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);
zdexcludes groups of adjacent identical files,1zdgives 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 the comparison;
- entries which indicate absence of an 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 a single pane).
Files are gathered in this way:
- recursively, starting at the current location of the view;
- dot files are excluded if the view hides them at the moment of comparison, and 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.
โจ Startup โจ
okay so when vifm boots up it figures out a bunch of variables it's gonna use for the rest of its little life, and the order matters โ they get determined in exactly the order they're listed below, bestie.
On *nix systems $HOME is normally just there and vifm uses it as-is, no drama. On Windows though, vifm has to go hunting for the correct home directory, and it checks in this order:
$HOMEvariable;$USERPROFILEvariable (on Windows only);- a combination of
$HOMEDRIVEand$HOMEPATHvariables (on Windows only).
Then it goes looking for the correct configuration directory, checking these spots:
$VIFMvariable;- parent directory of the executable file (on Windows only);
$HOME/.vifmdirectory;$APPDATA/Vifmdirectory (on Windows only);$XDG_CONFIG_HOME/vifmdirectory;$HOME/.config/vifmdirectory.
And finally the correct configuration file, hunted down like this:
$MYVIFMRCvariable;vifmrcin parent directory of the executable file (on Windows only);$VIFM/vifmrcfile.
๐ Configure ๐
peep the Startup section above for the whole explanation on $VIFM and $MYVIFMRC, iykyk.
The vifmrc file is where you stash commands that run on vifm startup. There are two of them: a global one and a local one. The global one lives at {prefix}/etc/vifm/vifmrc โ and for how the local one gets found, go read the $MYVIFMRC variable description for the search algorithm. Global vifmrc loads before the local one, so the local one can redefine literally anything that was configured globally. slay.
Use vifmrc to set settings, mappings, filetypes etc. And if you wanna use multi line commands, precede each next line with a slash โ whitespace before the slash gets ignored, but all spaces at the end of the lines are saved. For example:
set
\smartcase
equals setsmartcase. But when it's:
set<space here>
\ smartcase
it equals set smartcase. see the difference? iconic.
The $VIFM/vifminfo file holds the generic state of the application. You control what gets stored in it with the '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 bestie, there are some exceptions and you need to know them:
- directory stack stored in the file is not overwritten unless something is changed in vifm instance that performs merge;
- each mark or bookmark is marked with a timestamp, so that newer value is not overwritten by older one, thus no matter from where it comes, the newer one wins;
- all histories are marked with timestamps on storing, this means that last instance to quit puts its elements on top of the list;
- tabs are merged only if both current instance and stored state contain exactly one tab of any kind.
The $VIFM/scripts directory can contain shell scripts. vifm modifies its PATH environment variable to let you run those scripts without specifying the full path. All subdirectories of the $VIFM/scripts will be added to PATH too. And a script in a subdirectory overlaps a script with the same name in all its parent directories. periodt.
The $VIFM/colors/ and {prefix}/etc/vifm/colors/ directories are where color schemes live. Available color schemes are searched in that order, so on a name conflict the one in $VIFM/colors/ wins. ๐
Each color scheme should have a ".vifm" extension. This wasn't the case before, and for that reason these rules apply during lookup:
- if there is no file with
.vifmextension, all regular files are listed; - otherwise only files with
.vifmextension are listed (with the extension being truncated).
๐ Sessions ๐
Sessions are the way to have multiple persistent runtime configurations. Think of them as second-level vifminfo files sitting on top of the first-level one that every session uses. So no โ they are not a replacement for the vifminfo file that exists without sessions, they're an addition to it.
You could empty the 'vifminfo' option and rely solely on sessions, but realistically you might wanna share some state among instances in different sessions, or keep an "out-of-sessions" state for tasks that genuinely don't deserve a session of their own. fair.
This gives you a two-level structure where data in session files has higher priority than data in vifminfo files (where that makes sense), following the same rules that merging of vifminfo file obeys. On top of that, history items from session files are never ordered before history items from the vifminfo file.
Format
Sessions have the format of vifminfo files โ they do not consist of a sequence of command-line commands and are not meant to be sourced via :source command. do not try it bestie.
Storage and naming
$VIFM/sessions/ directory serves as the storage for sessions. Consequently names should be valid filenames. The structure of the storage is flat, meaning there are no subdirectories, and that's why names of sessions can't contain slashes. ๐ซ
Usage model
Contrary to Vim, vifm automates the 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
๐ฅ Automatic FUSE mounts ๐ฅ
vifm has builtin support for automated FUSE file system mounts โ and it's implemented using the file associations mechanism, which is lowkey genius. To enable automated mounts you need a specially formatted program line in filetype or filextype commands. These use special macros, which are different from the macros in commands unrelated to FUSE. Currently three formats are supported:
FUSE_MOUNTโ use this one when all the information needed for mounting all files of a particular type is the same. E.g. mounting of tar files doesn'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
FUSE_MOUNT2โ this one lets you use specially formatted files to perform mounting, and it's super useful for mounting remotes, like 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:/
FUSE_MOUNT3
This format is equivalent to FUSE_MOUNT, but omits unmounting. It's 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 here's what each one actually means:
%SOURCE_FILEis replaced by full path to selected file;%DESTINATION_DIRis replaced by full path to mount directory, which is created by vifm basing on the value of'fusehome'option;%PARAMvalue is filled from the first line of file (whole line), though in the future it can be changed to whole file content;%FOREGROUNDmeans 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 the obsolete name of %FOREGROUND, which is still supported, but might be removed in future. Its use is discouraged โ so like, don't. ๐ซ
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. not me finding out the hard way ๐ญ
The mounted FUSE file systems will be automatically unmounted in two cases:
- when vifm quits (with ZZ,
:q, etc. or when killed by signal); - when you explicitly leave mount point going up to its parent directory (with h, Enter on
"../"or":cd ..") and other pane is not in the same directory or its child directories.
๐ฆ View look ๐ฆ
vifm supports displaying the file list view in two different ways:
- in a table mode, when multiple columns can be set using
'viewcolumns'option (see "Column view" section below for details); - in a multicolumn list manner which looks almost like
ls -xcommand output (see "ls-like view" section below for details).
The look is local for each view and can be chosen by changing the value of the 'lsview' boolean option.
Depending on view look some of the 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 the options can be ignored if they don't affect view displaying in the selected look. For example the value of 'viewcolumns' when 'lsview' is set.
๐ ls-like view ๐
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 the current directory of the view. And the whole file list is automatically reflowed on directory change, terminal or view resize. no manual refreshing needed bestie.
The view looks close to the 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. So for example dd will remove only the 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. ๐
๐ Column view ๐
Okay bestie, this is where you get to design your very own view columns, and honestly it's giving interior design but for file lists ๐
View columns are described by a comma-separated list of column descriptions, and each one looks like this:
[ '-' | '*' ] [ fw ( [ '.' tw ] | '%' ) ] '{' type | literal '}'
'.'{0,3}
Quick legend so you're not lost: fw = full width, tw = text width, the bar is the logical or, square brackets mean the part is optional, and curly braces define how many times you can repeat the symbol right before them.
So it's basically four parts, in order:
- Optional alignment specifier
- Optional width specifier
- Mandatory column name
- Optional cropping specifier
โจ Alignment specifier โจ
It's an optional minus or asterisk sign as the first symbol of the string.
This sets what kind of text alignment happens inside the column. "Three types are supported" the page says, and then it lists four, and honestly? slay, we love a generous list ๐ Here they all are:
- left align
set viewcolumns=-{name}
- right align (default)
set viewcolumns={name}
- middle align
Same energy as left alignment, but the moment the text is bigger than the column it gets cut in the middle โ so the start AND the end of the field are always visible, no cap.
set viewcolumns=^{name}
- dynamic align
Again like left alignment, but when the text outgrows the column, the alignment shifts to the right, so part of the field is always visible.
set viewcolumns=*{name}
๐ธ Width specifier ๐ธ
This one is a number followed by a percent sign, or two numbers (and the second one has to be less than or equal to the first) separated with a dot, or just a single number.
It sets the column width and its units. There are three size types:
- absolute size โ the column width is in characters:
set viewcolumns=-100{name},20.15{ext}
which gives you two columns of lengths 100 and 20, plus a reserved space of five characters on the left of the second column.
- relative (percent) size โ the column width is a percent of the view width:
set viewcolumns=-80%{name},15%{ext},5%{mtime}
which gives you three columns of 80/100, 15/100 and 5/100 of the view width.
- auto size (default) โ the column width is figured out automatically:
set viewcolumns=-{name},{ext},{mtime}
which gives you three columns, each one third of the view width. Heads up tho: there is no size adjustment to content here, since that would slow down rendering.
You can freely mix columns of different sizing types in one view ๐ซถ Though sometimes some columns will only be partly visible, or completely invisible, if there just isn't enough space to display them.
๐ฆ Column contents ๐ฆ
Usually this is a sorting key wrapped in curly braces, like:
{name},{ext},{mtime}
And just so you know, {name} and {iname} are literally the same type โ both exist for consistency with the 'sort' option.
These column types don't have matching sorting keys:
{root}โ display name without extension (a complement for{ext}){fileroot}โ display name without extension for anything that isn't a directory or a symbolic link to a directory (a complement for{fileext})
Empty curly braces ({}) get replaced with the default secondary column for the primary sort key. So after this command, the view displays almost as if 'viewcolumns' was empty, except it adds ellipsis for long file names:
set viewcolumns=-{name}..,6{}.
The last kind of column value is a string literal. That literal is used as the column value for every single row. The syntax is "{#literal}", and here are the examples:
" double-character pseudo-padding on both sides
set viewcolumns='2{#},*{name}..,{},2{#}'
" pseudo-border between columns
set viewcolumns='*{name}..,{#|},6{}'
" pseudo-border with padding between columns
set viewcolumns='*{name}..,{# | },6{}'
So you can draw column separators with these, iconic. Just mind that for convenience, literals have different defaults: truncation and automatically determined absolute size โ which is what you usually want for them. And please make sure to quote or escape spaces, vertical bars and other special symbols when you use them as part of literals ๐
๐ Cropping specifier ๐
This is anywhere from one to three dots after the closing curly brace in a column format.
It sets the type of text truncation for when the text doesn't fit in the column. There are three types:
- truncation โ text is truncated:
set viewcolumns=-{name}.
which results in names that are too long to fit in the view getting cut off.
- adding of ellipsis โ ellipsis on the left or right gets added when it's needed:
set viewcolumns=-{name}..
which means ellipsis are added at the end of file names that are too long.
- none (default) โ text can just pass right on through the column boundaries:
set viewcolumns=-{name}...,{ext}
which means long file names can partially be written on the ext column. Bold, honestly ๐
๐ Color schemes ๐
The color schemes in vifm can be applied in two different ways:
- as the primary color scheme;
- as local to a pane color scheme.
Both types are set using the :colorscheme command, just in different forms:
:colorscheme color_scheme_nameโ for the primary color scheme;:colorscheme color_scheme_name directoryโ for local color schemes.
The look of different parts of the TUI (Text User Interface) gets decided like this:
- Border, TabLine, TabLineSel, TopLineSel, TopLine, CmdLine, ErrorMsg, StatusLine, JobLine, SuggestBox, WildBox and WildMenu are always determined by the primary color scheme;
- CurrLine, Selected, Directory, Link, BrokenLink, Socket, Device, Executable, Fifo, CmpMismatch, CmpUnmatched, CmpBlank, Win, AuxWin and OtherWin are determined by the primary color scheme and a set of local color schemes, which can totally be empty.
There might be a whole set of local color schemes because they're structured hierarchically, following the file system structure. So say you have this little slice of file system:
~
`-- bin
|
`-- my
And two color schemes:
# ~/.config/vifm/colors/for_bin.vifm
highlight Win cterm=none ctermfg=white ctermbg=red
highlight CurrLine cterm=none ctermfg=red ctermbg=black
# ~/.config/vifm/colors/for_bin_my.vifm
highlight CurrLine cterm=none ctermfg=green ctermbg=black
And these three commands in the vifmrc file:
colorscheme Default
colorscheme for_bin ~/bin
colorscheme for_bin_my ~/bin/my
Then the file list looks like this at each level:
~/โ Default color scheme- black background
- cursor with blue background
~/bin/โ mix of Default and for_bin color schemes- red background
- cursor with black background and red foreground
~/bin/my/โ mix of Default, for_bin and for_bin_my color schemes- red background
- cursor with black background and green foreground
Layered looks, we love a gradient moment ๐
๐๏ธ Trash directory ๐๏ธ
vifm has support of a trash directory, which it uses as temporary storage for deleted files or files that were cut. Whether trash gets used is controlled by the 'trash' option, and the exact path to the trash can be set with the 'trashdir' option. The 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 you can set 'trashdir' to "~/.local/share/Trash" to use a "standard" trash directory.
There are two scenarios of using trash in vifm:
- As a place for storing files that were cut by
"d"and may be inserted to some other place in the file system. - As a storage of files that are deleted but not purged yet.
The first scenario uses deletion ("d") operations to put files to trash, and put ("p") operations to restore files from the trash directory. Note that these operations move files to and from the trash directory, which can be long term operations in case of different partitions or remote drives mounted locally. So maybe grab a snack ๐
The second scenario uses deletion ("d") operations for moving files to the trash directory, and the :empty command-line command to purge all previously deleted files.
Deletion and put operations depend on registers, which can point to files in the trash directory. Normally there are no nonexistent files in registers, but vifm doesn't keep track of modifications under the trash directory, so one shouldn't expect the value of registers to be absolutely correct if the trash directory was modified by something that isn't an operation meant for it. But this won't lead to any issues with operations, since they ignore nonexistent files. Crisis averted ๐
๐ฅ Name conflicts ๐ฅ
When copying, moving, or creating symbolic links, Vifm can encounter a name conflict: a file with the same name already exists in the target directory. In such cases Vifm shows a dialog asking how to resolve the conflict.
Here's what you can pick:
- overwrite โ replace the existing file with the incoming one.
- overwrite all โ apply the overwrite action to all further conflicts during the same operation without asking again.
- skip โ do not copy or move the file that caused the conflict.
- skip all โ skip all further conflicting files without prompting.
- rename โ enter a new name for the incoming file. Pressing Enter without typing a new name keeps the old name and causes the dialog to appear again.
- merge โ for directories: copy only missing files from the source directory into the existing one.
- merge all โ apply the merge action to all further directory conflicts.
- append โ if the destination file is shorter, append the missing tail bytes from the source file. Example: if the source is 1000 bytes and the destination is 300 bytes in size, the last 700 bytes of the source are appended. This action is intended for resuming interrupted copy operations.
Notes, bestie, don't skip these:
- The conflict dialog appears for
:put,p,P,alandrlcommands. - Conflict resolution choices apply only to the current operation.
๐ File copying ๐
For enabling copy-on-write of BTRFS on Linux, set "fastfilecloning" flag of 'iooptions' option.
File copying within an XFS file system uses reflinks by default. Any file copied from another file system will be copied without reflinks even if it has a matching list of XFS extents. Reflinks are not guaranteed when using external programs. This behaviour was observed on Linux and doesn't necessarily hold for other environments. So like, don't @ me if your filesystem plays different ๐
๐ฐ๏ธ Client-Server ๐ฐ๏ธ
okay bestie, this is the โจremote controlโจ era and it's literally so good. vifm can run command-line mode commands remotely, change directories remotely, and even do expression evaluation remotely. The way it pulls this off? --remote and --remote-expr command-line arguments. iykyk ๐
To run a command remotely, you just pair --remote with -c <command> or +<command>. Like so:
vifm --remote -c 'cd /'
vifm --remote '+cd /'
And if you wanna change directory without going through command-line mode commands at all, just throw paths right after the --remote argument, bestie:
vifm --remote /
vifm --remote ~
vifm --remote /usr/bin /tmp
Evaluating an expression remotely? That's your girl for querying info about a running instance, like, say, where it's at:
vifm --remote-expr 'expand("%d")'
Now โ plot twist โ if you've got multiple instances running, you point at your target with the --server-name option (otherwise the first one lexicographically gets picked, kinda random ngl):
vifm --server-name work --remote ~/work/project
Wanna know the names of all your running instances? --server-list option, boom. And the name of the current one lives in v:servername. ๐
v:servernameโ the server name of the running vifm instance. It's empty if the client-server feature is disabled. ๐
๐ External Renaming ๐
so when you run an editor to edit a list of file names, the contents of that temporary file follow this exact format:
- The order of lines corresponds to the order of files in a view.
- Lines that start with a
#are comments and are ignored. - A single backslash at the beginning of a line is ignored, so that a file starting with a backslash will appear like
"\#name".
And if an operation got rejected because of issues with the file names, next time you'll see the following, in this order:
- Last error (in comments).
- Original file names (in comments).
- Failed list of new names.
Mind that the Vim plugin will extract the list of original names and show them in a vertical split, ๐ cute of it.
You can cancel renaming by removing all non-comments from the buffer. This also erases information about previous edits, so be aware bestie.
๐ฑ๏ธ Using mouse ๐ฑ๏ธ
Note:<ScrollWheelDown>is not available on 32-bit*nixsystems, because ncurses doesn't support it there (limitation of implementation). ๐ญ
Note: these are not available in mappings at the moment.
Normal Mode
<LeftMouse>โ position cursor: yes ยท change window: yes ยท action:<cr>if cursor wasn't move<LeftRelease>โ position cursor: no ยท change window: yes<MiddleMouse>โ position cursor: no ยท change window: yes ยท action:<c-e><MiddleRelease>โ position cursor: no ยท change window: yes<RightMouse>โ position cursor: yes ยท change window: yes ยท action::file<RightRelease>โ position cursor: no ยท change window: yes<ScrollWheelUp>โ position cursor: no ยท change window: yes ยท action:<c-y>or:tabprevious<ScrollWheelDown>โ position cursor: no ยท change window: yes ยท action:<c-e>or:tabnext
Clicking on or scrolling over an inactive pane (including its title) makes it active and does nothing else. ๐ธ Tabs are scrolled when the mouse hovers over them.
Clicking on the left miller column goes to parent directory and clicking the right one opens current entry. the way that works is so satisfying honestly.
Visual Mode
<LeftMouse>โ position cursor: yes ยท selection: update ยท action:<cr>if cursor wasn't move<LeftRelease>โ position cursor: no<MiddleMouse>โ position cursor: no ยท selection: update ยท action:<c-e><MiddleRelease>โ position cursor: no<RightMouse>โ position cursor: no<RightRelease>โ position cursor: no<ScrollWheelUp>โ position cursor: no ยท selection: update ยท action:<c-y><ScrollWheelDown>โ position cursor: no ยท selection: update ยท action:<c-e>
Command-line Mode
<LeftMouse>โ position cursor: yes<LeftRelease>โ position cursor: no<MiddleMouse>โ position cursor: no ยท action:<c-n><MiddleRelease>โ position cursor: no<RightMouse>โ position cursor: no<RightRelease>โ position cursor: no<ScrollWheelUp>โ position cursor: no ยท action:<c-p><ScrollWheelDown>โ position cursor: no ยท action:<c-n>
Menu Mode
<LeftMouse>โ position cursor: yes ยท action:<cr>if cursor wasn't moved<LeftRelease>โ position cursor: no<MiddleMouse>โ position cursor: no ยท action:<c-e><MiddleRelease>โ position cursor: no<RightMouse>โ position cursor: no<RightRelease>โ position cursor: no<ScrollWheelUp>โ position cursor: no ยท action:<c-y><ScrollWheelDown>โ position cursor: no ยท action:<c-e>
view Mode
<ScrollWheelUp>โ action:k<ScrollWheelDown>โ action:j
Clicking on or scrolling over an inactive pane (including its title), detaches view mode if it wasn't activated for exploring a file. periodt. โจ
๐งฉ Plugin ๐งฉ
This is the plugin for using vifm inside vim as a file selector. iconic honestly.
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 the arguments are checked, a 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, the file under the cursor is opened; otherwise the whole selection is passed to the plugin and opened in vim. slay. ๐ฅ
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. ๐
๐ Index of menus ๐
Mappings
:amap,:anoremapโ mappings in navigation mode:cmap,:cnoremapโ mappings in command-line mode:dmap,:dnoremapโ mappings in dialog mode:mmap,:mnoremapโ mappings in menu mode:nmap,:nnoremapโ mappings in normal mode:qmap,:qnoremapโ mappings in view mode:vmap,:vnoremapโ mappings in visual mode
Expansions of command-line mode
:cabbrev,:cnoreabbrevโ command-line abbreviations:commandโ user commands
Program associations
:fileโ programs set for the file type:filetypeโ program associations for a file:fileviewerโ viewer associations for a file:filextypeโ graphical program associations for a file
External commands
:aproposโ results of running'aproposprg':findโ results of running'findprg':grepโ results of running'grepprg':locateโ results of running'locateprg'
Marks and bookmarks
:bmarksโ bookmarks (tag-like marks):marksโ marks
History-like
:chistoryโ history of navigation menus:dirsโ directory stack:historyโ histories of views and prompts:undolistโ undo/redo history
Trash directories and their contents
:lstrashโ files in trash directories:trashesโ usable non-empty trash directories
Drives and volumes
:mediaโ media management:volumesโ volume list
Other internal state
:colorschemeโ color schemes:display,:registersโ contents of registers:jobsโ current jobs and background processes:pluginsโ plugins:version,:vifmโ version and runtime information
Macros that create menus
%mโ captured output of a command%Mโ same as%m, but with navigation to files
๐ซ Reserved ๐ซ
The following command names are reserved and shouldn't be used for user commands. like, hands off bestie ๐
g[lobal]
v[global]
๐ ENVIRONMENT ๐
VIFMโ Points to main configuration directory (usually~/.config/vifm/).MYVIFMRCโ Points to main configuration file (usually~/.config/vifm/vifmrc).
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_FUSE_FILEโ On execution of external commands this variable is set to the full path of file used to initiate FUSE mount of the closest mount point from current pane's directory up. It's not set when outside FUSE mount point. When vifm is used inside terminal multiplexer, it tries to set this variable as well (it doesn't work this way on its own).
๐ SEE ALSO ๐
vifm-convert-dircolors(1),vifm-pause(1)- Website: https://vifm.info/
- Q&A: https://q2a.vifm.info/
- Wiki: https://wiki.vifm.info/
โ๏ธ AUTHOR โ๏ธ
Vifm was originally created by ksteen <ksteen@users.sourceforge.net> It is currently developed by xaizek <xaizek@posteo.net>
aaaand that's a wrap on the whole page bestie!! ๐ this is vifm 0.14.4, dated 31 May 2026, and the page itself is VIFM(1) โ go forth and slay your file management, you absolute main character. ๐๐ฆโจ
๐ฆ where this page comes from
- alpine 3.24: vifm-doc 0.14.4-r0 ยท GPL-2.0-or-later
- arch rolling: vifm 0.14.4-1 ยท GPL-2.0-or-later
- ubuntu stonking: vifm 0.14.4-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms