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 --locked --git https://github.com/AustinScola/insh --tag latest insh inshd

Usage

By default, Insh starts out in a file browser.

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 input bar.
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.

Directory Bar Commands

Several components use the directory bar. From these components Ctrl-d focuses on the directory bar. The directory bar has the following commands:

CommandDescription
<Ctrl>-qExit the directory bar.
Any characterAppend the character to the current input.
<Backspace>Remove the last character from the input.
<Ctrl>-wRemove the last part from the input.
<Tab>Fill in the input with the suggestion.
<Enter>Use the directory and return focus

Multiplexing

Insh has terminal multplexing inspired heavily by tmux. The session, window, and pane concepts are all borrowed. As is the usage of a prefix.

Normal Mode

CommandStatus bar commandDescription
<Ctrl>-b %split-vertically [component] [args]…Split the current pane vertically.
<Ctrl>-b "split-horizontally [component] [args]…Split the current pane horizontally.
<Ctrl>-b +split-quad [component] [args]…Split the current pane horizontally and then vertically.
<Ctrl>-b cnew-window [name]Create a new window.
new-session [name]Create a new session.
<Ctrl>-b xkill-pane [name]Kill a pane (default current).
kill-window [name]Kill a window (default current).
kill-session [name]Kill a session (default current).
<Ctrl>-b j | <Ctrl>-b <Down>focus-downSelect the pane below the current pane.
<Ctrl>-b k | <Ctrl>-b <Up>focus-upSelect the pane above the current pane.
<Ctrl>-b h | <Ctrl>-b <Left>focus-leftSelect the pane to the left of the current pane.
<Ctrl>-b l | <Ctrl>-b <Right>focus-rightSelect the pane to the right of the current pane.
<Ctrl>-b <Ctrl>-<Down>resize-pane-downResize the pane downwards.
<Ctrl>-b <Ctrl>-<Up>resize-pane-upResize the pane upwards.
<Ctrl>-b <Ctrl>-<Left>resize-pane-leftResize the pane left.
<Ctrl>-b <Ctrl>-<Right>resize-pane-rightResize the pane right.
<Ctrl>-b ysynchronize-panesSynchronize panes.
<Ctrl>-b ztoggle-zoomToggle zooming the current pane.
<Ctrl>-b {switch-pane-previousSwitch the current pane with the previous pane.
<Ctrl>-b }switch-pane-nextSwitch the current pane with the next pane.
<Ctrl>-b }swap-pane Swap two panes.
rename-pane Rename the current pane.
<Ctrl>-b ,rename-window Rename the current window.
<Ctrl>-b $rename-session Rename the current session.
set-dir [–window | -w | –session | -s] <dir>Set the default starting directory for a window/session (default window).
change-dir [–window | -w | –session | -s] <dir>Change the directory for a window/session (default window).
dir [–window | -w | –session | -s] <dir>A combination of set-dir and change-dir.
<Ctrl>-b [change-mode copyEnter copy mode
<Ctrl>-b slist-sessions | lsView the session, window, and pane switcher.
<Ctrl>-b :change-mode promptPrompt for a command.
send-keys Send keys to a pane.
detachDetach from the current session.

Copy Mode

CommandDescription
h | <Left>Move the cursor left.
j | <Down>Move the cursor down.
k | <Up>Move the cursor up.
l | <Right>Move the cursor right.
wMove the cursor to the next word.
WMove the cursor to the next WORD.
bMove the cursor to the beginning of the word.
BMove the cursor to the beginning of the WORD.
eMove the cursor to the end of the word.
EMove the cursor to the end of the WORD.
0 | <Home>Move the cursor to the start of the line.
$ | <End>Move the cursor to the end of the line.
ggMove the cursor to the start of the buffer.
GMove the cursor to the end of the buffer.
v | <Space>Start selecting at the current cursor position.
y | <Enter>Copy the selection to the clipboard.
<Escape>Unselect.
/Search.
?Search backwards.
qExit out of copy mode.

Search Mode

CommandDescription
nGo to the next hit.
pGo to the previous hit.

Browser

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

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 the editor. Else, if the currently selected entry is a directory, then change the current directory to the selected directory.
vIf the currently selected entry is a file, then open it in vim.
h | <Backspace>Change directories to the parent of the current directory (if the current directory is not the root directory).
<Ctrl>-eScroll down without changing the selection.
<Ctrl>-yScroll up without changing the selection.
bRun bash with the working directory set to the current directory.
eOpen the file editor prompt.
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.
ROpen find and replace.
aOpen the the ai chat.
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.

Editor

The editor is a modal editor heavily inspired by vim.

Modes

ModeDescription
NormalNavigate.
CommandUse commands.
InsertInsert text.
VisualVisually select characters.
Visual LineVisually select lines.
Visual BlockVisually select blocks.
SearchSearch for text.

Common

CommandDescription
<Ctrl>-eScroll down.
<Ctrl>-yScroll up.

Normal Mode

CommandDescription
[modifier]<Movement>Move the cursor.
:Enter command mode.
iEnter insert mode.
aInsert after the cursor.
AInsert at the end of the line.
oOpen a line after the cursor and enter insert mode.
OOpen a line before the cursor and enter insert mode.
vEnter visual mode.
VEnter visual line mode.
<Ctrl>-vEnter visual block mode.
Insert a space.
y<movement>Yank.
yyYank the line.
pPaste after.
PPaste before.
xDelete a character.
d<movement>Delete the movement.
ddDelete the line.
rReplace a character.
uUndo.
<Ctrl>-rRedo.
/Enter search mode.
nGo to next search hit.
NGo to previous search hit.

Command Mode

CommandDescription
<Esc>Cancel the command and enter normal mode.
<Printable>Add the printable character to the command.
<Enter>Run the command and enter normal mode.
<Backspace>Backspace.

Commands

CommandDescription
wWrite the file.
qQuit (refuse if there are unwritten changes).
q!Quit (even if there are unwritten changes).
wqWrite and quit.
vimOpen the file in vim (refuse if there are unwritten changes).
vim!Open the file in vim (even if there are unwritten changes).

Insert Mode

CommandDescription
<Esc>Enter normal mode.
<Printable>Insert the printable character.
<Tab>Enter 4 spaces.
<Enter>Enter a newline character.
<Backspace>Backspace.
<Paste>Insert the clipboard.

Common Visual

Visual modes share many of the same commands.

CommandDescription
<Esc>Enter normal mode.
[modifier]<Movement>Move the cursor.
yYank.
YYank to clipboard.
x | dDelete the selection.
uLowercase the selection.
UUppercase the selection.
rReplace the selection.
pReplace the selection with the paste buffer.

Visual Mode

CommandDescription
VEnter visual line mode.
<Ctrl>-vEnter visual block mode.

Visual Line Mode

CommandDescription
vEnter visual mode.
<Ctrl>-vEnter visual block mode.

Visual Block Mode

CommandDescription
vEnter visual mode.
VEnter visual line mode.

Search Mode

CommandDescription
<Esc>Cancel the search and enter normal mode.
<Enter>Go to the next hit.
<Printable>Add the printable character to the search.
<Backspace>Backspace.

Modifiers

ModifierDescription
<Num>Perform the action the specified number of times.

Movements

MovementDescription
hLeft.
jDown.
kUp.
lRight.
wStart of next word.
WStart of next WORD.
bStart of previous word.
BStart of previous WORD.
eEnd of current/next word.
EEnd of current/next WORD.
0Beginning of line.
$End of line.
J | GEnd of file or line number if a number modifier is used.
K | ggBeginning of 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 the editor.
vOpen the hit in vim.
<Ctrl>-eScroll down without changing the selection.
<Ctrl>-yScroll up without changing the selection.
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 occurrence 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.
fAdd a file filter.
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>-eScroll down without changing the selection.
<Ctrl>-yScroll up without changing the selection.
l | <Enter>Open the hit in the editor. If the file path of a hit is selected, then open the editor at the start of the file. Else, if an occurrence of the string is selected, then open the editor at the line of the occurrence.
vOpen 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 occurrence 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 occurrence of the string is selected, yank that line.
YYank the hit file contents to the clipboard.

Find and Replace

The find and replace component can be used to find and replace text.

Commands

CommandDescription
yReplace the next occurance.
nDo not replace the next occurance.
YReplace all occurances.
NDo not replace any occurances.

Inshie

Inshie is an AI chatbot and coding harness.

CommandDescription
<Ctrl>-qExit Inshie.
Any characterAppend the character to the current input.
<Ctrl>-oAppend a newline to the current input.
<Backspace>Remove the last character from the input.
<Enter>Send the prompt to Inshie.
<Ctrl>-eScroll down.
<Ctrl>-yScroll up.
<Ctrl>-nStart a new conversation.
<Ctrl>-hOpen the Inshie conversation history.

Inshie Commands

Inshie has / commands that can be used from a chat.

CommandDescription
/usagePrint usage statistics.
/effort high | medium | lowSet the reasoning effort level.

Inshie Conversation History

View and manage the conversation history for Inshie.

CommandDescription
<Ctrl>-qExit the Inshie conversation history and go back to Inshie.
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>Open the selected chat.
<Ctrl>-eScroll down.
<Ctrl>-yScroll up.
nStart a new chat.
rRename a chat.
/Search past chats.
ddDelete the selected chat.

Inshie Conversation History Searcher

Searches past chats.

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).

