Do you use my software on a regular basis? Please consider sponsoring me. ๐
To advertise with me or get in touch with me otherwise, please open an issue here.
๐ค Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
License: MIT License
Do you use my software on a regular basis? Please consider sponsoring me. ๐
To advertise with me or get in touch with me otherwise, please open an issue here.
Hi,
Thanks for your work on this plugin. I cannot get the expansion to work using ctrl space as I get this error message:
_autocomplete.expand-or-complete.zle-widget:43: maximum nested function level reached; increase FUNCNEST?
_p9k_widget_zle-line-pre-redraw:43: maximum nested function level reached; increase FUNCNEST?
For example, ctrl-space alone works (directory selection) but vim (space) ctrl-space shows the error.
Vim ** then ctrl-T works as ctrl-space should.
Here are the FZF options:
FZF_COMPLETION_TRIGGER='**'
FZF_DEFAULT_COMMAND='ag --hidden --ignore-dir /RetroPie/ -g ""'
FZF_DEFAULT_OPTS='--bind=ctrl-space:abort,ctrl-k:kill-line'
Is there something I'm missing?
Just doing cd /etc/
does not prompt me with any suggestions, even when pressing tab.
Works fine when disabling the plugin.
2nd problem (did not want to open another issue for that only):
Just type cp x y
then use the arrows to go back to the beginning of the line.
Then add sudo
and press space to add a real space : the cp
disappears.
Precision: I have cp
aliased to cp -i
Hey,
First off - amazing plugin. Seeing this on reddit yesterday made me decided to refresh my zsh setup & install this plugin.
I have an issue (which I have fixed locally, so no rush) which is that the keybindings, eg:
key[Down]='^[[B'
don't correspond to what my terminal feeds in. For each of down, up, left, right, I had to swap the second '[' for a capital O. Not sure why this is the case.
fzf has some special completions defined (see completion.zsh), e.g. for "kill -9 [TAB]" it uses ps to list the processes. With zsh-autocomplete that list is broken.
This plugin requires that fzf
(and accompanied ~/.fzf.zsh
) must precede zsh-autocomplete
.
Though it was mentioned in README, I don't think it was not emphasized enough. It would be great to have a fool-proof feature such that if an user have wrong ordering in their zshrc, a warning message would be printed (or disable the plugin).
Otherwise it would mess up everything: for example, any keypress of <TAB>
will ALWAYS invoke fzf, make the shell almost unusable.
Hello,
Upon first installation, this plugin runs like a dream. Rebooting my terminal (I'm using Kitty), there is very erratic behavior. It's almost like the it's stuck in a hotkey mode. For example:
I want to type "sudo".
S: Just fine
u: is ignored (letter is not typed)
d: "do you want to display all 348 results?
o: same as above
spacebar: same as above.
I'm guess it's mistaking each key press for tab? Sorry if this doesn't make sense...I don't know a better way to explain it.
Running Kubuntu 20.04.
Not able to cd to a directory without cd, permission denied.
Without plugin.
tanish@us01:tanish/tanish_main1
โถ IOR
tanish/tanish_main1/IOR
With plugin.
tanish@us01:tanish/tanish_main
โถ IOR
zsh: permission denied: IOR
When I use git
and do stuff like adding a remote or clone from remote, when start to type the https
or ssh
location, the input becomes super slow. Often does nothing happen anymore and then all keystrokes are applied at once. This happens always and is quite annoying. Can I disable that? I don't necessarily need completion for the remote location paths.
This plugin's immediate auto-expansion of history expansions causes the latter to be mostly unusable. Some examples are detailed below. The overarching theme is that history expansions should only be auto-expanded if they are unambiguous, where "ambiguous" is meant in the sense that the already typed history expansion could possibly be altered by further characters that have yet to be typed.
Such yet-to-be-typed characters could add a word designator (e.g. :1
after !!
), alter a word designator (e.g. -2
after !:1
), or add modifiers (e.g. :a
after !$
). Generally speaking, it is unknown whether a history expansion has been fully typed unless it uses the !{โฆ}
form or until a character is typed that does not further alter the expansion.
Perhaps a more usable approach would be to nix the current behavior and instead perform history auto-expansion as part of magic-space
and/or a separate expand-under-the-cursor key-binding.
!-2
If I want to expand the second-to-last command (or any part of it, using additional word designators), I would normally type !-2
. However, history auto-expansion is invoked immediately after typing !-
, which obviously fails, thereby causing the !
to be deleted, leaving the command line as if one had only typed -
.
Of course, this problem applies likewise to any other intended event designator of the form !-n
.
!:1-2
If I want to insert the first two arguments of the last command, I would normally type !:1-2
or, equivalently, !!:1-2
or !-1:1-2
. However, history auto-expansion is invoked immediately after typing !:1
or !!
or !-
, in all cases preventing the possibility of typing what was intended.
Numerous other examples can be found that follow this pattern, whereby one intends to use other word designators and/or history expansion modifiers. In all cases, the intended expansion is made impossible by premature auto-expansion.
!#:1
If I want to reference the first argument of the currently-being-typed command, I would normally type !#:1
. However, history auto-expansion is invoked after typing !#
, thus expanding to the entire already-typed command (up to the previous word, inclusive).
I use this plugin combined with zsh-autosuggestions. I observed that since using this plugin the highlighting for the autosuggestion flickers. So while typing I see as usual the autosuggestion command in the configured color (usually kinda decent colored). But then it starts to flicker. So it looks like a regular command. It becomes hard to tell that I not simply accepted this suggestion. Continue to type often restores the actual highlighting.
I must admit that my knowledge of all the background is minimal. So I wonder if you maybe have an idea why this happens. I can confirm that if I disable this plugin here temporally, the highlighting works fine.
The plugin isn't the right place to change setopts, especially something like AUTO_CD and BEEP.
Please use LOCAL_OPTIONS or even emulate -L zsh
, so you can explicitly define needed option in functions without touching user configuration.
Installing plugin seem to mess with zsh options about case insensitive completions. It would be great if user could decide about this feature in personal configuration or better yet if it could be done old way with plain zsh functionality. Perhaps it is possible, but i couldn't figure it out. Not sure if it's a bug or is it simply not implemented.
Maybe it's the matter of command order in zsh dotfiles? Many plugins have specific rules about that.
I'm using this plugin along with zsh-autosuggestions, zsh-completions, zsh-syntax-highlighting and fzf and i don't have any manager.
when running a command like which fzf (might be with any command), no shell function 'zle-line-finish' exists flashes up then is erased and a blank prompt comes up. I have turned off my whole init file then back on, the behavior persists.
On every prompt I get
_zsh_autosuggest_highlight_reset:3: maximum nested function level reached; increase FUNCNEST?
Here is my zshrc
fpath=($fpath "$ZDOTDIR/plugins/pure")
promptinit
prompt pure
source "$ZDOTDIR/plugins/syntax-highlighting/zsh-syntax-highlighting.zsh"
source "$ZDOTDIR/plugins/autosuggestions/zsh-autosuggestions.zsh"
source "$ZDOTDIR/plugins/autocomplete/zsh-autocomplete.zsh"
If I set prompt after sourcing autocomplete all is ok
This occurs whenever I source my ~/.zshrc with this plugin
โฏ zshreload
_autocomplete.add-zsh-hook:1: job table full or recursion limit exceeded
๏ ๎ฐ ๏ ~ ๎ฐ ๎ฒ โ ๎ฒ 12:59:36 ๏
๏ ๎ฐ ๏ ~ ๎ฐ e_main_complete:208: command not found: 3174 ๎ฒ โ ๎ฒ 12:59:39 ๏
_main_complete:208: command not found: 3174
_main_complete:208: command not found: 3174
_main_complete:208: command not found: 793
_main_complete:208: command not found: 793
_main_complete:208: command not found: 793
_main_complete:208: command not found: ''
_main_complete:208: command not found: ''
_main_complete:208: command not found: ''
e_main_complete:208: command not found: 3174
_main_complete:208: command not found: 3174
_main_complete:208: command not found: 3174
_main_complete:208: command not found: 793
_main_complete:208: command not found: 793
_main_complete:208: command not found: 793
_main_complete:208: command not found: ''
_main_complete:208: command not found: ''
_main_complete:208: command not found: ''
e
My .zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/shash/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="powerlevel10k/powerlevel10k"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
#CASE_SENSITIVE="true"
#complete setup zsh | source /dev/stdin
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to automatically update without prompting.
# DISABLE_UPDATE_PROMPT="true"
# Uncomment the following line to change how often to auto-update (in days).
export UPDATE_ZSH_DAYS=1
# Uncomment the following line if pasting URLs and other text is messed up.
# DISABLE_MAGIC_FUNCTIONS=true
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
#source /usr/share/fzf/completion.zsh
#source /usr/share/fzf/key-bindings.zsh
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
zsh-syntax-highlighting
git
fzf
zsh-autosuggestions
zsh-autocomplete
docker
npm
yarn
history-substring-search
zsh-completions
encode64
pip
pyenv
python
sudo
autoupdate
)
source $ZSH/oh-my-zsh.sh
export QT_QPA_PLATFORMTHEME=qt5ct
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
export LANG=en_GB.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
alias weather="curl wttr.in/Cardiff"
alias zshreload="source ~/.zshrc"
#export EDITOR="nano"
# Completion for kitty
kitty + complete setup zsh | source /dev/stdin
#autoload -Uz compinit
#compinit
autoload -U compinit && compinit
# Import colorscheme from 'wal' asynchronously
# & # Run the process in the background.
# ( ) # Hide shell job control messages.
#(cat ~/.cache/wal/sequences &)
# Alternative (blocks terminal for 0-3ms)
#cat ~/.cache/wal/sequences
# To add support for TTYs this line can be optionally added.
#source ~/.cache/wal/colors-tty.sh
(cat $HOME/.config/wpg/sequences &)
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
As mentioned in #28 by @weilbith,
In the latest update has problem where
_autocomplete.async-list-choices:30: command not found: zpty โโฏ _autocomplete.async-list-choices:31: command not found: zpty
floods the console
I, also I should note that it doesn't actually prevent you from typing commands so you can just enter another shell and resolve the issue temporarily by rolling back the update.
Failing that you can always switch to another user and change the shell/sudo.
How do I switch to default Tab behaviour while using cd i.e. togge between the options rather than insert all the options
Typing one character results in a horrible list of suggestions that flashes briefly at the start of every command
It's a minor grievance, but this flash looks pretty ugly and is a little annoying. I strongly suspect no one types one character and then auto-completes anyway, unless they use some kind of auto-cd feature.
An option to disable suggestions until for instance two characters or space has been typed could stop this ugly suggestion flood.
It doesn't need to be very sophisticated and edge cases like type two characters
-> erase one
could just be ignored, it's mostly the initial flash at every command that annoys me.
To repoduce:
"ls [Ctrl+Space]"
-> _autocomplete.async_callback:11: bad math expression: illegal character: '
Minimal .zshrc to repoduce:
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}โโโ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})โฆ%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" &&
print -P "%F{33}โโโ %F{34}Installation successful.%f%b" ||
print -P "%F{160}โโโ The clone has failed.%f%b"
fi
source "$HOME/.zinit/bin/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
source /usr/share/fzf/shell/key-bindings.zsh
zinit load marlonrichert/zsh-autocomplete
Not sure if it will actually improve performance, since of all the completion code, it's the calls to compadd
that cause the most overhead, and those need to happen in the main thread, to update the completion menu. I already tried it once and didn't succeed. However, the automatic list-choices
code is quite a bit different now than originally. So, I might try to give it another go at some point.
The approach of defining bindkeys using escape sequences is inherently flawed, it's not possible to match all terminal emulator behaviors.
Instead please use zsh/terminfo
module. http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fterminfo-Module and https://wiki.archlinux.org/index.php/zsh#Key_bindings
Also while we're at it. Please provide option to skip key binds in plugin and let user to define them by their own preference.
Hey ๐
Thanks again for your continuous work. Especially the asynchronous feature makes this plugin a must-have! Unfortunately it does not work anymore for me. Which means it does not appear automatically anymore, but I must trigger the suggestions manually with tab
again. Note that I configured the plugin to use tab
and also do the suggestions appear grouped, as I also configured for this plugin. So the plugin is still there and somehow working. But not automated anymore.
So my local version is on commit 0260d55 which is the HEAD@master
here on GitHub for the moment. I tried to do a minimized setup, but this fails already. So how do I try to achieve a minimal testing environment for reproducibility:
> zsh -d -f # zsh without any configuration
host% source $XDG_CACHE_HOME/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-marlonrichert-SLASH-zsh-autocomplete/zsh-autocomplete.plugin.zsh
host% fpath+=($XDG_CACHE_HOME/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-marlonrichert-SLASH-zsh-autocomplete)
host% cd ~/ # expect auto completion here
Of course can the location of the plugin differ. Since I use antibody
as my zsh plugin manager that's how it looks for me. Anyways I load the plugin manually here, doing the same as antibody
would do. The point is, that already the source
command fails with the error message (eval):1: _autocomplete.add-zsh-hook: function definition file not found
. I guess that's bad. ๐
So if we could make it to fix this minimized setup, then I could continue to checkout if something else in my custom setup affects this problem.
Thank you so much in advanced. I want to experience the asynchronous completion
myself!!!!
I'm using the tool fasd to access frequently used directories and files faster without providing the full path. If I use the fasd
command directly, I get beautifully auto-completion of its results while I type. It would be awesome if I could get these candidates as another group in the completion menu when using cd
for directories and files for an editor like vim
or similar commands.
Currently I have a mapping that I need to trigger manually. It calls fzf
with the list of currently available results by fasd
for the current input text. I then filter the results in fzf
, select and entry, get back to the command line and then continue.
Could be improved...
This plugin is awesome. So is fasd
. Hope to get them combined on a new level. ๐
Matches are presented in lexicographical order with no regard to the accuracy of the matches.
I would expect suggestions starting with my input to be prioritized over a match in a substring.
This interferes with the behavior of the tab key, as compared to in the normal shell experience. I would expect tab to first insert perfect matches starting with what I've typed, and not the first match in lexicographical order.
Steps to reproduce:
โ cat test
atestfile testfile
\t
โ cat atestfile
Expected behavior:
โ cat test
testfile atestfile
\t
โ cat testfile
I've probably some misconfiguration because I get some really annoying result when typing ls
or cd
: it stops after the first char asking if I want to see all the gazillions of possible completions. And of course it blocks.
_zshrc.txt
_zsh_aliases.txt
As soon as I type there is a message zsh: do you wish to see all 3121 possibilities (3121 lines)?
. Perhaps this is set from Oh-my-zsh. It causes problems because it eats keystrokes when typing. Is there a way to disable it?
First of all, thanks for the amazing completion experience with this plugin!
I'm trying this out now and found out it exports $FZF_*
environment variables which override my customisations to fzf. I'm wondering why is it doing so and if it's needed โ maybe it can be scoped to the plugin's usage of fzf somehow?
Hidden files are ignored or downprioritized by auto-suggest. Typing the name of a dotfile will match that part against substrings in other filenames, but not exact matches of dotfiles.
Steps to reproduce:
โ touch .test file.test
โ rm .tes
file.test
โ \t
โ rm file.test
Expected:
โ touch .test file.test
โ rm .tes
.test file.test
โ \t
โ rm .test
Hi, I fail to change any directories without "cd"
โฏ source ~/.oh-my-zsh/custom/plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
โฏ ~
zsh: permission denied: /home/user
โฏ cd ~
...
Is there any thing wrong with my operations, or is this a bug?
Because zsh-autocomplete sets zstyle ':zle:up/down-line-or-beginning-search' leave-cursor no
, it is awkward to use with up/down arrow keys bound to history-substring-search-up/down
. When typing the up arrow, the cursor does not move to the end of the line.
% zsh -df
% source path/to/zsh-autocomplete.plugin.zsh
% autoload up-line-or-beginning-search
% zle -N up-line-or-beginning-search
% autoload down-line-or-beginning-search
% zle -N down-line-or-beginning-search
% bindkey "^[OA" up-line-or-beginning-search
% bindkey "^[OB" down-line-or-beginning-search
% zโ
Some way of getting prefix history search to move the cursor to the end of line while still working with zsh-autocomplete.
Setting zstyle ':zle:up/down-line-or-beginning-search' leave-cursor yes
does not work, because after pressing up once, the search prefix (apparently) becomes the whole line.
% zstyle ':zle:up-line-or-beginning-search' leave-cursor yes
% bโโ
The video that's currently in the Readme doesn't accurately reflect the latest behavior. I will create a new one when I have time.
Just some new ideas to make this plugin even better as it is already.
I like to use the group option for the suggestion menu (disabled by default, zstyle ':autocomplete:*' groups 'always'
). It looks more nice (personal opinion) and makes it more structured, understanding the suggestions even faster. The point is: sometimes I like to redorder the groups or jump between them. I must admit that I'm not too sure about the order I would like to set, but I would really appreciate the option to change it and tweak it over time, until I it works the best for me. So maybe sort directories over files is more convenient for my daily work. Not sure.
Nevertheless if I would find a good sort order, it would be absolutely awesome if I could jump between the groups. Continuing with the simple example of directories and files. And I know that I want to complete a directory, then I have to first iterate over all suggested files. Rather I would jump to the next group and then iterate through them. Maybe you are limited by zsh, I don't know. Maybe this is already natively supported and you must just teach us.
No matter the result, I love the plugin and every new feature makes it just a bigger work boost for a daily shell enthusiast.
Any keybindings user places in their own .zshrc (or elsewhere) will be overwritten by _zsh_autocomplete_init
.
This makes it difficult to unbind undesired widgets, like magic-space
for instance.
Awesome work you are doing, not a real issue but an improvement suggestion which would benefit the plugin I guess.
I noticed that when I type sudo apt install
, and then the first 2 to 5 first letters of a package, the completion is really slow (which is normal, lots of packages exists).
The issue is that the input is lagging and therefore I cannot see what I type in real time, I have to wait a bit to check what I wrote.
This might be related to #17 and #24 , for the async part.
(btw I tried disabling completion for apt but did not succeed)
/usr/share/zsh/functions/Completion/Unix/_apt
zstyle ':completion:(correct-word|list-choices):*:(pacman|trizen):argument-rest:*' tag-order "! argument-rest" "-"
Would be neat to enable async list-choices for a few commands though :) for those heavy completion cases.
This must have changed at some point today since I updated the plugin this evening, but when pressing the up arrow to attempt to cycle through my history, the terminal window closes instead.
On OSX using both iTerm and the terminal bundled with rubymine.
My .gitconfig
uses tabs for indentation, and contains a multiline alias (for git push-status
). Because of this, the autocomplete menu item for git push-status
contains a tab and zsh-autocomplete does not cut off the entry before the end of line.
Steps to reproduce the behavior:
% zsh -df
% source path/to/zsh-autocomplete.plugin.zsh
% cat <<. >>~/.gitconfig
[alias]
# Show the status of this branch relative to @{push}.
# When copying from the GitHub issue, be sure to replace those eight spaces with a tab character. :-)
push-status = "! push_branch=$(git push-branch 2>/dev/null) || { echo \"No push branch set.\" && exit 0; } \
; both=$(git rev-list --left-right --count HEAD...@{push}) \
; [[ $both == '0 0' ]] && echo \"Your branch is up to date with push branch $push_branch.\" \
|| echo \"Your branch is ${both%% *} commit(s) ahead and ${both##* } commit(s) behind push branch $push_branch.\" #"
.
% git push-sta| <-- cursor
The autocomplete menu to be rendered correctly.
๏ ~ ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ๏ 10:32:01
โฏ git sta
ingit sta
push-status alias for '! push_branch=$(git push-branch 2>/dev/null) || { echo "No push branch set." && exit 0; } ; both=$(gi
stash stash away changes to dirty working directory
status show working-tree status
I am actually not sure how to determine the line length in the case of tabs. So maybe this is an unsolvable problem and the answer is "just don't use tabs in your .gitconfig in combination with multiline aliases".
Hey,
thanks for your contentiously great work. Your recent contribution make this plugin a real pleasure for daily work!
This issue here is nothing big and does not hinder the daily work. It includes two parts. But they are both pretty small and somewhat related, so I decided to make both into one.
The first are the path completion candidates ./
and ../
. When the last typed character for a path is a slash, these two candidates are always there. They are annoying, because they are at the top of the list and must be jumped over to get to the "actual" candidates. Especially when your path reaches a directory with only files, the only two remaining candidates are these two. I would argue that they add no value and are more confusing and annoying than helpful.
The second issue is that if I type a "invalid" path, I get red text. If I for example cd
and type a directory name wrong, I see in red letters local directory
. When I do something with a path that does intentionally not exist yet, it is even worse. So in zsh
typing take /tmp/new_test
will show me three red lines with file
, directory
, file or directory
.
Could you maybe elaborate why it is like this and discuss about solutions? Would
be amazing. ๐
I would like to be able to customize the messages that zsh-autocomplete
outputs. In particular, I would like to make the outputs extremely terse so they produce minimal visual distraction, although this would obviously be bad UX for new users.
I think it would be nice if the messages were customizable via zstyle
.
Current behavior :
When too much suggestions, nothing is displayed. Pressing tab enables a partial list of suggestions.
Proposition :
Add a message to notify user that there is actually some suggestions but too much to fit in screen.
Something like "Too much (X) items to display."
My thoughts :
This plugin always almost displays something so it felt weird having no information on current directory content for the use case cd /usr/share/
which had a lot of stuff inside.
Current behavior:
Height size of suggestions list seems to be pre-determined (I suppose as a function of the terminal height) and is quite big.
Proposition :
Enable custom height of suggestions list via zstyle.
Might be a percent of terminal height, or absolute but it might be easier to implement percent.
My thoughts :
As of personnal preference, It would be great to set height of list to like 50% of terminal height so I can see more of my command history when the suggestion list is long.
Current behavior :
Same as thought 1 : When too much suggestions, nothing is displayed. Pressing tab enables a partial list of suggestions.
Proposition :
(Could be an option to enable)
Display a partial list of suggested items with a bottom line saying that there is more which is not displayed.
My thoughts :
Well I went into this plugin to have suggestions at all time and sometimes my terminal is too small or there is too much items to display, but I wish I add suggestions anyway.
Let's hear other users thoughts on this and tell me if something is unclear !
This isn't so much a bug report as it is a feature request: would it be possible to have groups and autodescriptions enabled by default as opposed to having to press shift+tab each time?
An option to have it always turned on would work too
I use vi mode and have my prompt set up for it accordingly. Here's the relevant code:
function zle-keymap-select {
if [[ ${KEYMAP} == vicmd ]] ||
[[ $1 = 'block' ]]; then
echo -ne '\e[2 q'
elif [[ ${KEYMAP} == main ]] ||
[[ ${KEYMAP} == viins ]] ||
[[ ${KEYMAP} = '' ]] ||
[[ $1 = 'beam' ]]; then
echo -ne '\e[6 q'
fi
}
zle -N zle-keymap-select
zle-line-init() {
echo -ne "\e[6 q"
}
zle -N zle-line-init
echo -ne '\e[5 q' # Use beam shape cursor on startup.
preexec() { echo -ne '\e[6 q' ;} # Use beam shape cursor for each new prompt.
What this does is change the cursor from beam to block depending on the mode (beam for insert, block for normal)
If i run bindkey "^I"
with that block present, i get "^I" fzf-completion
as a result. If i remove it, bindkey "^I"
prints "^I" complete-word
.
My steps for tracking this down were creating a minimal .zshrc that only sourced fzf and the plugin, and then re-adding everything back little by little.
I'm really enjoying this plugin; thanks for your hard work and continued attention!
As a suggestion, it would be nice to simplify the customization options using ENV
variables set in a user's .zshrc
file (likely before sourcing zsh-autocomplete
). Some recommended variable names:
export ZSH_AUTOCOMPLETE_ALWAYS_SHOW_GROUP_NAMES=true
export ZSH_AUTOCOMPLETE_AUTO_CORRECT_SPELLING=true
export ZSH_AUTOCOMPLETE_CYCLE_WITH_TAB=true
export ZSH_AUTOCOMPLETE_NAVIGATE_WITH_TAB=true
I could see the last two conflicting with one another, but that could be called out in the README.md
.
Hey,
thanks again for this plugin! ๐
I use it now just my second day, but what really bothers me are the lags. This is especially the case for paths. Each time I enter a slash it starts to lag. I guess this will apply for all completions that are not optimized or simply slow.
I must admit I have rarely a knowledge of such things in Zsh, but is is possible to do asynchronous completion? As much as I like this plugin: this is a no-go for me at the moment. Maybe I need to disable completion sources that are slow. I don't know.
Currently, it automatically accepts the completion when there are completions (automatically) being shown.
Say we want to type for a in 0 1 2; do
. There is a.py
that is file suggestion.
โฏโฏโฏ for a|
a.py
Pressing space here, it will accept the completion:
โฏโฏโฏ for a.py |
a.py bin/ etc/ ...(more)
which should not be the case.
This is some really cool work. Thanks for sharing it!
The fzf search menu no longer seems to pop up when the trigger sequence is used when zsh-autocomplete is enabled, even when using the new shortcutโcontrolโฃ.
Steps to reproduce the behavior:
% zsh -df
% [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
% cat dir/** [TAB]
>
3/3
> dir/file1.txt
> dir/file2.txt
> dir/file3.txt
% source ~/dir/dir/zsh-autocomplete.plugin.zsh
% cat dir/** [CTRL][SPACE]
file1.txt file2.txt file3.txt
Of course, this fixes itself if I run zstyle ':autocomplete:tab:*' completion fzf
. tab is now controlled by fzf, and the trigger sequence **
works as expected. But then normal autocomplete seems broken at that point.
I thought controlโฃ (with zsh-autocomplete) would trigger the kind of behaviour fzf would trigger by hitting tab normally (without zsh-autocomplete).
Just cloned this repo and added it to my zsh config (with oh-my-zsh).
All seems to work fine (I don't have fzf installed), except the Down arrow key that has no effect. So I basically have no opportunity to navigate through proposals.
I tried commenting all my other zsh plugins but same issue.
My zshrc : here.
Also it would be nice to be able to enable/disable some key bindings.
For example I would gladly disable the Tab that selects first choice to keep the zsh behavior of hitting Tab twice to enter the suggestion grid.
When I try to install it using zinit like this
zinit ice wait'2'
zinit load marlonrichert/zsh-autocomplete
I get this error
/Users/klas.mellbourn/.zinit/plugins/marlonrichert---zsh-autocomplete/zsh-autocomplete.plugin.zsh:87: key: assignment to invalid subscript range
I'm on commit b0edf5c
when running a command like which fzf (might be with any command), no shell function 'zle-line-finish' exists flashes up then is erased and a blank prompt comes up. I have turned off my whole init file then back on, the behavior persists.
I am seeing this error when almost every command I run right now. Mostly seems to be shell built ins though actually.
_autocomplete.async-list-choices:6: can't clobber parameter _autocomplete__async_fd containing file descriptor 25
zsh 5.8 (amd64-portbld-freebsd12.1
FreeBSD fluffy.lan 12.1-STABLE FreeBSD 12.1-STABLE r361783 GENERIC amd64
Using zimfw for my zshrc setup
I don't like that behavior myself, but it seems to confuse some novice Zsh users that menu selection is started only when the content does not fit on screen.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.