bim
bim is a tiny Vim-like editor written in Bash.
This is an early prototype, not a full Vim replacement. It starts in command mode and supports:
iinsert before the cursoraappend after the cursorIinsert at the beginning of the lineAappend at the end of the line- arrow keys, plus
h,j,k,l wmove forward by wordbmove backward by wordemove to the end of the current or next wordgemove backward to the end of the previous wordGgo to the last line, or a counted line such as10Ggggo to the first line, or a counted line such as10gg^move to the first non-blank character on the linexdelete the character under the cursordddelete the current lined$orDdelete from the cursor to the end of the linedwdelete forward by worddbdelete backward by wordywyank forward by wordybyank backward by wordy$yank from the cursor to the end of the linecwchange wordccchange the current lineCchange from the cursor to the end of the linessubstitute the character under the cursorrreplace the character under the cursoryyyank the current lineppaste line-wise yanks/deletes below the cursor, or character-wise yanks/deletes after the cursorJjoin the current line with the next lineoopen a new line below and enter insert modeOopen a new line above and enter insert modeuundo the last change.repeat the last change/pattern,?pattern,n, andNfor literal text search- numeric prefixes for common commands, such as
2dd,20yy,3p,5j,4x,5w,5dw,3rX, and2s Escreturn to command modeCtrl+Gshow file, modified state, line, and column info,namethenEnterrun a command defined in~/.bimrcand insert its output:w,:w path,:q,:q!,:wq, and:wq path
There is no persistent ruler/status line. The bottom line is used only for
commands, messages, and explicit Ctrl+G file info.
~/.bimrc commands
bim can load simple command shortcuts from ~/.bimrc. Each non-empty,
non-comment line is a command name, an equals sign, and the shell command to run:
date=date +'%A, %B %d, %Y'
uuid=uuidgen
In command mode, type ,date then Enter to run the configured date command
and insert its standard output at the cursor. Esc cancels a pending command,
and Backspace edits it before it runs. bim appends one space after inserted
command output so short snippets are ready for continued typing.
Commands are not run when bim starts. They only run when invoked explicitly
with ,name. bim does not source ~/.bimrc; it parses command definitions as
data. For safety, ~/.bimrc must be a regular file owned by the current user,
must not be a symlink, and must not be writable by group or other users.
Command names may contain letters, digits, underscores, and hyphens, and must
start with a letter or underscore.
Run it with:
./bim path/to/file