Terminal GuideTerminal Guide
vifm icon

vifm

File Managers
macOSLinuxWindows
C

Vim-like file manager with dual panes.

Official Website

Features

Vim KeybindingsDual PanePreviewBookmarksScripting

Installation

Homebrew
brew install vifm
APT (Debian/Ubuntu)
apt install vifm
Pacman (Arch)
pacman -S vifm

Why use vifm?

Vim Keybindings

Full Vi/Vim keybinding support with hjkl navigation. Perfect for Vim users who want consistent keybindings across their tools.

Dual Pane Layout

Side-by-side pane navigation makes copying/moving files between directories efficient and visual.

Lightweight

Written in C with minimal dependencies. Fast startup and low memory footprint compared to other file managers.

Highly Customizable

Comprehensive vimrc-like configuration with custom commands, keybindings, color schemes, and file type associations.

Installation

Installation Commands
# Homebrew (macOS)
brew install vifm

# APT (Debian/Ubuntu)
sudo apt install vifm

# Pacman (Arch Linux)
sudo pacman -S vifm

# DNF (Fedora)
sudo dnf install vifm

# From source
git clone https://github.com/vifm/vifm.git
cd vifm
./configure
make
sudo make install

Dual Pane Layout

vifm displays two panes side-by-side by default. The left pane shows one directory, the right pane shows another. This layout is ideal for comparing directories or moving files between them.

┌─────────────── /home/user/Documents ───┬────────── /home/user ────────────┐
│                                       │                                    │
│  README.md                    ←file   │ Documents           ←directory    │
│  project/                     ←dir    │ Downloads                         │
│  script.sh                    ←file   │ .config/                          │
│ >notes.txt                    ←file   │ .bashrc                           │
│  image.png                    ←image  │ .zshrc                            │
│  archive.tar.gz               ←file   │                                    │
│                                       │                                    │
│ 6 items                                │ 3 items                            │
└───────────────────────────────────────┴────────────────────────────────────┘
 vifm 0.13.0 | 1/6

Basic Usage

KeyAction
hMove up one level / go to parent directory
jMove to next file/folder
kMove to previous file/folder
lEnter directory / open file
TabSwitch between panes
ggGo to first file
GGo to last file
:Enter command mode
qQuit vifm

File Operations

OperationKeysDescription
CopyyyCopy selected file
CutddCut selected file
PasteppPaste copied/cut file
DeletedDDelete selected file
RenamecwRename file
Create Directory:mkdirCreate new directory
Create File:touchCreate new file
Select FilesSpaceToggle file selection

Navigation Keybindings

KeysPurpose
/Search for files
?Search backward
nNext search result
NPrevious search result
zhToggle hidden files
:onlyMaximize/zoom current pane
:splitSplit panes horizontally
:vsplitSplit panes vertically

Configuration

Configuration is stored in ~/.config/vifm/vifmrc. The syntax is similar to Vim configuration, making it familiar to Vim users.

Basic Configuration

~/.config/vifm/vifmrc
" ~/.config/vifm/vifmrc

" Use Vim-like command mode
set vicmd=vim

" Color scheme
colorscheme Default

" Show line numbers in file list
set number

" Display file size in status bar
set statusline=" %t%= %A %10s %d "

" Sort files
set sortnumbers

" File preview
set previewoptions=vertical

" Relative paths in status bar
set viewmode=miller

Custom Keybindings

~/.config/vifm/vifmrc
" ~/.config/vifm/vifmrc - Custom keybindings

" Map 'w' to move to next pane
map w <tab>

" Map 'b' to move to previous pane
map b <s-tab>

" Map 'zz' to zoom/maximize current pane
map zz :only<cr>

" Map 'cc' to compare directories
map cc :compare<cr>

" Custom command - open with external editor
command! vim execute 'Edit' | execute '!vim' expand('<cfile>') '&'

" Map 'd' for custom delete with confirmation
map dd :delete<cr>

Advanced Configuration

~/.config/vifm/vifmrc
" ~/.config/vifm/vifmrc - Advanced configuration

" File associations
filextype {*.pdf}
        {Open with pdf viewer}
        zathura %f,
        {Open with evince}
        evince %f,

filextype {*.txt,*.md}
        {Edit in vim}
        vim %f,

" Image preview with script
fileviewer {*.jpg,*.jpeg,*.png,*.gif,*.bmp}
         6 < %f 3>&- 4>&-

" Automatic directory-specific settings
autocmd DirEnter ~/* call SetupHome()
function! SetupHome()
  if $PWD =~ '/projects'
    set sortorder=name
  endif
endfunction

" Bookmarks
mark d ~/Documents
mark D ~/Downloads
mark p ~/Projects
mark h ~/

" Commands
command! mkcd :mkdir <args> | cd <args>
command! fhere :find <args> %pwd
command! diff :compare<cr>

Custom Color Scheme

~/.config/vifm/colors/myscheme
" ~/.config/vifm/colors/myscheme
" Vifm color scheme

" Default colors
highlight clear

" File types
highlight Directory ctermfg=Blue ctermbg=default
highlight Executable ctermfg=Green ctermbg=default
highlight Link ctermfg=Cyan ctermbg=default
highlight Broken ctermfg=Red ctermbg=default

" UI elements
highlight CmdLine ctermbg=White ctermfg=Black
highlight StatusLine ctermbg=Black ctermfg=White
highlight WildMenu ctermbg=Yellow ctermfg=Black
highlight ErrorMsg ctermfg=Red ctermbg=default

Tips and Tricks

File Associations

Use filextype and fileviewer commands in vifmrc to automatically open files with the appropriate application based on file type.

Bookmarks

Use mark command to create bookmarks (e.g., mark d ~/Documents). Jump to bookmarks with 'd.

Pane Comparison

Use :compare command to visually compare directories in both panes. Useful for finding differences between folders.

Custom Commands

Define custom commands in vimrc with command keyword. Combine them with standard Unix tools for powerful workflows.

Pane Synchronization

Navigate both panes simultaneously with :sync command. This is especially useful when exploring similar directory structures.

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More