Home

Awesome

shell-explorer

File explorer with preview, made with shell script.

shell-explorer

Installation

On Mac, you can install the script by Homebrew:

$ brew install rcmdnk/rcmdnkpac/shell-explorer

You can also use an install script on the web like:

$ curl -fsSL https://raw.github.com/rcmdnk/shell-explorer/install/install.sh| sh

This will install scripts to /usr/bin and you may be asked root password.

If you want to install other directory, do like:

$ curl -fsSL https://raw.github.com/rcmdnk/shell-explorer/install/install.sh|  prefix=~/usr/local/ sh

Or, simply download the script and set where you like.

:warning: Install sentaku, too if you download directly.

Usage

Start shell-explorer

Explore current directory:

$ se

Start from given directory:

$ se $HOME/my_dir/

Give the list from stdin:

$ echo file1 file2 file3|se

Show the content of the file in the right (give -r if SENTAKU_CONTENT_SHOW is set to other than 1.):

$ se

shell-explorer-right

Show the content of the file under the list:

$ se -u

shell-explorer-under

If you don't want to show preview, use -n.

Help:

$ se -h

Usage: ex_explorer.sh [directory] [-aruvC]

Arguments:
   -a         Show hidden files/directories.
   -r         Show file content in the right.
   -u         Show file content under the list.
   -d         Show contents of the directory.
   -D         Do not show contents of the directory.
   -n         No preview.
   -C         No confirmation at deletion.
   -h         print this help and exit.

Usage during explorer

KeyAction
n(any number)Set number. Multi-digit can be used (13, 320, etc...). Used/reset by other key.
k/j, C-p/C-nUp/Down (if n is given, n-th up/n-th down).
gg/GGo to top/bottom. (If n is given, move to n-th candidate.)
C-a/C-eGo to the beggining/end.
C-u/C-dHalf page down/Half page down.
C-b/C-fPage up/Page down.
M-v/C-vPage up/Page down.
C-i/C-oMove the item up/down.
q, C-xQuit.
SpaceSelect/unselect current line for multi-selection. At Emacs mode or search mode in Vim mode, it selects when space is pushed twice.
C-sStart/Stop Visual mode (multi-selection).
vVisual mode.
EscAt search mode, first Esc takes it back to normal mode with selected words. Second Esc clear search mode. Visual mode is cleared by first Esc.
/Search.
KeyAction
lShow contents of selected files with $VISUAL (or less).
eEdit selected files with $EDITOR (or vi).
sShow details of selected items with ls -l.
dDelete selected items.
pExit and print selected items' full paths.
cChange to a directory under the cursor. (No action for a file.)
EnterIf an item under the cursor is a directory, move to it. Otherwise same as l.

Environment Variables

NameDescriptionDefault
SENTAKU_CONTENT_SHOW0: No preview, 1: Preview in the right (-r), 2: Preview under the list (-u)1
SENTAKU_SHOW_DIRECTORY_CONTENT0: No preview for a directory. 1: Show directory content as preview.1
SENTAKU_FILE_CONTENT_LINESNumber of lines of content to be shown. (Only for -u mode)10
SENTAKU_EDITOREditor to be used by e.$EDITOR (or vi if $EDITOR is not set)
SENTAKU_VISUALAPPViewer to be used by l$VISUAL (or less if $VISUAL is not set)
SENTAKU_CONFIRMIf 1, se will ask a confirmation at deletion.1
SENTAKU_START_DIR=Starting directory in case of no files/directories inputs.Current direcotry (.)