cetus

Lightning-fast file navigator.

Open or page a file using hotkeys, rather than pressing ARROW keys repetitively (although that is supported also.)

Many file actions are supported.

Scripts may be executed for selected files thus extending functionality.

Tested with ruby 2.6

Latest changes:

Selecting a file

There are two ways of selecting a file.

  1. Pressing C-s on a file.

  2. Use hotkey (on left of file) to select without having to navigate.

While using C-s marks a file as selected, OTOH pressing the hotkey will either open the file using PAGER or EDITOR depending on current mode.

Multiple Selection of files

  1. Press C-s on multiple files. '*' toggles between multiple and single select mode.

  2. Press * (asterisk) to enter multiple select mode. Now press the hotkey (left of file) to select it.

  3. Visual Mode. Press Ctrl-Space to enter visual/range select. Now move the arrow keys up or down to select. Press Ctrl-Space again to end selection. Several ranges may be selected.

To execute an action on multiple (or single) files, you may press C-x and choose an action such as move, delete, rename, copy, etc.

You may also select all files with the same extension as current file. Invoke the filter menu using Tilde-F. Now select x or :extension.

Tilde-s is the selection menu. M-a is select all, M-A is unselect all.

Moving multiple files

First select multiple files by the above means.

Now there are two ways to move selected files to another directory.

  1. Press C-x m and type the name of the directory at the prompt.

  2. Or navigate to the target directory, and then press C-x m and type "." at the prompt.

Copying files to another directory.

Use the same procedure as for moving files but press C-x c

  1. Press C-x c and then type the name of the target directory at the prompt.

  2. Select files, then navigate to the target directory, and press C-x c, and type '.' at the prompt.

  3. If copying a file, to the same directory, or if the file already exists, a unique name will be suggested (numeric suffix).

Scripts

Generators

Generators are used to generate a list of file names or directories that can be used for navigation, or paging/editing or other file actions.

For example, a generator could generate filenames from .viminfo or z or autojump

More

Fork of lyra with a different hotkey idea. Use this for quickly navigating your file system using hotkeys and bookmarks, and executing commands on single or multiple files easily.

See github.com/rkumar/lyra for detailed info of usage.

lyra uses keys from 1-9a-zA-Z for hotkeying file. This means that it leaves no keys for other commands other than control keys, alt-keys, and punctuation keys. Also, only 60 files can be shown at a time on a screen.

cetus tries another approach: it only uses lower case alphabets a-z (thus allowing us to use upper case, and numbers for other purposes).

It also maps z and Z which are at a convenient location. If there are more than 24 then za-zz are used. if the file exceed even that, then the range Za-ZZ is used. This means that larger screens will be filled with file names (upto ROWS * 3), and the user can even specify the number of columns. I've tried with 6. The remainder files gets an index of “&rt;” (right arrow) which means that if one presses right arrow then the indexing starts from the second column. RIGHT and LEFT arrow can be used to move indexing.

Press C-x to execute actions on selected files. A menu of actions is displayed. Or Press one of several commands after selecting files such as "D" for delete, or "M" to use your man-pager. Or else press "D" and you will be prompted to enter a file shortcut to delete. The rmtrash command is called for delete.

You can bind other capital letters to any external command. If there are selected files, they will be passed to the command, else you will be prompted to select a file.

The rest is similar to lyra. Some key points are highlighted here.

Other than using bookmarks, you can jump quickly to other directories or open files using BACKTICK and the relevant option which should become part of muscle memory very fast.

Requirements

Requires ruby 1.9.3 or higher, and uses zsh for globbing. Uses $EDITOR and $MANPAGER or $PAGER.

Optionally uses ack, locate, find for options with that name. You may replace ack with ag or other. Optionally has interface to z and viminfo – can be replaced with what you use.

INSTALL

(I have renamed cetus.rb to cetus and created a gem, so its in the bin folder)

Copy cetus to somewhere on your path, e.g. $HOME/bin

 cp cetus ~/bin

 alias c=~/bin/cetus

 $ c

Or :

 gem install cetus
 alias c=cetus

To quit, press “Q” or :q or :wq or :x. If you have created bookmarks, they will be saved with :x and :wq. :q will warn if you quitting with unsaved bookmarks. Used files and dirs are also saved when saving happens. However, if you have not saved bookmarks then you will not be prompted to save used dirs and files.

Be sure to try zfm, too. zfm requires only zsh and contains a VIM mode too if that interests you. See github.com/rkumar/zfm

Credits

Cetus refers to the constellation and means a whale if memory serves me correctly.