cfiles - A Fast Terminal File Manager with Vim Keybindings


File managers are an essential tool for any operating system. They provide an interface for users to navigate and manage files on their system. While there are many graphical file managers available, some users prefer a terminal-based approach. cfiles is a fast terminal file manager with Vim keybindings. In this article, we will introduce you to cfiles and show you how to use it.

What is cfiles?

cfiles is a terminal-based file manager written in C. It is designed to be fast, lightweight, and customizable. cfiles is inspired by ranger, another popular terminal file manager, but with some notable differences. The main difference is that cfiles uses Vim keybindings, making it an excellent choice for Vim users. cfiles is also highly configurable, allowing users to customize the interface to their liking.

Installation

Before we dive into using cfiles, we need to install it. cfiles is available in many Linux distributions' repositories, so installation should be straightforward. On Ubuntu, for example, you can install cfiles with the following command −

sudo apt-get install cfiles

If cfiles is not available in your distribution's repositories, you can download the source code from the cfiles GitHub repository and compile it yourself.

Usage

Now that we have installed cfiles let's take a look at how to use it. Launch cfiles by running the following command in the terminal −

cfiles

Upon launch, you will see a split-screen interface. The left pane displays the file system hierarchy, while the right pane displays the contents of the currently selected directory. You can navigate the file system hierarchy using the arrow keys, and you can select files and directories using the spacebar. Once you have selected a file or directory, you can perform various operations on it using the keyboard shortcuts.

Keyboard shortcuts

cfiles uses Vim keybindings, which means that the keyboard shortcuts will be familiar to Vim users. Here are some of the most commonly used keyboard shortcuts −

  • j and k to move up and down the file system hierarchy

  • h and l to collapse and expand directories

  • Ctrl + f to search for files and directories

  • i to toggle hidden files and directories

  • n and N to navigate to the next and previous search result

  • Enter to open a file or directory

  • q to quit cfiles

Customization

cfiles is highly customizable. You can change the colors, fonts, and even the keyboard shortcuts to your liking. The configuration file for cfiles is located in ~/.config/cfiles/config. You can edit this file using your favorite text editor.

Here are some of the things you can customize −

  • Colors − You can change the colors of the interface by modifying the color_* variables in the config file.

  • Fonts − You can change the fonts used by cfiles by modifying the font variable in the config file.

  • Keyboard shortcuts − You can customize the keyboard shortcuts used by cfiles by modifying the map_* variables in the config file.

For example, if you want to change the color of the selected item, you can add the following line to the config file −

color_selected = blue

Or, if you want to change the font used by cfiles, you can add the following line to the config file −

font = DejaVu Sans Mono 10

Conclusion

As you can see, cfiles is a great terminal file manager with Vim keybindings. It is highly configurable, making it a great choice for users who like to customize their tools. cfiles is also incredibly fast, thanks to its minimalistic design. With cfiles, you can quickly navigate and manage files on your system without leaving the terminal.

We hope this article has been helpful in introducing you to cfiles and showing you how to use it. If you have any questions or need further assistance, feel free to leave a comment below.

Updated on: 22-Jun-2023

148 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements