https://github.com/knu/zsh-manydots-magic
manydots-magic - zle tweak for emulating `...'==`../..' etc.
https://github.com/knu/zsh-manydots-magic
Last synced: 8 months ago
JSON representation
manydots-magic - zle tweak for emulating `...'==`../..' etc.
- Host: GitHub
- URL: https://github.com/knu/zsh-manydots-magic
- Owner: knu
- License: bsd-2-clause
- Created: 2011-06-23T06:10:16.000Z (over 14 years ago)
- Default Branch: main
- Last Pushed: 2024-09-11T09:24:05.000Z (about 1 year ago)
- Last Synced: 2024-10-14T20:55:35.357Z (about 1 year ago)
- Language: Shell
- Size: 5.86 KB
- Stars: 44
- Watchers: 6
- Forks: 8
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-zsh-plugins - manydots-magic - A zle tweak for emulating `...'==`../..' etc. (Plugins / ZSH on Windows)
- fucking-awesome-zsh-plugins - manydots-magic - A zle tweak for emulating `...'==`../..' etc. (Plugins / ZSH on Windows)
- awesome-zsh-plugins - manydots-magic - A zle tweak for emulating `...'==`../..' etc. (Plugins / Zinit (née zplugin))
README
manydots-magic for zsh
======================
Synopsis
--------
* manydots-magic - zle tweak for emulating `...`==`../..` etc.
Description
-----------
This tweek helps input ancestor directories beyond the parent (`..`)
in a handy way. You can just type triple dots to input `../..`,
quadruple dots to `../../..`, etc..
% .. [Hit <.>]
% ../.. [Hit <.>]
% ../../.. [Hit <^H>]
% ../.. [Hit <^H>]
% ..
As you see above, each of the `/..` parts complemented by this tweak
can be deleted by a single invocation of the `backward-delete-char`
command, only if invoked right after the magic happens.
% .. [Hit ><.><.>]
% ../.. [Hit <^H>]
% ../.
Triple-dot is not a rarely used character sequence, and this tweak
kind of "knows" when it should be expanded.
% ruby -e '(1.. [Hit <.>]
% ruby -e '(1...
% git log branch.. [Hit <.>]
% git log branch...
% git diff .. [Hit <.>]
% git diff ../.. [Hit ] <- This may be a path...
% git diff ...b [Hit ] <- Or not.
% git diff ...branch
How to set up
-------------
Put the file `manydots-magic` somewhere in your `$fpath` (typically in
`$ZDOTDIR` which is set to something like `~/.zsh` or `~/.zsh.d`) and
add these lines to your `.zshrc`:
autoload -Uz manydots-magic
manydots-magic
If you are enabling `url-quote-magic`, make sure to load
`url-quote-magic` first and then load `manydots-magic`.
License
-------
Copyright (c) 2011, 2012 Akinori MUSHA
Licensed under the 2-clause BSD license.
See `LICENSE` for details.