sorin-ionescu / prezto

The configuration framework for Zsh
MIT License
13.99k stars 4.49k forks source link

Abbreviations doesn't seems to be working. #1828

Open goschevski opened 4 years ago

goschevski commented 4 years ago

Description

Abbreviations doesn't seems to be working. This was working earlier.

Expected behavior

Typing gcam<space> should expand to git add -A && git commit -m "

Actual behavior

I does nothing. :D

Steps to Reproduce

  1. Add this to .zpreztorc
    
    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)
srijanshetty commented 4 years ago

Couldn't repro on: