hchbaw / auto-fu.zsh Goto Github PK
View Code? Open in Web Editor NEW#zsh automatic complete-word and list-choices. Originally incr-0.2.zsh by y.fujii <y-fujii at mimosa-pudica.net>
#zsh automatic complete-word and list-choices. Originally incr-0.2.zsh by y.fujii <y-fujii at mimosa-pudica.net>
Hello,
I receive this random error once in a while.
afu-rhs-protect:15: bad math expression: operand expected at > 0 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 0'
afu-rhs-protect:21: bad math expression: operator expected at 1 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 1 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 1' afu-rhs-protect:21: bad math expression: operator expected at
1 standout...'
--(/etc/trapd00r_configs)---------------------------------------------------------------------------------------------------(pts/20@master)--/etc/trapd00r_configs)---------------------------------------------------------------------------------------------------(pts/20@master)--
c
afu-rhs-protect:15: bad math expression: operand expected at > 1 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 1'
afu-rhs-protect:21: bad math expression: operator expected at 1 underlin...' afu-rhs-protect:15: bad math expression: operand expected at
> 1 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 1' afu-rhs-protect:21: bad math expression: operator expected at
2 standout...'
afu-rhs-protect:15: bad math expression: operand expected at > 1 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 1'
afu-rhs-protect:21: bad math expression: operator expected at none > 1 +...' afu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
1 underlin...'
afu-rhs-protect:15: bad math expression: operand expected at > 2 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 2'
afu-rhs-protect:21: bad math expression: operator expected at 2 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
none > 2 +...'
--(
cd
afu-rhs-protect:15: bad math expression: operand expected at > 2 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 2'
afu-rhs-protect:21: bad math expression: operator expected at 2 fg=green...' afu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
3 standout...'
afu-rhs-protect:15: bad math expression: operand expected at > 2 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 2'
afu-rhs-protect:21: bad math expression: operator expected at none > 2 +...' --(~/etc/trapd00r_configs)---------------------------------------------------------------------------------------------------(pts/20@master)-- cd afu-rhs-protect:15: bad math expression: operand expected at
> 3 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 3' afu-rhs-protect:21: bad math expression: operator expected at
2 fg=green...'
afu-rhs-protect:15: bad math expression: operand expected at > 3 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 3'
afu-rhs-protect:21: bad math expression: operator expected at 4 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 4 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 4' afu-rhs-protect:21: bad math expression: operator expected at
2 fg=green...'
afu-rhs-protect:15: bad math expression: operand expected at > 4 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 4'
afu-rhs-protect:21: bad math expression: operator expected at `4 standout...'
Any thoughts, please?
Thanks
Joe
I have been use oh-my-zag before, a best feature I like is filtering history by prefix. I just need input the incomplete commands and press up arrow, and I could switch in the history that has the same prefix that match I input.
Can auto-fu support this? Sorry from a zsh newbie
初めまして、myuheといいます。
auto-fu.zsh素晴らしいですね。愛用させてもらってます。
ところで当方の環境では、0.0.1.3以降のバージョンで正常に動作しませんでした。
現象としては、postdisplayは表示されるのですが、候補が表示されません。
なお、.zshrcにauto-fu.zshの設定だけしたものでも試してみましたが、改善ありませんでした。
また、コンパイルの有無も関係ないようでした。
0.0.1.2より古いものは問題なく動作しているようです。
当方の環境は
zsh 4.3.10 (i686-pc-linux-gnu)
ubuntu 10.04
です。
以下のように設定しています。
source ~/.zsh/auto-fu.zsh
zstyle ':auto-fu:highlight' input bold
zstyle ':auto-fu:highlight' completion fg=red,bold
zstyle ':auto-fu:highlight' completion/one fg=white,bold,underline
zstyle ':auto-fu:var' postdisplay $'\n-azfu-'
zstyle ':auto-fu:var' disable magic-space
zle-line-init () {auto-fu-init;}; zle -N zle-line-init
Instead of Ctrl-C once ,you have to hit it twice when using auto-fu. Would it be possible that auto-fu traps the event in some way and repropagates it to avoid that ?
Type 'npm' then space and another character. Another of these lines is printed every second
$ npm egrep: empty (sub)expression
egrep: empty (sub)expression
egrep: empty (sub)expression
egrep: empty (sub)expression
egrep: empty (sub)expression
egrep: empty (sub)expression
...
When using auto-fu.zsh with the current git version of zsh (which perhaps will be released soon as zsh-5.0.3), the prompt and command line are printed twice for every command.
I was not able to track whether this is due to a bug of zsh-5.0.3 or due to some changed behaviour of zsh-5.0.3.
Hello,
I could not figure out if this is due to my settings or if everyone sees these messages once in a while?
--()------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(pts/43@master)-- with-afu-region-highlight-saving with-afu-trapint with-afu-zle-rebinding
which sr
which sr
/usr/bin/sr
sr is /usr/bin/sr
sr: /usr/bin/sr /usr/share/man/man1/sr.1.gz
/usr/bin/sr: symbolic link to surfraw' --(~)------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(pts/43@master)-- wafu-rhs-protect:15: bad math expression: operand expected at
> 1 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 1' afu-rhs-protect:21: bad math expression: operator expected at
1 fg=green...' work/
afu-rhs-protect:15: bad math expression: operand expected at > 1 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 1'wget wgetpaste whatis whereis which who whoami wipefs wordforms wordlist2hunspell write wrjpgcom wtpt
afu-rhs-protect:21: bad math expression: operator expected at none > 1 +...' afu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1' where which
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
1 fg=green...'afu-gvars with-afu-magic-insert
afu-rhs-protect:15: bad math expression: operand expected at > 2 + 1' with-afu-magic-insert with-afu-menuselecting-handling with-afu-resume with-afu-trapint-handling with-afu-zsh-syntax-highlighting afu-rhs-protect:18: bad math expression: operand expected at
> 2'
afu-rhs-protect:21: bad math expression: operator expected at none > 2 +...' watchMarketSlow wget what which-command whafu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
2 fg=red,b...'
afu-rhs-protect:15: bad math expression: operand expected at > 2 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 2'
afu-rhs-protect:21: bad math expression: operator expected at 3 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
none > 2 +...'
afu-rhs-protect:15: bad math expression: operand expected at > 3 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 3'
afu-rhs-protect:21: bad math expression: operator expected at 2 fg=red,b...' afu-rhs-protect:15: bad math expression: operand expected at
> 3 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 3' afu-rhs-protect:21: bad math expression: operator expected at
3 standout...'
afu-rhs-protect:15: bad math expression: operand expected at > 3 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 3'
afu-rhs-protect:21: bad math expression: operator expected at none > 3 +...' whiafu-rhs-protect:15: bad math expression: operand expected at
> 3 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 3' afu-rhs-protect:21: bad math expression: operator expected at
3 fg=red,b...'
afu-rhs-protect:15: bad math expression: operand expected at > 3 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 3'
afu-rhs-protect:21: bad math expression: operator expected at 4 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 3 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 3' afu-rhs-protect:21: bad math expression: operator expected at
none > 3 +...'
afu-rhs-protect:15: bad math expression: operand expected at > 4 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 4'
afu-rhs-protect:21: bad math expression: operator expected at 3 fg=red,b...' afu-rhs-protect:15: bad math expression: operand expected at
> 4 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 4' afu-rhs-protect:21: bad math expression: operator expected at
4 standout...'
afu-rhs-protect:15: bad math expression: operand expected at > 4 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 4'
afu-rhs-protect:21: bad math expression: operator expected at none > 4 +...' whicafu-rhs-protect:15: bad math expression: operand expected at
> 4 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 4' afu-rhs-protect:21: bad math expression: operator expected at
3 fg=red,b...'
afu-rhs-protect:15: bad math expression: operand expected at > 4 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 4'
afu-rhs-protect:21: bad math expression: operator expected at 4 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 4 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 4' afu-rhs-protect:21: bad math expression: operator expected at
none > 4 +...'
afu-rhs-protect:15: bad math expression: operand expected at > 5 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 5'
afu-rhs-protect:21: bad math expression: operator expected at 3 fg=red,b...' afu-rhs-protect:15: bad math expression: operand expected at
> 5 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 5' afu-rhs-protect:21: bad math expression: operator expected at
4 standout...'
afu-rhs-protect:15: bad math expression: operand expected at > 5 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 5'
afu-rhs-protect:21: bad math expression: operator expected at none > 5 +...' whichafu-rhs-protect:15: bad math expression: operand expected at
> 5 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 5' afu-rhs-protect:21: bad math expression: operator expected at
5 fg=green...'
afu-rhs-protect:15: bad math expression: operand expected at > 5 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 5'
afu-rhs-protect:21: bad math expression: operator expected at 6 standout...' afu-rhs-protect:15: bad math expression: operand expected at
> 5 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 5' afu-rhs-protect:21: bad math expression: operator expected at
none > 5 +...'
which
Usage:
whereis [options] file
Options:
-f define search scope
-b search only binaries
-B define binaries lookup path
-m search only manual paths
-M define man lookup path
-s search only sources path
-S define sources lookup path
-u search from unusual enties
-V output version information and exit
-h display this help and exit
--(~)------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(pts/43@master)--
wafu-rhs-protect:15: bad math expression: operand expected at > 1 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 1'
afu-rhs-protect:21: bad math expression: operator expected at 1 fg=green...' afu-rhs-protect:15: bad math expression: operand expected at
> 1 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 1' afu-rhs-protect:21: bad math expression: operator expected at
2 standout...'
whafu-rhs-protect:15: bad math expression: operand expected at > 2 + 1' afu-rhs-protect:18: bad math expression: operand expected at
> 2'
afu-rhs-protect:21: bad math expression: operator expected at 2 fg=red,b...' afu-rhs-protect:15: bad math expression: operand expected at
> 2 + 1'
afu-rhs-protect:18: bad math expression: operand expected at > 2' afu-rhs-protect:21: bad math expression: operator expected at
3 standout...'
No such keymap `main afu'
This is my auto-fu.zsh: http://codepad.org/enxoIlVq
At this point my shell becomes unresponsive and I have to kill it.
I am not sure if my below bindkey is causing the issue.
50-bindkeys.zsh:bindkey "ih" vi-cmd-mode
as it probably thinks I am tying ih when typing 'which' quickly. Not sure if that makes sense.
Please let me know if you need more details.
Thanks
Joe
Hello,
I get the below error when I source auto-fu.zsh more than once (while trying out a few things).
with-afu-magic-insert~: maximum nested function level reached
Thanks
Joe
Hello,
When I have auto-fu on, I do not see any output from xtrace and verbose options.
Thanks
Joe
I combine auto-fu with zsh-syntax-highlighting and have customized my own colors with zsh-syntax-highlighting, some of them "bold". Occasionally, it happens that after pressing "enter" the program is started with bold color-mode not being reset. Surprisingly this is somewhat unreproducible, i.e. exactly the same input can lead to bold or normal colors during the program run; usually the colors are not reset if I type very quickly. Not sure whether this is a bug of zsh, zsh-syntax-highlighting, auto-fu, or if it occurs only in the interplay with some other setting of mine. Nevertheless,
echo -en '\e[0m'
at the end of the end of the function(s) $afufun() defined in afu-register-zle-accept-line fixes the issue reliably.
could you please implement the notion of bookmarks for paths which are most frequently used? much more explained here:
fish-shell/fish-shell#1467
I have a function called mcd
:
mcd() { mkdir -p "$1" && cd "$1"; }
When I type mcd
, completion works. But then, when I type <Space>
followed
by any letter, I get a bunch or errors. In this example, I typed mcd h
:
Last login: Sat Oct 5 14:21:40 on ttys000
~ ○ mcd _mtools_drives:3: command not found: mtoolstest
_mtools_drives:3: command not found: mtoolstest
_mtools_drives:3: command not found: mtoolstest
h
I don't know if that is a configuration problem from me or a bug from auto-fu
..
much like google chrome's addr bar and qt's autocompletion. there are many more examples. i've discussed this before here:
fish-shell/fish-shell#1419
It seems that this script does not compatiable with oh my zsh https://github.com/robbyrussell/oh-my-zsh. I got this error when loading.
$ source auto-fu.zsh
Cannot rebind self-insert: user:url-quote-magic
Thanks for hchbaw san's splendid plugin. It works well enough for me.
However, sometimes I don't want to accept the completion and just press enter, but auto-fu does send unaccepted completion to execution. Since the completion is still in gray color, intuitively it should not be sent, at least for an end-user like me.
For example, I want to replace a file with a new one while keeping the old one under another name. Like:
mv new-file .
mv old-file old-file-back
mv new-file old-file*-back # * stands for cursor position, I have typed what I want
# and auto-fu adds what I don't want
# send this line clobbers old-file-back :(
Also, if I want to cd
to a directory, auto-fu will automatically add undesirable subdirectory to the path I type(less harmful than the above case indeed).
Auto suggestion of other shells, notable fish's, does behave like what I want(not sending unaccepted completion). Probably because it is more intuitive.
I'm a terminal zsh-user, but I guess this can be implemented in zle-line-finish, can't it?
I found it can be done in afu+accept-line function by assigning LBUFFER to BUFFER, but I cannot ensure it is free of hassle.
When auto.fu is enable the undo widget stops working. If I type 'thing' and hit undo the 'n' disappears (should be the 'g'), if I hit it again nothing happens.
The readme isn't easiest to read. Could you format it properly?
why auto-fu changes what i type. yes in the background what i have typed is still there and so i have to blind type until auto-fu lets go of the prompt. this is not a sane behaviour. here again google-chrome's address-bar should be the model.
Hello,
I am trying to figure out how to switch between "predict-on"/"predict-off" and auto-fu.
This is my predict-on setting.
autoload predict-on
zle -N predict-off
zle -N predict-on
bindkey '^Z' predict-on
bindkey '^X' predict-off
zstyle ':predict' verbose true
I noticed that I cannot have both predict-on and auto-fu active at the same time.
What do I do to turn-off auto-fu?
Is it possible to have bindkeys as the predict-on does to turn on/off auto-fu?
I tried zle -N auto-fu-off and zle-N auto-fu-deactivate. But, both did not seem to do anything.
Any thoughts, please?
Thanks
Joe
Hello,
I noticed this line in your Readme: TODO: play nice with zsh-syntax-highlighting.
I use zsh-syntax-highlighting.
I notice (being a newbie) that it does not matter whether I source auto-fu.zsh before or after sourcing zsh-syntax-highlighting.
Just wanted to check about the recommended approach (source it before zsh-syntax-highlighting or after)?
Thanks
Joe
こんにちわ~~ @hchbaw 君
The following error are showing up alternately every time I start a new terminal.
$ with-afu-zle-rebinding:16: command not found: afu-zle-aysce-install
$ (Then I could execute whatever command without any error shown)
and
$ with-afu-zle-rebinding:16: command not found: -zle-force-install
$ (Then I could execute whatever command without any error shown)
A bit similar to issue #22 from @joe9 , but I think it's better to make a new issue to report it.
What's more, the following command just outputs a blank line.
$ echo $functions[afu-initialize-rebinds]
[A blank line]
$
How could I fix the error message?
Hope for your reply !!! お愿いします!
auto-fu.zsh
Version: https://github.com/hchbaw/auto-fu.zsh/blob/pu/auto-fu.zshauto-fu.zsh
into ~/.zsh
.zshrc
:# Path to your oh-my-zsh installation.
ZSH=/usr/share/oh-my-zsh/
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="agnoster"
DEFAULT_USER="f"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# 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.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (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=(extract fbterm git history-substring-search systemd svn tmux)
source $ZSH/oh-my-zsh.sh
# User configuration
# 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"
## auto-fu.zsh stuff.
# source ~/codes/auto-fu.zsh/auto-fu.zsh
{ . /home/f/.zsh/auto-fu; auto-fu-install; }
zstyle ':auto-fu:highlight' input bold
zstyle ':auto-fu:highlight' completion fg=black,bold
zstyle ':auto-fu:highlight' completion/one fg=white,bold,underline
zstyle ':auto-fu:var' postdisplay $'\n-azfu-'
zstyle ':auto-fu:var' track-keymap-skip opp
zle-line-init () {auto-fu-init;}; zle -N zle-line-init
zle -N zle-keymap-select auto-fu-zle-keymap-select
# Powerline
. /usr/share/zsh/site-contrib/powerline.zsh
# Customize to your needs...
# Enhanced History Search
bindkey "^[[A" history-search-backward
bindkey "^[[B" history-search-forward
# Emulate 256 color mode only when fbterm is active
[ -n "$FBTERM" ] && export TERM=fbterm
setopt hist_ignore_all_dups
setopt hist_ignore_space
# zsh 4.3.6 doesn't have this option
setopt hist_fcntl_lock 2>/dev/null
setopt hist_reduce_blanks
# vim:filetype=zsh:foldmethod=marker:autoindent:expandtab:shiftwidth=4
I just added the following snippet to my .zshrc
(taken from the Internet, I know!):
# Vi-mode
bindkey -v
bindkey '^P' up-history
bindkey '^N' down-history
bindkey '^?' backward-delete-char
bindkey '^h' backward-delete-char
bindkey '^w' backward-kill-word
bindkey '^r' history-incremental-search-backward
function zle-line-init zle-keymap-select {
VIM_PROMPT="%{$fg_bold[yellow]%} [% NORMAL]% %{$reset_color%}"
RPS1="${${KEYMAP/vicmd/$VIM_PROMPT}/(main|viins)/} %{$fg[red]%}$(rvm_info)%{$reset_color%}"
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
export KEYTIMEOUT=1
If I put this before auto-fu then auto-fu works but not the Vi-mode, and if I put it after auto-fu then Vi-mode works but not auto-fu...
Weird.
This is how I sourced auto-fu.zsh into my zshrc:
$ cat 06-auto-fu.zsh
autoload -Uz compinit is-at-least
compinit -D -u
zstyle ':completion:' completer complete
zstyle ':completion:' list-colors ${(s.:.)LS_COLORS}
zstyle ':completion:' menu select=1 # interactive
zstyle ':completion:' accept-exact-dirs true
zstyle ':completion:' path-completion false
if is-at-least 4.3.10
then zstyle ':completion:_' format "%B%F{yellow}%K{blue}%d%k%f%b"
else zstyle ':completion:*' format "%B%d%b"
fi
source /usr/share/zsh/site-contrib/auto-fu.zsh/auto-fu.zsh
zstyle ':auto-fu:highlight' input
zstyle ':auto-fu:highlight' completion bold,fg=blue
zstyle ':auto-fu:highlight' completion/one fg=blue
zstyle ':auto-fu:var' postdisplay # $'\n-azfu-'
zle-line-init() auto-fu-init
zle -N zle-line-init
zle -N zle-keymap-select auto-fu-zle-keymap-select
zstyle ':auto-fu:var' autoable-function/skiplines '[[:blank:]\"''']'
zstyle ':auto-fu:var' autoable-function/skipwords '[\]'
kill-line-maybe() {
if (($#BUFFER > CURSOR))
then zle kill-line
else zle kill-whole-line
fi
}
zle -N kill-line-maybe
bindkey '\C-d' kill-line-maybe
afu+orf-ignoreeof-deletechar-list() {
afu-eof-maybe afu-ignore-eof zle kill-line-maybe
}
afu+orf-exit-deletechar-list() {
afu-eof-maybe exit zle kill-line-maybe
}
When I do source the above file, I get:
source 06-auto-fu.zsh
source 06-auto-fu.zsh
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
with-afu~: job table full or recursion limit exceeded
Any thoughts on what I am missing, please?
Thanks
Joe
Thank you for this excellent script. I have thb running on my ZSH alongside zsh-syntax-highlight
I have menu completion configured to be extra-verbose. It's on the slow side and I would rather it not be triggered on self-insert. Is there a way to disable the menu completion aspect such that the highlighting in the line is the only thing I see?
Thanks,
PythonNut
As of commit zsh-users/zsh-syntax-highlighting@7e6d960, auto-fu/pu
and auto-fu/next
both break self-insertion, among other things, with the error:
No such shell function
self-insert-by-keymap
i would like to have what is typed already to complete to the first match, again much like google-chrome's addr bar.
note that vimperato for example doesn't behave like that; or at least it didn't when i was using it (4-5 years ago).
I am not zhs savvy, I installed auto-fu in the wrong way and now I have undesired results.
How do I remove auto-fu?
Hi,
Did you get auto-fu working with zsh-syntax-highlighting ? I tried activating both but it seems highlighting takes precedence over auto-fu. Do you need us to make some change to improve compatibility ?
In later versions of zsh auto-fu.zsh causes the prompt to be displayed twice. In older versions of zsh this didn't happen, I don't know the exact version. For example if you simple type echo test
<enter>
this is the output.
Ubuntu-15% echo test
Ubuntu-15% echo test
test
Ubuntu-15%
Hi, thank you for before day 😄 :
I hope to this behavior
afu-vicmd
v
or V
But auto-fu.zsh delete only one char
For example.
# prompt
$ aaaaaaabaaaaaa
^______
# and input x
$ aaaaaaaaaaaaa
(^
means the cursor point)
(_
means the selected block)
Does auto-fu.zsh support visual
? 😃
This is not a bug but just a request: I would appreciate if you would tag the releases regularly.
Reason: I am providing an ebuild of auto-fu.zsh for gentoo in an overlay (see URL below).
Although it is possible to use a "live" ebuild with git, it is more reliable and more convenient for the users if they can download the tarball for the current release. With github, this is only possible for tagged releases. The last tag is already a year old...
http://git.overlays.gentoo.org/gitweb/?p=user/mv.git;a=tree;f=app-shells/auto-fu-zsh
Hello,
The below error is showing up once in a while when I start a new terminal.
with-afu-zle-rebinding:10: command not found: afu-zle-aysce-install
Thanks
Joe
Hi, can you add a license to this package? Thanks.
Autofu fails with some commands. It's not Autofu's fault, but it would be useful to have a blacklist some commands
Cannot rebind self-insert: user:url-quote-magic
Cannot rebind backward-delete-char: user:backward-delete-char
Cannot rebind backward-kill-word: user:backward-kill-word
Cannot rebind kill-line: user:kill-line
Cannot rebind kill-whole-line: user:kill-whole-line
Cannot rebind kill-word: user:kill-word
Cannot rebind magic-space: user:magic-space
Cannot rebind yank: user:yank
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
(eval):1: bad pattern: ^[[?1002h^[[?1049h^[[?1h^[=^[[1
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
(eval):1: bad pattern: ^[[?1002h^[[?1049h^[[?1h^[=^[[1
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
(eval):1: bad pattern: ^[[?1002h^[[?1049h^[[?1h^[=^[[1
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
(eval):1: bad pattern: ^[[?1002h^[[?1049h^[[?1h^[=^[[1
--(~)-----------------------------------------------------------------------------------(pts/7@main)--
Hello,
I am wondering if you can help me with this issue.
Attached is the screenshot of what I am talking about: http://imgur.com/gdoaItb
On the right are 2 terminals and the different auto-fu behaviour in each.
On the right most terminal with the "history word" on top shows auto-fu completing to "etc/zsh" though the shortest match of "etc" in the "local directory" is still available.
On the other terminal, auto-foo correctly completes to "etc" and waits.
This is probably not related to auto-foo. To get the "history word" group in the list of commands, I add this line:
defs=(
to the file: /usr/share/zsh/5.0.2/functions/Completion/Zsh/_command_names
The shell/terminal to the extreme right was started with the above line in the file. The shell/terminal next to that (towards the center, with the correct auto-fu behaviour) was started without that above history line.
Just wanted to bring it to your attention for your insight/opinion.
Thanks
Joe
$ git clone https://github.com/hchbaw/auto-fu.zsh.git
$ cd auto-fu.zsh
$ chmod +x auto-fu.zsh
$ ./auto-fu.zsh
./auto-fu.zsh: line 295: autoload: command not found
./auto-fu.zsh: line 297: syntax error near unexpected token `)'
./auto-fu.zsh: line 297: `() {'
$ zsh --version
zsh --version
zsh 4.3.11 (i386-apple-darwin12.0)
afu-register-zle-accept-line:3: command not found: v
afu-register-zle-accept-line:3: command not found: v
afu-register-zle-accept-line:3: command not found: v
afu-register-zle-toggle:5: command not found: v
Hello,
I see the above errors when I start zsh with the auto-fu.zsh sourced. Wondering if you have any thoughts on how to fix them.
Thanks
Joe
When I use auto-fu.zsh on a machine over SSH, I get:
afu-track-keymap:15: permission denied:
Every time I hit enter at the zsh prompt. This is using auto-fu.zsh from git (on the pu
branch) with zsh 5.0.0.
i've just started using auto-fu but i don't see history being pull into results. is it possible to add history to resutls? i would want it to be the first hit actually. why? because most commands are repeteation (with some minor changes applied in small portion of them) of older commands... definitly needs to be the first hit in results...
When exiting zsh with Ctrl-d (if auto-fu is used) the exit status is nonzero which is irritating for remote or chroot shells. The reson is that the function
afu-eof-maybe () {
local eof="$1"; shift
[[ "$BUFFER" != '' ]] || { $eof; return }
"$@"
}
is called with $1=exit, and the status during $eof is nonzero, because the previous test has nonzero status. A simple inversion of the logic would fix this, i.e. the second line of the above function would just have to be replaced by
[[ -z $BUFFER ]] && { $eof; return }
As a somewhat related issue, I would think that a slightly different behavior of Ctrl-d for nonempty lines would be more intuitive: I would like that Ctrl-d clears not only a character but the whole rest of the line, and if there is no such rest then the whole line is cleared (so that pressing Ctrl-d at most three times indeed exits the shell). In other words, I would like to see instead of "$@" in the above function some code (or function) like:
if (($#BUFFER > CURSOR))
then zle kill-line
else zle kill-whole-line
fi
It would be really great if such a behavior could be enabled at least optionally.
Hello,
This is my zstyle:
zstyle -L
zstyle ':completion:' accept-exact-dirs true
zstyle ':completion::options' auto-description %d
zstyle :auto-fu:var autoable-function/skiplines '[[:blank:]\"''']'
zstyle :auto-fu:var autoable-function/skipwords '[\]'
zstyle ':completion::complete:' cache-path /home/j/var/zsh/zcompcache
zstyle ':completion:hist-complete:' completer history
zstyle :auto-fu:highlight completion 'bold,fg=blue'
zstyle :auto-fu:highlight completion/one 'fg=blue'
zstyle ':completion::options' description yes
zstyle :auto-fu:var disable magic-space
zstyle :auto-fu:var enable all
zstyle :auto-fu:var eof-installed-p yes
zstyle ':completion::corrections' format ' %F{green}-- %d (errors: %e) --%f'
zstyle ':completion::descriptions' format ' %F{yellow}-- %d --%f'
zstyle ':completion::messages' format ' %F{purple} -- %d --%f'
zstyle ':completion::warnings' format ' %F{red}-- no matches found --%f'
zstyle ':completion:' format ' %F{yellow}-- %d --%f'
zstyle :auto-fu:highlight input
zstyle :auto-fu:var isearchmap-installed-p yes
zstyle ':completion::default' list-prompt '%S%M matches%s'
zstyle ':completion:' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[.-]=* r:|=' 'l:|= r:|='
zstyle ':completion:predict:' menu yes
zstyle ':completion:::::' menu select
zstyle ':completion:' menu 'select=1'
zstyle :auto-fu:var misc-installed-p yes
zstyle :auto-fu:var postdisplay
zstyle :auto-fu:var preexec-installed-p yes
zstyle ':completion:' show-completer true
zstyle ':completion::complete:' use-cache on
zstyle ':completion:' use-compctl false
zstyle :predict verbose true
zstyle ':completion:' verbose yes
What does "magic space" do? and, does "enable-all" enable that functionality?
Thanks
Joe
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.