Open goschevski opened 4 years ago
Abbreviations doesn't seems to be working. This was working earlier.
Typing gcam<space> should expand to git add -A && git commit -m "
gcam<space>
git add -A && git commit -m "
I does nothing. :D
typeset -Ag abbreviations
abbreviations=( "gcam" "git add -A && git commit -m \"" )
magic-abbrev-expand() { local left prefix left=$(echo -nE "$LBUFFER" | sed -e "s/[_a-zA-Z0-9]$//") prefix=$(echo -nE "$LBUFFER" | sed -e "s/.[^_a-zA-Z0-9]([_a-zA-Z0-9]*)$/\1/") LBUFFER=$left${abbreviations[$prefix]:-$prefix}" " }
no-magic-abbrev-expand() { LBUFFER+=' ' }
zle -N magic-abbrev-expand zle -N no-magic-abbrev-expand bindkey " " magic-abbrev-expand bindkey "^x " no-magic-abbrev-expand
2. Source .zpreztorc 3. Type gcam<space> ### Versions - Prezto commit: 3423856 - ZSH version: zsh 5.7.1 (x86_64-apple-darwin19.0) - OS information: macOS Catalina (10.15.3)
Couldn't repro on:
Description
Abbreviations doesn't seems to be working. This was working earlier.
Expected behavior
Typing
gcam<space>
should expand togit add -A && git commit -m "
Actual behavior
I does nothing. :D
Steps to Reproduce
abbreviations=( "gcam" "git add -A && git commit -m \"" )
magic-abbrev-expand() { local left prefix left=$(echo -nE "$LBUFFER" | sed -e "s/[_a-zA-Z0-9]$//") prefix=$(echo -nE "$LBUFFER" | sed -e "s/.[^_a-zA-Z0-9]([_a-zA-Z0-9]*)$/\1/") LBUFFER=$left${abbreviations[$prefix]:-$prefix}" " }
no-magic-abbrev-expand() { LBUFFER+=' ' }
zle -N magic-abbrev-expand zle -N no-magic-abbrev-expand bindkey " " magic-abbrev-expand bindkey "^x " no-magic-abbrev-expand