Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snippets for zsh-autosuggestions and zsh-syntax-highlighting #20

Closed
z0rc opened this issue Aug 14, 2020 · 5 comments
Closed

snippets for zsh-autosuggestions and zsh-syntax-highlighting #20

z0rc opened this issue Aug 14, 2020 · 5 comments

Comments

@z0rc
Copy link

z0rc commented Aug 14, 2020

Not really an issue. I noticed you have TODO items about autosuggestions and highlighting. Here are snippets I use to with zsh-autosuggestions and zsh-syntax-highlighting to better work with zsh-abbr. Hopefully they might be useful for you.

Enable regexp highlighter and add pattern that matches abbreviations as 'words' to highlight them as you like.

ZSH_HIGHLIGHT_HIGHLIGHTERS=(main regexp)
# highlight known abbreviations
typeset -A ZSH_HIGHLIGHT_REGEXP
# regexp matches abbreviations only when they standalone word, but not part of other words
ZSH_HIGHLIGHT_REGEXP+=('(^| )('${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}}')($| )' 'fg=blue')

Disable showing autosuggestion after abbreviations. Also I don't think autosuggesting the abbreviations make much sense as they are usually just 2-3 symbols.

# Don't show suggestions after abbreviations
ZSH_AUTOSUGGEST_HISTORY_IGNORE=${(j:|:)${(k)ABBR_REGULAR_USER_ABBREVIATIONS}}
ZSH_AUTOSUGGEST_COMPLETION_IGNORE=${ZSH_AUTOSUGGEST_HISTORY_IGNORE}
@z0rc z0rc changed the title Autosuggestions and highliting Autosuggestions and highlighting compatibility Aug 14, 2020
@olets
Copy link
Owner

olets commented Aug 18, 2020

Thanks for sharing! This is cool stuff. I'll think about how best to draw other people's attention to the snippets. Will leave this open to remind myself

I don't think autosuggesting the abbreviations make much sense as they are usually just 2-3 symbols.

Haha yes definitely :) I mean highlighting for things like abbr add etc, the app command completions.

@olets olets changed the title Autosuggestions and highlighting compatibility snippets for zsh-autosuggestions and zsh-syntax-highlighting Aug 23, 2020
@olets olets pinned this issue Aug 23, 2020
@olets olets closed this as completed Aug 23, 2020
@olets olets unpinned this issue Oct 26, 2020
@olets
Copy link
Owner

olets commented May 16, 2024

Belatedly recognizing all contributors in https://github.com/olets/zsh-abbr#community and https://zsh-abbr.olets.dev/community/. Would you like to be added @z0rc?

@z0rc
Copy link
Author

z0rc commented May 16, 2024

@olets sure, thanks!

@olets
Copy link
Owner

olets commented May 16, 2024

@all-contributors please add @z0rc for doc

Copy link
Contributor

@olets

I've put up a pull request to add @z0rc! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants