zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
20k stars 1.33k forks source link

How to highlight the whole buffer #927

Closed blueray453 closed 1 year ago

blueray453 commented 1 year ago

I am trying to use ctrl+a to highlight the whole buffer.

Here is my zle widget.

autoload -Uz region_highlight
zle -N region_highlight

_ctrl-a() {
  ((CURSOR = 0))
  ((MARK = $#BUFFER))
  zle region_highlight
}

zle -N _ctrl-a
bindkey '^A' _ctrl-a # Ctrl+A

When i press ctrl+a , it says _zsh_autosuggest_invoke_original_widget:9: region_highlight: function definition file not found

What is the issue here?

phy1729 commented 1 year ago

This isn't really a zsh-syntax-highlighting question, but region_highlight is an array in ZLE widgets not a function. For further questions on ZLE widgets, you might try the users mailing list or the IRC channel on libera.