zsh fix tab completion
This commit is contained in:
parent
729fbba9b2
commit
51f26be68b
2 changed files with 8 additions and 5 deletions
|
|
@ -17,14 +17,17 @@
|
|||
aliases = { ll = "ls -alF"; };
|
||||
extraAfter = ''
|
||||
function rsydn-accept-autosuggest-or-complete() {
|
||||
if [[ -n "''${POSTDISPLAY:-}" ]]; then
|
||||
zle autosuggest-accept
|
||||
else
|
||||
local original_buffer=$BUFFER
|
||||
local original_cursor=$CURSOR
|
||||
zle autosuggest-accept 2>/dev/null
|
||||
if [[ $BUFFER == "$original_buffer" && $CURSOR -eq $original_cursor ]]; then
|
||||
zle expand-or-complete
|
||||
fi
|
||||
}
|
||||
zle -N rsydn-accept-autosuggest-or-complete
|
||||
bindkey '^I' rsydn-accept-autosuggest-or-complete
|
||||
for keymap in main viins; do
|
||||
bindkey -M "$keymap" '^I' rsydn-accept-autosuggest-or-complete || true
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ in {
|
|||
autosuggestion.enable = cfg.enableAutoSuggestion;
|
||||
syntaxHighlighting.enable = cfg.enableSyntaxHighlighting;
|
||||
shellAliases = cfg.aliases;
|
||||
initExtra = cfg.extraAfter;
|
||||
initContent = lib.mkAfter cfg.extraAfter;
|
||||
};
|
||||
}
|
||||
{ programs.zsh.initContent = lib.mkOrder 550 cfg.extraBeforeCompInit; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue