Vifm – A Commandline Based File Manager with ‘Vi Keybindings’ for Linux

[‘

n

In our last article, we have put together a list of 13 best file managers for Linux systems, most of which where graphical user interface (GUI) based. But if you have a Linux distribution that only uses the command line interface (CLI), then you need a text based file manager. In this article, we bring you one such file manager called Vifm.

n

Vifm is a powerful CLI and ncurses based cross-platform file manager for Unix-like, Cygwin and Window systems. It is feature-rich and comes with Vi like key bindings. It also uses a number of useful features from Mutt.

n

There is no need to learn a new set of usage commands, it provides you with absolute keyboard control over your files using generic Vi options/commands.

n

Useful Vifm Features:

n

    n

  • Provides a facility to edit several kinds of files.
  • n

  • Comes with two panes by default.
  • n

  • Supports Vi modes, options, registers, commands and so much more.
  • n

  • Supports auto-completion of commands.
  • n

  • Support for trash directory.
  • n

  • Offers various views (such as custom, column, compare and ls-like).
  • n

  • Supports remote execution of commands.
  • n

  • Also supports remote changing of directories.
  • n

  • Supports various color schemes.
  • n

  • Built-in support of automated FUSE file system mounts.
  • n

  • Supports use of functions.
  • n

  • Supports plugin for using vifm in vim as a file selector and so much more.
  • n

n

Suggested Read: Cloud Commander – Web File Manager to Control Linux File/Programs via Browser

n

How to Install Vifm Command-line File Manager in Linux

n

Vifm is available in the official software repositories of Debian/Ubuntu and Fedora Linux distributions. To install it, use the respective package manager to install it like this.

n

$ sudo apt install vifm   [On Debian/Ubuntu]rn$ dnf install vifm        [On Fedora 22+]rn

n

Once installed, you can start it by typing.

n

$ vifmrn

n

Supports Two Panes By Default

n

Use the space bar to shift from one pane to the other. To enter a directory, simply hit the [Enter] button.

n

Vifm Commandline File Manager
Vifm Commandline File Manager

n

Open A File in Vi/m Editor

n

To open a file such as the findhost.sh script in the right pane above, just highlight the file and press [Enter]:

n

Vifm - Open File for Editing in Vi
Vifm – Open File for Editing in Vi

n

Colored Visual Highlighter

n

To enable the visual highlighter, press V and scroll to see how it works.

n

Vifm Color Visual Highlighter
Vifm Color Visual Highlighter

n

Main Pane Manipulation Options

n

To view pane manipulation options/keybindings, press Ctrl-W.

n

Vifm View Pane Manipulation Options
Vifm View Pane Manipulation Options

n

To split the window horizontally press Ctrl-W then s.

n

Vifm Split Horizontally
Vifm Split Horizontally

n

To split the window vertically press Ctrl-W then v.

n

Vifm Split Vertically
Vifm Split Vertically

n

Use Tab To Auto-Complete Commands

n

First type a few letters in the command name (possibly two), then press Tab. To select the next option, press Tab again then hit [Enter].

n

Vifm Auto Complete Commands
Vifm Auto Complete Commands

n

Highlight Files in One Pane and View It On Another

n

You can list files in one pane and view content in another as you scroll over files, simply run the view command like this.

n

:viewrn

n

Vifm View File Content
Vifm View File Content

n

Delete A File in Vifm

n

You can delete a highlighted file by pressing dd. To delete it, press Y or N otherwise.

n

Vifm Delete a File
Vifm Delete a File

n

Vifm Command Line Trash

n

If you delete a file in Vifm, it is stored in the trash. To view the trash directory, type this command.

n

:trashesrn

n

To view files in trash, run the lstrash command (press q to return).

n

:lstrashrn

n

Vifm Trash Window
Vifm Trash Window

n

To restore files from the trash directory, first move into it by using the cd command like this.

n

:cd /home/aaronkilik/.local/share/vifm/Trashrn

n

Then select the file to restore, and type:

n

:restorern

n

Vifm Restore a File
Vifm Restore a File

n

For a comprehensive usage information and options, commands, tips check out the Vifm man page:

n

$ man vifmrn

n

Vifm Homepage: https://vifm.info/

n

Do check out following articles.

n

    n

  1. GNOME Commander: A ‘Two pane’ Graphical File Browser and Manager for Linux
  2. n

  3. Peazip – A Portable File Manager and Archive Tool for Linux
  4. n

n

In this article, we covered installation and basic features of Vifm a powerful CLI based file manager for Linux systems. Use the feedback form below to share your thoughts about it.

n

‘]