multiplexing.enabled (bool): Whether or not multiplexing should be enabled (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).

render.engine (full|incr): The rendering engine to use (default=incr).

Inshd Configuration

Inshd can be configured by the file ~/.insh/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).

multiplexing.commands.history.length (usize): The number of multiplexing command to store (default=1000).

multiplexing.pane.buffer_size (usize): The buffer size of a pane (default=20000).

browser.history.length (usize): The number of visited directories to store (default=1000).

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).

ai.base_url (str|null): The base URL for the AI inference engine (default=null).

ai.api_type (anthropic|openai): The AI inference engine type (default=anthropic).

ai.api_key (str|null): The AI inference engine API key (default=null).

ai.model (str): The AI model (default=claude-opus-5).

ai.instructions.override (str|null): Used to override the AI instructions (default=null).

ai.instructions.additional (str|null): Additional AI instructions (default=null).

ai.search.threshold (float): The maximum cosine distance for semantic search to be considered a hit; lower is stricter (default=0.7).

ai.tools.web.provider (exa): The web provider (default=exa).

ai.tools.web.api_key (str): The web provider API key.

ai.tools.web.base_url (str|null): Used to override the web provider’s base URL (default=null).

ai.tools.web.search.num_results (usize): The number of pages a web search returns (default=5).

ai.tools.web.search.highlight_characters (usize): The maximum number of characters of relevant passages returned per page by a web search (default=1000).

ai.tools.web.fetch.max_characters (usize): The maximum number of characters of a page returned by a web fetch (default=20000).