*vifm.txt*


|Options|            Command line arguments.
|General_keys|       General keys, that work in the most of modes.
|Normal|             Normal mode keys.
|Visual|             Visual mode keys.
|Commands|           How to use and set :commands.
|set-options|        Available options.
|Mappings|           Special sequences.
|Configure|          Configuration of vifm.
|Plugin|             Using the vifm.vim plugin.
|Compatibility_mode| Its description.
|Menus_and_dialogs|  Keys for menus and dialogs.
|Reserved|           List of reserved commands.

--------------------------------------------------------------------------------
*Options*

The vifm executable will start vifm in the current directory unless it is
given a different directory on the command line.

vifm /path/to/directory/one
or
vifm /path/to/directory/one /path/to/directory/two

The only other command line arguments are:
-f - only used from the vifm.vim script.  The selected files are written
	to ~/.vifm/vimfiles and vifm exits.

--logging - log some errors to ~/.vifm/log.
--help, -h - show a brief command summary and exit vifm.
--version, -v - show the version information and exit.

-------------------------------------------------------------------------------
*General_keys*

Ctrl-c or Escape - cancel most operations.
Ctrl-c or Escape - clear all selected files.
Ctrl-l - clear and redraw the screen.

--------------------------------------------------------------------------------
*Normal*

Basic Movement~

The basic vi key bindings are used to move through the files and popup windows.

k is up
j is down

h is up directory
l is handle file (enter directory or run program) and is the same as Return

gg will move to the first line of the file list.

G will move to the last line in the file list.

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-F or Page Down - move forward one page.
Ctrl-B or Page Up - move back one page.

Ctrl-D - jump back one half page.
Ctrl-U - jump forward one half page.

n% move to nth file of the file list (for example 25%).

Space or Tab to switch file lists.

Movement with Count~

Most movement commands also accept a count, 12j would move down 12 files.
[count]% move to percent of the file list.
[count]j move down count files.
[count]k move up count files.
[count]G or gg move to list position count.

Scrolling panes~

zt - redraw pane with file in top of list.
zz - redraw pane with file in center of list.
zb - redraw pane with file in bottom of list.
Ctrl-e - scroll pane one line down.
Ctrl-y - scroll pane one line up.

Pane manipulation~

Second character can be entered with or without Control key.

Ctrl-w h - switch to left pane.
Ctrl-w l - switch to right pane.
Ctrl-w w - switch to other pane.
Ctrl-w o - shortcut for :only
Ctrl-w s - shortcut for :split
Ctrl-w v - shortcut for :split
Ctrl-w x - exchange panes

Marks~

You can use this characters for marks [a-z][A-Z][0-9].

m[letter] will set a mark at the current cursor position.
'[letter] will move to a mark.

Searching~

/regular expression - select files matching regular expression. Forward
    search.
?regular expression - select files matching regular expression. Backward
    search.
n - previous file matching last search pattern.  Considers last search
    direction.
N - previous file matching last search pattern.  Considers last search
    direction.
Note: vifm uses extended regular expressions for / and ?.

f[character] - search forward for file with [character] as first
    character in name.  Search wraps around the end of the list.
F[character] - search backward for file with [character] as first
    character in name.  Search wraps around the end of the list.
; - find the next match of f or F.
, - find the previous match of f or F.

Filters~
                                                               *Filters*
There are two basic file filters.  One for dot files and one for file names.

The basic vim folding key-bindings are used for filters.
za - toggles the showing and hiding of dot files.
zo - show the dot files.
zf - add the selected files to the file name filter.
zm - hide the dot files.
zO - show the hidden file name files.
zM - restore all filters.
zR - remove all filters.

All directorys will show the ../ file no matter what the filter setting is
with the exception of the / directory.

Each file list has its own filter.

Filtered files are not checked in / search or :commands.

Note: vifm uses extended regular expressions.

Other Normal Mode Keys~

: - enter command line mode.

Ctrl-o - go backward through history.
Ctrl-i - go forward through history.

Ctrl-g - creates a window showing detailed information about the current
    file.

ga - calculate size of directory.
gA - like ga, but force update.

gv go to visual mode restoring last selection.

