momo-lab / zsh-abbrev-alias Goto Github PK
View Code? Open in Web Editor NEWThis zsh plugin provides functionality similar to Vim's abbreviation expansion.
License: MIT License
This zsh plugin provides functionality similar to Vim's abbreviation expansion.
License: MIT License
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:
abbrev-alias -g gs="git status"
Typing gs<SPACE>
or gs<ENTER>
will expand the abbreviation, wonderful. But what if I want to run the command gs
(ghostscript)? Is there a binding that will cancel the attempt to abbreviate?
Is there a way to swallow the trigger key? so:
abbrev-alias -g cfg="cd ~/.config/"
Returns:
cd ~/.config/_
#Not:
cd ~/.config/ _
Where the underscore is the cursor.
I'd like to do abbrev-alias "git st"="git status"
, is this something that could be added?
First off, great project! Really appreciate the benefits of doing alias expansion as I type.
I make lots of use of aliases-in-aliases. For example, in my .zshrc
:
abbrev-alias D='docker'
abbrev-alias Dr="D run --rm -it"
Here, if I type D
, it expands correctly. However, when I type Dr
, it only expands one level deep, i.e. D run --rm -it
. It'd be great if the expansion happened recursively so that this became docker run --rm -it
.
I'd like to expand aliases providing arguments, for example:
abbrev-alias -f hping-listen="hping -9 $1 -I $2 | /bin/sh"
Where $1 and $2 will be expanded to the first two arguments provided after the alias has been expanded.
Is that possible to do something similar to that?
I'd like something similar to vim's snippets expand functionality.
Thanks.
I don't use a plugin manager and i think it would be good to follow the convention of your pluginname.plugin.zsh file was accurate to the github repository name, so that people who get their plugins without a manager can get the plugin loaded using a variable name.
current name of file: abbrev-alias.plugin.zsh
with the convention: zsh-abbrev-alias.plugin.zsh
(as it matches the repository name).
新しいコマンドが書ける箇所についても補完したい。
具体的には以下の文字の後でも補完したい。
スペースが0 or 1なら補完する、2以上なら補完しない、というのが元の挙動に近そう。
※後で英訳しておくこと。
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.