olets / zsh-abbr

The zsh manager for auto-expanding abbreviations, inspired by fish. ~13,000 unique cloners as of May '24, 580+ Homebrew installs 6/23-6/24
https://zsh-abbr.olets.dev
Other
511 stars 18 forks source link

cursor placement [#110, replaces pr #63] #111

Closed olets closed 3 months ago

olets commented 3 months ago

Features

Tips

  1. Add the ABBR_EXPANSION_CURSOR_MARKER to end of an expansion to opt out of inserting a space
    % ABBR_SET_EXPANSION_CURSOR=1
    % abbr nospace=none%
    % nospace[SPACE] # expands to `none[CURSOR]`
  2. Build "template-y" abbreviations by including multiple ABBR_LINE_CURSOR_MARKER's in an expansion
    % ABBR_SET_EXPANSION_CURSOR=1
    % ABBR_SET_LINE_CURSOR=1
    % abbr template="a%b % c%d"
    % template[SPACE] # expands to `a[CURSOR]b % c%d`
    % a[type xSPACE]b % c%d # cursor moves: `ax b [CURSOR] c %`
    % ax b [type ySPACE] c%d # cursor moves: `ax b y c [CURSOR]`
    % ax b y c [CURSOR]
  3. If your expansions have %, consider changing ABBR_LINE_CURSOR_MARKER to %ABBR_CURSOR% or similar

Acknowledgments