Vifm: the file manager with Vim-type keys for Linux

Introduction

Vifm is a Linux file manager that combines Vim's power and ergonomics with a double panel interface, allowing you to browse, edit and organize the file system without leaving the keyboard. Inspired by the modal editors, Vifm offers a family experience for Vim and Neovim users, while still accessible to those who just start with text-based interfaces. In this post we will explore its main features, how to install and configure it, and why it has become a favorite tool for many system managers and developers.

What is Vifm?

What exactly is Vifm? In essence, it is a console file manager that shows two side panels, each capable of hosting a different directory. This arrangement facilitates operations such as copying or moving files between folders with just a few key pulses. Like Vim, Vifm works in modes: normal mode for browsing, insert mode for editing file names and command mode for running complex instructions. Its minimalist design dispenses with graphic tool bars, making it extremely light and fast even in old hardware or in remote SSH sessions.

Installation

Install Vifm in most Linux distributions is easy thanks to its presence in official repositories. In Ubuntu or Debian you simply run sudo apt install vifm, while in Fedora you use sudo dnf install vifm and in Arch Linux sudo pacman -S vifm. For users who prefer to compile from the source code, the project is housed in GitHub and requires only the development libraries of ncurses and, optionally, python for some plugins. After installation, just type vifm in any terminal to launch the application and start exploring your interface.

Interface and basic navigation

When starting Vifm, two side panels are presented: the left shows the current work directory and the right usually starts on the same route, although it can be configured to open on the last active panel. The lower bar indicates the current mode (NORMAL, INSERT or COMMAND) and displays file information under the cursor, such as permissions, size and modification date. To move between panels the Tab key is used, while the arrows or keys h, j, k, l allow to navigate the cursor up, down, left and right, respectively, as in Vim.

File operations and command mode

In normal mode, the most common operations are run with intuitive shortcuts: 'c' creates a file or directory (adding '/' for directories), 'd' removes the element under the cursor after asking for confirmation, 'r' renombra the selected file or directory, 'and' copy (yank) and 'p' paste (paste) on the active panel. These keys remember Vim's commands to change, delete, yank and put. By pressing ':' you enter the command mode, where you can run shell instructions like! ls -lh or! git status without leaving the administrator.

Personalization

The vifmrc configuration file, located in ~/ .config / vifm / vifmrc, allows to customize almost all aspects of the program. There you can change the color schemes, define new key assignments, activate the display of icons using source patches such as Nerd Fonts and display hidden files with the set showhiden order. It is also possible to adjust the default behavior of operations such as the classification order or the display of progress bars. With a few lines, each user adapts Vifm to its workflow and aesthetic preferences.

Integration with external tools

Vifm is easily integrated with other command line tools through its command mode and custom assignments. For example, fzf can be launched to search files diffuse with an assignment like map:! fzf, or use ripgrep to search for content within files directly from the panel. In addition, git hooks can be configured that update the panel by detecting changes in the repository, or call external scripts to rename file lots. These extensions make Vifm a fully customizable productivity center.

Comparison and conclusion

Compared to other console file administrators such as ranger, nnn or Midnight Commander, Vifm stands out for its modal approach and its close similarity to Vim, which makes it ideal for those already living in the text editing environment. Ranger offers a preview of content and a deeper integration with images and videos, while nnn is extremely minimalist and fast, but lacks Vifm's editing modes. Midnight Commander, for its part, provides a more visual environment with drop-down menus, although it is heavier. In short, Vifm offers the best balance between power, customization and familiarity for command line lovers who seek efficiency without sacrificing comfort. If you haven't tried it yet, install Vifm today and find out how you can transform your way of working with Linux files.

This work is under aCreative Commons License Attribution 4.0 International for Francesc Roig francesc @ vivaldi.net.

EnglishenEnglishEnglish