A set of mnemonic, discoverable keybindings for the ZSH Line Editor, inspired by Spacemacs
MIT License
SpaceZLE is a set of mnemonic, discoverable keybindings for the ZSH Line Editor, inspired by Spacemacs.
SpaceZLE creates a new ZLE keymap, and by default binds it to the space key
(SPC
) in ZLE's "normal mode" keymap (vicmd
). This keymap consists of
mnemonic, prefixed keybindings, like SPC i c
to insert the content of the
system clipboard, or SPC p f
to open a file from the current project
in your $EDITOR
. SPC SPC
opens a command palette, which shows all available
commands, their keybindings, and documentation.
These keybindings are also discoverable: pressing SPC
shows a description
of each prefix below the prompt, SPC i
shows the names and bindings for
SPC i c
, SPC i d
, and so on.
SpaceZLE is written in pure ZSH, and there's virtually no performance penalty for using it.
SPC SPC
: Command paletteSPC d
: dir
SPC d d
: Change working directorySPC d w
: Insert current working directorySPC d u
: Change working directory to parentSPC g
: git
SPC g a
: Launch forgit::addSPC g b
: Launch forgit::blameSPC g c
: Launch forgit::checkout::branchSPC g D
: Launch forgit::branch::deleteSPC g l
: Launch forgit::logSPC h
: help
SPC h m
: Display manpage (with FZF)SPC i
: insert
SPC i c
: Insert content of system clipboardSPC i d
: Insert directory with FZFSPC i e
: Insert from history with FZF (exact match)SPC i f
: Insert file with FZFSPC i h
: Insert from history with FZFSPC i p
: Insert file or directory from project root with FZFSPC p
: project
SPC p c
: Change to directory in project with FZFSPC p e
: Open EDITOR in project rootSPC p f
: Open file in project in EDITOR with FZFSPC p M
: Run Make in the project rootSPC q
: quit
SPC q q
: Exit zshSPC q r
: Reload ZSH (exec zsh)SPC S
: sys
SPC S H
: Halt the computerSPC S S
: Suspend the computerSPC S R
: Reboot the computerSPC w
: window
SPC w h
: tmux: Left paneSPC w j
: tmux: Down paneSPC w k
: tmux: Up paneSPC w l
: tmux: Right paneSPC w H
: tmux: Split window horizontallySPC w /
: tmux: Split window verticallySPC w d
: tmux: Delete paneSPC w L
: tmux: Last windowSPC w n
: tmux: Next windowSPC w w
: tmux: New windowSPC w n
: tmux: Previous windowSPC y
: yank
SPC y c
: Copy current working directory to clipboardSPC y h
: Copy command from shell history to clipboardSPC y l
: Copy last command to clipboardSPC y r
: Re-run last command and yank output to clipboardSPC x
: tmux
SPC x y
: Enter copy modeSPC x r
: ReloadSPC x h
: List keybindingsSPC x s
: Disable status barSPC x ↑
: Scroll up in copy modeClone the repo somewhere:
git clone https://github.com/langston-barrett/SpaceZLE ~/somewhere
Then add this line to your ~/.zshrc
:
source ~/somewhere/src/spacezle.zsh
SpaceZLE does not require any external tools, but some of the keybindings are significantly improved if they're available:
A few keybindings won't work properly without these tools, but the goal is to eventually have a fallback when a tool isn't available.
TODO
TODO