Comments (2)
Hi, Joe!
Oh it's fascinating to add the "history word" group to _command_names
.
Thank you very much opening it up here. I will try it out!
from auto-fu.zsh.
Hello Takehi,
The above is the wrong way to go about adding history words to _command_names. As an fyi, below is an email from Bart on the subject:
Unless I'm misunderstanding your intent, you don't actually want to
change the tags from _command_names -- you just want to add another tag
that appears in completion output along with the _command_names tags?
To do this you want to replace the completer function for "-command-"
context. By default this is the _autocd completer (which is only the
default because _autocd is the only file in the completion library that
begins with "#compdef -command-").
So first make yourself a little function patterned on _autocd:
_history_or_autocd () {
_history
local ret=$?
_autocd || return ret
}
And then install it for the context:
compdef _history_or_autocd -command-
To explain a bit further, the completers in the completer style are in
general attempted until one returns a zero (true, success) status, at
which point the set of possible matches is assumed to be finished. To
merge the results of several completers you have to save the staus, try
the next one, and then return success if any of those completers was
successful.
If you instead wanted to complete history and only try the defaults if no
history words matched, you could have shortcut this as
compdef '_history || _autocd' -command-
Of course whichever of these you choose has to happen after compinit is
run, otherwise _autocd will step on it when loaded.
Joe
from auto-fu.zsh.
Related Issues (20)
- License HOT 2
- Disable menu completion HOT 2
- Weird error when using functions HOT 1
- Add an option to blacklist some commands HOT 2
- Not compatible with ZSH Vi-mode HOT 6
- breakage with upcoming zsh-5.0.3 HOT 4
- Causes undo widget not to work HOT 1
- Uninstall instructions? HOT 1
- completion for npm is super slow HOT 3
- Error message: with-afu-zle-rebinding:16: command not found: afu-zle-aysce-install and with-afu-zle-rebinding:16: command not found: -zle-force-install HOT 11
- implement bookmarks HOT 2
- set <backspace> to remove suggestions first HOT 3
- always complete to the first match HOT 1
- add history to results HOT 3
- [Feature Request] Does not send unaccepted completion after enter pressed HOT 2
- do NOT change what user has typed
- Causes duplicate prompts. HOT 1
- Recent zsh-syntax-highlighting breaks auto-fu
- Doesn't auto-fu.zsh support `visual` ? HOT 2
- Does auto-fu support prefix history filter?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-fu.zsh.