vifm
Vim-like file manager with dual panes.
Official WebsiteFeatures
Installation
brew install vifmapt install vifmpacman -S vifmWhy 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
# 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 installDual 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
| Key | Action |
|---|---|
h | Move up one level / go to parent directory |
j | Move to next file/folder |
k | Move to previous file/folder |
l | Enter directory / open file |
Tab | Switch between panes |
gg | Go to first file |
G | Go to last file |
: | Enter command mode |
q | Quit vifm |
File Operations
| Operation | Keys | Description |
|---|---|---|
| Copy | yy | Copy selected file |
| Cut | dd | Cut selected file |
| Paste | pp | Paste copied/cut file |
| Delete | dD | Delete selected file |
| Rename | cw | Rename file |
| Create Directory | :mkdir | Create new directory |
| Create File | :touch | Create new file |
| Select Files | Space | Toggle file selection |
Navigation Keybindings
| Keys | Purpose |
|---|---|
/ | Search for files |
? | Search backward |
n | Next search result |
N | Previous search result |
zh | Toggle hidden files |
:only | Maximize/zoom current pane |
:split | Split panes horizontally |
:vsplit | Split 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
" 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=millerCustom Keybindings
" ~/.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 - 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
" 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=defaultTips 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.