GithubHelp home page GithubHelp logo

zsh-manydots-magic's Introduction

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 <b>]      <- This may be a path...
% git diff ...b [Hit <ranch>]   <- 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.

zsh-manydots-magic's People

Contributors

knu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

zsh-manydots-magic's Issues

Pressing `^H` and the backspace key does not remove an entire `/..`

Versions

% zsh --version
zsh 5.9 (x86_64-pc-linux-gnu)

I'm using Gentoo Linux, and only pcre and unicode use flags are enabled.

Problem

From the README, pressing ^H or the backspace key is supposed to remove an entire /...

% .. [Hit <.>]
% ../.. [Hit <.>]
% ../../.. [Hit <^H>]
% ../.. [Hit <^H>]
% ..

However, I couldn't get this behavior. Instead, ^H and the backspace key remove only a character.

.zshrc

fpath="$HOME/.zsh"

autoload -Uz manydots-magic
manydots-magic

Reproduction

  1. Copy the above .zshrc to $HOME/.zshrc.
  2. git clone https://github.com/knu/zsh-manydots-magic
  3. mkdir $HOME/.zsh
  4. cp zsh-manydots-magic/manydots-magic $HOME/.zsh
  5. Run a new shell
  6. Try pressing ^H after pressing . a few times.

Tag release

Hi, I was wondering if you could please tag a (stable) release to make it simpler for package maintainers. I'm thinking about releasing it in Arch Linux's AUR. Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.