i - handle file (even through it's executable and RUN_EXECUTABLE is set).

cw - change word is used to rename a file.
cW - change WORD is used to change only name of file (without extension).
co - change owner of file.
cg - change group of file.
cp - change file permissions.
C - clone file.

dd - move selected file or files to ~/.vifm/Trash (if option 'trash' is set
     otherwise delete)
d<selector> - like dd.

DD and D<selector> - like dd and d<selector>, but omitting trash directory
     (even when option USE_TRASH is set).

yy, Y - yank selected files.
y<selector> - yank files.

p - will copy the yanked files to the current directory or move the files
    to the current directory if they were deleted with dd or :d[elete] or
    if the files were yanked from the Trash directory.
P - moves the last yanked files.

t - select or unselect (tag) a the current file

u - undo last command.
Ctrl-r - redo last command.

v, V - start visual selection of files.

ZQ - same as :q<Return>
ZZ - same as :wq<Return>

. - repeat last command line command (not normal mode command).

Using Count with y, d and D~

You can use count with commands like yy.

[count]yy yank (count + 1) files starting from current cursor position
downward.

Or you can use count with motions passed to y, d or D.

d[count]j delete (count + 1) files starting from current cursor position
upward.

Selectors~

y, d and Dcommands accept selectors.  You can combine them with every of
selectors below to quickly remove or yank several files.

j, k, gg, G, H, L, M, %, f, F, ;, comma and ' can be used as selectors for
several commands.
Also following selectors can be used:
 a - all files in current view
 s - selected files
 S - all files except selected

For example:
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.

--------------------------------------------------------------------------------
*Visual*

In visual mode work almost all normal mode keys, but they do not accept
selectors.

Enter - save selection and go back to normal mode.

gv - restore previous visual selection.

v - leave visual mode.

V - leave visual mode.

: - enter command line mode.  When you leave it selection will be cleared.

o - switch active selection bound.

O - switch active selection bound.

--------------------------------------------------------------------------------
*Commands*

Commands are executed with :command_name<Return>

'|' can be used to separate commands, so you can give multiple commands in one
line.  If you want to use '|' in an argument, precede it with '\'.

:number - move to the file number.
:12 would move to the 12th file in the list.
:0 move to the top of the list.
:$ move to the bottom of the list.

:[count]command
The only builtin :[count]command are :[count]d[elete] and :[count]y[ank].
Examples:
:d3 - would delete three files starting at the current file position
    moving down (not implemented yet).
:3d - would delete one file at the third line in the list.

See |Reserved| for a list of reserved command names.

The builtin commands are:

:!program - shellout and execute program.
    :!command & will run the process in the background.
    Programs that write to stdout like ls will create an error message
    showing partial output of the command.
:!!program - same as :! but will pause before returning.
:!! - repeat the last command.
:apropos manpage - will create a menu of items returned by the apropos
    command. Selecting an item in the menu will open the corresponding
    manpage.
:cd - change to your home directory.
:cd ~/dir - change directory to ~/dir.
:change - create a menu window to alter a files properties.
:cmdhistory - show command line history menu.  Note: will be removed.
:colo[rscheme] - gives a menu with a list of available color schemes.  You can
    choose default color scheme here.  It will be used if no DIRECTORY in
    colorscheme file fits current path.  See :colorscheme.
:colo[rscheme] color_scheme_name - changes default color scheme.
:com[mand] - gives a menu of user commands.
:com[mand] name action - sets a new user command.
    Trying to use a reserved command name will result in an error message
    Use :com[mand]! to overwrite a previously set command.
    Unlike vim user commands do not have to start with a capital letter.
    User commands are run in a shell by default.  To run a command in
    the background you must set it as a background command with & at the end
    of the commands action (:com rm rm %f &).
:com[mand] backup /pattern - will set search pattern.
:com[mand] name filter pattern - will set file name filter.
:[range]d[elete][count] - delete selected file or files.
    See |Vifm_Ranges| for the ranges implemented.
:delc[ommand] user_command - remove user_command.
:di[splay] - popup menu with registers content.
:dirs - display directory stack.
:e[dit] [file...] - will load the selected or passed file or files into vi.
:empty - permanently remove files from the ~/.vifm/Trash directory.  It will
    also remove all operations from undolist that have no sense after :empty
    and remove all records about files in the Trash directory from all
    registers.
:file - popup menu of programs set for the file type of the current file.
Add ' &' in the end of command if you want to start program in background. 
:filter regular_expression
:filter /regular_expression/ - will filter files matching the pattern out of
    the directory.  Use :filter to show all files.  Using second variant
    you can use | symbol without escaping.  Add '!' to invert filter.
    See |Filters|
:filter! - same as :invert.
:h[elp] - show the help file.
:h[elp] argument - is the same as using ':h argument' in vim.
:history - show directory history.
:invert - invert file name filter.
:jobs - shows menu of current backgrounded processes.
:locate filename - uses the locate command to create a menu of filenames
    Selecting a file from the menu will reload the current file list in vifm
    to show the selected file.
:marks - menu of bookmarks.
:noh[lsearch] - clear selection in current pane.
:on[ly] - switch to a one window view.
:popd - remove pane directories from stack.
:pushd directory - add pane directories to stack. And change to directory.
:pwd - show the present working directory.
:q[uit] - will exit vifm (add ! if you don't want to save changes).
:rename - rename files using vi to edit names.
:screen - toggles whether to use the screen program or not.
    The default configuration has the screen option turned off.  The screen
    program uses pseudo terminals to allow multiple windows to be used in
    the console or in a single xterm.  Starting vifm from screen with the
    screen option turned on will cause vifm to open a new screen window for
    each new file edited or program launched from vifm.
    This requires screen version 3.9.9 or newer for the screen -X argument.
:se[t] opt1=val1 opt2='val2' opt3="val3" ... - sets given options.
    You can use following syntax: option, nooption, invoption, option!,
    option?, option=x, option+=x, option-=x.
:sh[ell] - will start a shell.
:reg[isters] - popup menu with registers content.
:sor[t] - menu of different sorting methods.
:sp[lit] - switch to a two window view.
:sync - change the other panel to the current panels directory.
:undol[ist] - show list of latest changes.  Add ! to see commands.
:view - toggle on and off the quick file view.
:w[rite] - will write config (add ! to force write even if settings weren't
	changed).
:wq - will exit vifm after writing config.
:x[it] - exit vifm (add ! if you don't want to save changes).

:map lhs rhs - map lhs key sequence to rhs in normal and visual modes.
:map! lhs rhs - map lhs key sequence to rhs in command line mode.

:cm[ap] lhs rhs - map lhs to rhs in command line mode.
:nm[ap] lhs rhs - map lhs to rhs in normal mode.
:vm[ap] lhs rhs - map lhs to rhs in visual mode.

Ranges~
                                                               *Vifm_Ranges*
The ranges implemented include:
  Numbers :2,3
  % - the entire directory.
  . - the current position in the filelist.
  $ - the end of the filelist.
  't - the mark position t.

  :%delete would delete all files in the directory.
  :2,4delete would delete the files in the list positions 2 through 4.
  :.,$delete would delete the files from the current position to the end
    of the filelist.
  :3delete4 would delete the files in the list positions 3, 4, 5, 6.

If a backward range is given :4,2delete - an query message is given and
user can chose what to do next.

The builtin commands that accept a range are :d[elete] and :y[ank].

Command macros~

The command macros may be used in user commands.
  %a user arguments.
  %c the current file under the cursor.
  %C the current file under the cursor in the other directory.
  %f all of the selected files.
  %F all of the selected files in the other directory list.
  %b same as %f %F.
  %d full path to current directory.
  %D full path to other file list directory.
  %m show command output in a menu.
  %s execute command in screen split.

Position and quantity (if there is any) of %m and %s macros in the
command is unimportant.  All their occurrences will be removed from the
resulting command.

%c and %f macros are expanded to file names only, when %C and %F are expanded
to full paths.  %f and %F follow this in %b too.

:com move mv %f %D - would set the :move command to move all of the files
selected in the current directory to the other directory.

The %a macro will substitute any arguments given in a command into the
command.  All arguments are considered optional.
:com lsl !!ls -l %a - will set the lsl command to execute ls -l with or
without an argument.

:lsl<Return> will list the directory contents of the current directory.
:lsl filename<Return> 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 will cause it to be executed in the
background.

:!mv %f %D &

--------------------------------------------------------------------------------
*set-options*

confirm
type: boolean
default: true
Ask about permanent deletion of files (on D command or on undo/redo operation).

fastrun
type: boolean
default: false
With this option turned on you can run partially entered commands with
unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).

followlinks
type: boolean
default: true
Follow links on l or Enter.

fusehome
type: string
default: "/tmp/vifm_FUSE/"
Directory to be used as a root dir for FUSE mounts.
If you change this option, vifm won't remount anything.  It affects future
mounts only.

history
type: integer
default: 15
Maximum number of directories in the view history.

iec
type: boolean
default: false
Use KiB, MiB, ... instead of KB, MB, ...

runexec
type: boolean
default: false
Run executable file on Enter or l.

savelocation
type: boolean
default: false
Start vifm in the last visited directory.

sort
type: enumeration
default: name
Sets one of these sort types:
   ext   - sort by extension
   name  - sort by name
   gid   - sort by group id
   gname - sort by group name
   mode  - sort by mode
   uid   - sort by owner id
   uname - sort by owner name
   size  - sort by size
   atime - sort by time accessed
   ctime - sort by time changed
   mtime - sort by time modified

sortnumbers
type: boolean
default: false
Natural sort of (version) numbers within text.

sortorder
type: enumeration
default: ascending
Sets sort order: ascending, descending.

trash
type: boolean
default: true
Use trash directory.

undolevels
type: integer
default: 100
Maximum number of changes that can be undone.

vicmd
type: string
default: "vim"
The actual command used to start vi.

vimhelp
type: boolean
default: false
Use vim help format.

wrap
type: boolean
default: true
Controls whether to wrap text in quick view.

--------------------------------------------------------------------------------
*Mappings*

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
<space> - Space key
<f0> - <f63> - functional keys

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.

--------------------------------------------------------------------------------
*Compatibility_mode*

Compatibility mode:
    - <tab> to switch between panes.
    - dd deletes selected (or current if none) files.
    - yy yanks selected (or current if none) files.

Vim like mode:
    - <c-i> (<tab>) to go forward on history.
    - dd deletes file under the cursor and ds works as dd in compatibility mode.
    - yy yanks file under the cursor and ys works as dd in compatibility mode.

--------------------------------------------------------------------------------
*Menus_and_dialogs*

General~

j, k - move.
<Escape>, Ctrl-c - clear.
<Return>, l - select and exit the menu.

In all menus~

Ctrl-b/Ctrl-f
Ctrl-d/Ctrl-u
Ctrl-e/Ctrl-y
/ and ?, n/N
[num]G/[num]gg
H/M/L
zb/zt/zz

All these keys have the same meaning as in normal mode (but not L in filetype
menu).

: - enter command line mode for menus (currently only :q[uit], :x and :num are
supported).

Commands menu~

dd on a command to remove.

Bookmarks menu~

Escape or Ctrl-c to abort j and k to move through.
dd on a bookmark to remove.

Filetype menu~

Commands from vifmrc are displayed above empty line. When all commands below
empty line were found in .desktop files.
Note: you can't save programs for files without extension.

J and K - to move menu items
L - save all commands above empty line as program list

Sort dialog ~

h - switch ascending/descending.
Space - switch ascending/descending.

Permissions dialog~

h - check/uncheck.
Space - check/uncheck.

--------------------------------------------------------------------------------
*Configure*

The ~/.vifm/vifmrc file contains all the configurable settings.  It is
commented and you may edit it by hand to change the settings.

The ~/.vifm/vifminfo file contains session settings.  It is
commented and you may edit it by hand to change the settings.

The ~/.vifm/startup file contains commands that will be executed on vifm
startup. You can set your mappings there.

--------------------------------------------------------------------------------
*Plugin*

Plugin for using vifm in vim as a file selector.

Commands:

  :EditVifm  select a file to open in the current buffer.
  :SplitVifm split buffer and select a file to open.
  :VsplitVifm vertically split buffer and select a file to open.
  :DiffVifm select a file to compare to the current file with :vert diffsplit.

The plugin does not have any settings.

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.

--------------------------------------------------------------------------------
*Reserved*

The following command names are reserved and cannot be used for user commands.

  ! - shellout and execute command.
  apropos - run the apropos command in a menu window.
  cd - change directory.
  change - alter a files properties.
  cm - user mapping for command line mode.
  cmap - user mapping for command line mode.
  cmdhistory - show command line history menu.
  colo - will be used to set a colorscheme for a directory.
  colorscheme - will be used to set a colorscheme for a directory.
  com - show user commands.
  command - show user commands.
  d - delete file.
  delc - delete command.
  delcommand - delete command.
  delete - delete file.
  di - popup menu with registers content.
  dirs - display directory stack.
  display - popup menu with registers content.
  e - edit file.
  edit - edit file.
  empty - empty trash directory.
  file - show filetypes menu.
  filter - set file name filter.
  find - not yet implemented.
  h - show help file.
  help - show help file.
  his - show directory history.
  history - show directory history.
  invert - invert file filter.
  jobs - shows menu of current backgrounded processes.
  locate - run the locate command in a menu window.
  ls - not implemented.
  map - user mapping for normal and visual modes.
  marks - show marks.
  nm - user mapping for normal mode.
  nmap - user mapping for normal mode.
  noh - clear selection in current pane.
  nohlsearch - clear selection in current pane.
  on - switch to a one window view.
  only - switch to a one window view.
  popd - remove pane directories from stack.
  pushd - add pane directories to stack.
  pwd - show present working directory.
  q - exit vifm.
  quit - exit vifm.
  reg - popup menu with registers content.
  registers - popup menu with registers content.
  rename - rename files using vi to edit names.
  screen - toggles use of screen program.
  se - set option.
  set - set option.
  sh - shellout.
  shell - shellout.
  sor[t] - show sort menu.
  sp - switch to a two window view.
  split - switch to a two window view.
  sync - change the other panel to the current panel directory.
  undol - show list of latest changes.  Add ! to see commands.
  undolist - show list of latest changes.  Add ! to see commands.
  unmap - not used, will be used with key mapping.
  view - toggle on and off the quick file view.
  vifm - menu with version information.
  vm - user key mapping for visual mode.
  vmap - user key mapping for visual mode.
  w - same as :write.
  wq - will exit vifm after writing config.
  write - write config (add ! to force write even if settings weren't changed).
  x - exit vifm.
  xit - exit vifm.
  y - yank file.
  yank - yank file.

--------------------------------------------------------------------------------
 vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
