-
Notifications
You must be signed in to change notification settings - Fork 96
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
Improve completion descriptions #133
base: master
Are you sure you want to change the base?
Conversation
|
How can I do that ? it seems that the colors are getting escaped when I try to insert some inside the completion fzf_tab_compadd_hook() {
# $expl - explicit group name
# $__hits - list of orginal completions
# $__dscr - list of transformed and described completions
# $PREFIX - text that already got completed before
# (grep "\b$expl" ~/.config/clisnippets)
case $_fzf_tab_curcontext in
# All context
(*)
# Line by line icon assignements
for i in {1..$#__hits}; do
word=$__hits[i] dscr=$__dscr[i]
if [[ -n $dscr ]]; then
dscr=${dscr//$'\n'}
elif [[ -n $word ]]; then
dscr=$word
fi
case "$expl" in
(*) icon="" ;;
esac
icon="$icon "
RED='\033[0;31m'
NC='\033[0m' # No Color
__dscr[i]="${RED}$icon $dscr"
done
;;
esac
}
|
You need to use $'\033[0m' |
e5fd6eb
to
70536f0
Compare
Hello, I saw that this wasnt merged and Im still using the modified branch, I managed to do most of what I aimed for, beside color that did not work. However I found out you rewrote it all in C. Here is what I have at the moment on https://github.com/adelin-b/fzf-tab/tree/improve_completion_description It is on the old code so It might get me a while to move it to C. Maybe you already implemented the way to do it exposing different variable name? |
Oh sorry I haven't implement it in C. I will take a look at it in these days. |
Following #127
This add an hook to be able to enrich the description of completion
Icons
Git status
What is left to do
$__dscr
they get escaped no matter whatSo I can do something like
instead of
git checkout <TAB>
and have the stringgit checkout
somewherethis is to match against a custom snippets file and would work a bit like bit https://github.com/chriswalz/bit but with all completion (like a real ide snippet !)