❮ Zsh Command Architect ❯
ZCA allows to copy segments of commands in history, rearrange segments of current command, delete segments of current command.
This way user glues command from parts without using a mouse.
Advanced history search (multi word, without duplicate lines) allows to quickly find the parts.
| Keys | Description |
|---|---|
| Ctrl+T | Start Zsh Command Architect (Zshell binding) |
| Enter | Delete selected segment (command window) or add selected segment (history window) |
| [ or ] | Move active segment (when in command window) |
| Shift+left or Shift+right | Move active segment (when in command window) |
| Tab | Switch between the two available windows |
| g, G | Beginning and end of the list |
| / | Start incremental search |
| Esc | Exit incremental search, clearing filter |
| <,>, {,} | Horizontal scroll |
| Ctrl+L | Redraw of whole display |
| Ctrl+O, o | Enter uniq mode (no duplicate lines) |
| Ctrl+W | (in incremental search) - delete whole word |
| Ctrl+K | (in incremental search) - delete whole line |
| Ctrl+D, Ctrl+U | Half page up or down |
| Ctrl+P, Ctrl+N | Previous and next (also done with vim’s j,k) |
Add zi load z-shell/zsh-cmd-architect to .zshrc.
Add zgen load z-shell/zsh-cmd-architect to .zshrc and issue a zgen reset (this assumes that there is a proper zgen save construct in .zshrc).
Add antigen bundle z-shell/zsh-cmd-architect@main to .zshrc. There also should be antigen apply.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/z-shell/zsh-cmd-architect/main/doc/install.sh)"
To update run the command again.
ZCA will be installed at ~/.config/zca/zsh-cmd-architect, config files will be copied to ~/.config/zca. .zshrc will be updated with code snippet at the bottom.
After installing and reloading shell give
ZCAa quick try with Ctrl+T.
After extracting ZCA to {some-directory} add following two lines to ~/.zshrc:
fpath+=( {some-directory} )
source "{some-directory}/zsh-cmd-architect.plugin.zsh"
As you can see, no plugin manager is needed to use the *.plugin.zsh
file. The above two lines of code are all that almost all plugin
managers do. In fact, what’s actually needed is only:
source "{some-directory}/zsh-cmd-architect.plugin.zsh"
ZCA detects if it is used by any plugin manager and can
handle $fpath update by itself.
Running script doc/generate_single_file will create single-file version of ZCA.
It can be sourced from .zshrc.
Note:
- Don’t forget about configuration files (copy them to
~/.config/zca).
ZCA is fastest with Zsh before 5.0.6 and starting from 5.2
Also check out Zsh Navigation Tools and Zsh Editing Workbench