Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

Insh is a graphical, interactive, terminal environment.

Install

To install the latest version of insh and inshd run:

cargo install --git https://github.com/AustinScola/insh --tag latest insh inshd

Usage

By default, Insh starts out in a file browser. Insh has two other main components as well: a file finder and a file contents searcher.

Universal commands

Some commands work from all components:

CommandDescription
<Ctrl>-xExit Insh.
rRefresh.

Input Bar Commands

Several components use the input bar which has the following commands:

CommandDescription
<Ctrl>-qExit the file finder
Any characterAppend the character to the current input.
<Enter>Search for files matching the input.
<Backspace>Remove the last character from the input.
<Tab>Fill in the input with the suggestion.

Browser

The file browser shows the current directory at the top, and lists the entries of the directory below. The currently selected entry is highlighed in yellow.

CommandDescription
j | <Down>Move the selection down by one entry.
k | <Up>Move the selection up by one entry.
J | <End>Move the selection to the last entry.
K | <Home>Move the selection to the first entry.
l | <Enter>If the currently selected entry is a file, then open it in vim. Else, if the currently selected entry is a directory, then change the current directory to the selected directory.
h | <Backspace>Change directories to the parent of the current directory (if the current directory is not the root directory).
bRun bash with the working directory set to the current directory.
cOpen the file creator for creating a file.
COpen the file creator for creating a directory.
fOpen the file finder.
sOpen the file contents searcher.
mToggle showing the metadata of the entries.
yEYank the selected entry filename to the clipboard.
yyYank the selected entry file path to the clipboard.
YYank the selected entry file contents to the clipboard.

File Creator

The file creator can be used to create a file in a directory.

The file creator shows the directory at the top, then an input bar, then any error from attempting to create a new file.

Finder

The file finder shows the directory at the top, then an input bar, then the found files. The finder starts out with the input bar focused. The input can be any valid regular expression.

The finder finds files in the current directory (recursively) for which the regex pattern matches the file name.

Found Files Commands:

CommandDescription
<Ctrl>-qReturn focus to the input bar.
j | <Down>Move the selection down by one hit.
k | <Up>Move the selection up by one hit.
J | <End>Move the selection to the last hit.
K | <Home>Move the selection to the first hit.
l | <Enter>Open the hit in vim.
gGo to the hit in the file browser.
GGo to the hit in the file browser and select it.
yEYank the hit filename to the clipboard.
yyYank the hit file path to the clipboard.
YYank the hit file contents to the clipboard.

Searcher

The file contents searcher searches all files in the current directory recursively for a given input string.

The searcher displays the directory at the top, then an input bar, and then the hits. For each hit, the file name is displayed, then a line for each occurance of the string with the line number.

The commands for the input bar are the same as those for the Finder.

Searcher Contents Commands

CommandDescription
<Ctrl>-qReturn focus to the input bar.
j | <Down>Move the selection down.
k | <Up>Move the selection up.
J | <End>Move the selection to the last file hit.
K | <Home>Move the selection to the first file hit.
<Ctrl>-jMove the view down.
<Ctrl>-kMove the view up.
l | <Enter>Open the hit in vim. If the file path of a hit is selected, then open vim at the start of the file. Else, if an occurrence of the string is selected, then open vim at the line of the occurrence.
gGo to the hit in the file browser.
GGo to the hit in the file browser and select it.
yEYank the hit to the end. If the file path of a hit is selected, yank the relative file path. Else, if an occurence of the string is selected, yank that line.
yyYank the hit line. If the file path of a hit is selected, yank the full file path. Else, if an occurence of the string is selected, yank that line.
YYank the hit file contents to the clipboard.

Configuration

Insh Configuration

Insh can be configured by the file ~/.insh-config.yaml.

general.tab_width (usize): The width of the <Tab> character (default=4).

general.bell (bool): Whether or not the bell sound should be made (default=true).

browser.sort (map|null): How files are sorted alphabetically. If null, then files are not sorted (default={}).

browser.sort.case_insensitive (bool): Whether or not the filename case is ignored when sorting files (default=true).

browser.sort.hidden (first|last|mixed): How hidden files (files with a leading .) are sorted. If mixed, then the leading . is ignored when sorting files (default=last).

browser.metadata (bool): Whether or not to show metadata (default=false).

Inshd Configuration

Inshd can be configured by the file ~/.inshd-config.yaml.

server.request_handlers.num (usize): The number of request handlers (default=8).

database.pool.size (usize): The size of the database pool (default=8).

finder.history.length (usize): The number of file finds to store (default=1000).

searcher.history.length (usize): The number of searches to store (default=1000).