Skip to content

⚙️ Organized shortcuts for various command-line editing operations, plus new operations (e.g. incremental history word completion)

License

Notifications You must be signed in to change notification settings

z-shell/zsh-editing-workbench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo ❮ Zsh Editing Workbench ❯

ZEW provides organized key bindings for various command line editing features.

Original features are used to make user not depart from mainstream Zsh.

💡 Wiki: ZEW - Plugins

Organized shortcuts for various command line editing operations, plus new operations (e.g. incremental history word completion).

Incremental history word completing (started withAlt+h, Alt+H or Option+h, Option+H on Mac).

Key(s) Description
Alt+w Delete a shell word 1
Alt+t Transpose (swap) shell words
Alt+m Copy previous shell word, or word before that, etc. when used multiple times
Alt+M Just copy previous shell word without iterating to previous ones
Alt+. Copy last shell word from previous line, or line before that, etc. when used multiple times; can be combined with Alt+m
Ctrl+W Delete word according to configured word style 2:
Alt+r Transpose (swap) words according to configured word style (cursor needs to be placed on beginning of word to swap)
Alt+/ Complete some word 3 from history
Alt+h, Alt+H Complete shell word from history (custom version)
Alt+J Break line
Alt+_ Undo

Installation With Zi

Add zi load z-shell/zsh-editing-workbench to .zshrc. The config files will be available in ~/.config/zew.

Installation With Zgen

Add zgen load z-shell/zsh-editing-workbench to .zshrc and issue a zgen reset (this assumes that there is a proper zgen save construct in .zshrc). The config files will be available in ~/.config/zew.

Installation With Antigen

Add antigen bundle z-shell/zsh-editing-workbench to .zshrc. There also should be antigen apply. The config files will be in ~/.config/znt.

Manual Installation

After extracting ZEW to {some-directory} add following two lines to ~/.zshrc:

fpath+=( {some-directory} )
source "{some-directory}/zsh-editing-workbench.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-editing-workbench.plugin.zsh"
Configure terminals
  • XTerm

To make Alt key work like expected under XTerm add XTerm*metaSendsEscape: true to your resource file, e.g.:

echo 'XTerm*metaSendsEscape: true' >> ~/.Xresources
  • Konsole

To make Alt key work like expected under Konsole add Konsole*keysym.Meta: Meta to your resource file, e.g.:

echo 'Konsole*keysym.Meta: Meta' >> ~/.config/konsolerc

Footnotes

  1. A shell word is a text that Zsh would see as single segment. For example $(( i + 1 )) is a single shell word.

  2. A word style defines a way Zsh recognizes segments (words) of text in commands that want to use the style information.

    • The style can be configured in zew.conf to be one of:
      • bash words are built up of alphanumeric characters only.
      • normal as in normal shell operation: word characters are alphanumeric characters plus any characters present in the string given by the parameter $WORDCHARS.
      • shell words are complete shell command arguments, possibly including complete quoted strings, or any tokens special to the shell.
      • whitespace words are any set of characters delimited by whitespace.
      • default restore the default settings; this is the same as 'normal' with default $WORDCHARS value.
  3. Some word is in general a sophisticated word, but not a shell word, because of limitations in Zsh history word completion. Some word is rather not build from special characters, it works well for normal characters.

About

⚙️ Organized shortcuts for various command-line editing operations, plus new operations (e.g. incremental history word completion)

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages