33

GitHub - mananapr/cfiles: A ncurses file manager written in C with vim like keyb...

 5 years ago
source link: https://github.com/mananapr/cfiles
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

cfiles

cfiles is a work in progress terminal file manager with vim like keybindings, written in C using the ncurses library. It aims to provide an interface like ranger while being lightweight, fast and minimal.

screenshot

Dependencies

  • ncurses
  • cpand mv for copying and moving
  • fzf for searching
  • w3mimgdisplay for image previews
  • xdg-open for opening programs
  • vim for renaming, bulk renaming and editing clipboard
  • mediainfo for viewing media info and file sizes
  • sed for removing a particular selection
  • atool for archive previews

Compiling and Installation

To compile, run

gcc cf.c -lncurses -o cf

To install, simply move the generated executable to a directory that is in your $PATH

Keybindings

Key Function h j k l Navigation keys G Go to end g Go to top H Go to top of current view M Go to middle of current view L Go to bottom of current view f Search using fzf F Search using fzf in the present directory S Open Shell in present directory space Add/Remove to/from selection list tab View selection list e Edit selection list u Empty selection list y Copy files from selection list v Move files from selection list a Rename Files in selection list dd Move files from selection list to trash dD Remove selected files i View mediainfo and general info . Toggle hidden files ' View/Goto bookmarks m Add bookmark p Run external script r Reload q Quit

Directories Used

cfiles uses $HOME/.cache/cfiles directory to store the clipboard file. This is used so that the clipboard can be shared between multiple instances of cfiles. That's why I won't be adding tabs in cfiles because multiple instances can be openend and managed by any terminal multiplexer or your window manager. Note that this also means the selection list will persist even if all instances are closed.

cfiles also uses $HOME/.local/share/Trash/files as the Trash Directory, so make sure this directory exists before you try to delete a file.

For storing bookmarks, cfiles uses $HOME/.cache/cfiles/bookmarks file. Bookmarks are stored in the form <key>:<path>. You can either edit this file directly or press m in cfiles to add new bookmarks.

cfiles looks for external scripts in the $HOME/.cache/cfiles/scripts directory. Make sure the scripts are executable before moving them to the scripts directory.

Why C?

I wanted to improve my C and learn ncurses so I decided this would be an ideal project.

Apart from this, I have always wanted an alternative to ranger that is faster while still having a similar UI.

Todo

  • Improve Upwards Scrolling
  • Show sorted directories before files
  • Fix the G keybinding
  • Add basic operations like deleting, copying etc.
  • Add rename functionality
  • Add option to show selection list
  • Show current progress or status of copying files
  • Add functionality to open files
  • Add image previews using w3mimgdisplay
  • Preserve aspect ratio in image previews
  • Add fuzzy file search using fzf
  • Find a way to redraw windows after displaying image previews or running fzf
  • Find a way to remove cursor after running fzf
  • Select the file directly from fzf
  • Supress output from xdg-open
  • Find a way to remember selection position of parent directory
  • Add open in terminal functionality
  • Add file previews
  • Improve file previews
  • Add config file for easy user customizability
  • Add more options in config file
  • Fix random segfaults
  • Show more info in the statusbar
  • Add color support
  • Add bookmarks
  • Add ability to run external scripts
  • Refactor Code

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK