Open c0deaddict opened 4 years ago
try to <C-x><SPACE>
or <C-x><ENTER>
That works! Thank you :)
@momo-lab <C-x><SPACE>
or <C-x><ENTER>
doesn't work for me. Is there another alternative to avoid expanding an abbreviation?
Please tell me the execution result of the bindkey command. It may be overwriting the settings created by this plugin.
# bindkey | grep "\^X"
"^X^B" vi-match-bracket
"^X^F" vi-find-next-char
"^X^J" vi-join
"^X^K" kill-buffer
"^X^M" accept-line # <- Need this line
"^X^N" infer-next-history
"^X^O" overwrite-mode
"^X^R" _read_comp
"^X^U" undo
"^X^V" vi-cmd-mode
"^X^X" exchange-point-and-mark
"^X " __abbrev_alias::no_magic_abbrev_expand # <- Need this line
"^X*" expand-word
"^X=" what-cursor-position
"^X?" _complete_debug
"^XC" _correct_filename
"^XG" list-expand
"^Xa" _expand_alias
"^Xc" _correct_word
"^Xd" _list_expansions
"^Xe" _expand_word
"^Xg" list-expand
"^Xh" _complete_help
"^Xm" _most_recent_file
"^Xn" _next_tags
"^Xr" history-incremental-search-backward
"^Xs" history-incremental-search-forward
"^Xt" _complete_tag
"^Xu" undo
"^X~" _bash_list-choices
It seems I have the two lines, but I still unable to avoid the expand
$ bindkey | grep "\^X"
"^X^M" accept-line
"^X^R" _read_comp
"^X^S" prepend-sudo
"^X " __abbrev_alias::no_magic_abbrev_expand
"^X." fzf-tab-debug
"^X?" _complete_debug
"^XC" _correct_filename
"^Xa" _expand_alias
"^Xc" _correct_word
"^Xd" _list_expansions
"^Xe" _expand_word
"^Xh" _complete_help
"^Xm" _most_recent_file
"^Xn" _next_tags
"^Xt" _complete_tag
"^X~" _bash_list-choices
There seems to be no problem with the definition of bindkey.
Since abbrev-alias also registers alias gs ='git status'
at the same time, the command equivalent to git status
is executed even if gs<C-x><Enter>
.
This technique only suppresses prompt expanding.
If you want to suppress the registration of alias, there are currently the following workarounds.
abbrev-alias gs ='git status'
unalias gs
If <C-x><Enter>
key expands to the prompt, I can't think of a cause.
Sorry...
The problem with unalias gs
is gs
expand to git status
when a press Enter
or Space
I like the idea of this plugin a lot and want to move change all my aliases to this. However, i'm stuck with one use case. Say i have an abbrev defined like this:
Typing
gs<SPACE>
orgs<ENTER>
will expand the abbreviation, wonderful. But what if I want to run the commandgs
(ghostscript)? Is there a binding that will cancel the attempt to abbreviate?