Giter Club home page Giter Club logo

dirwalk's Introduction

Dirwalk

Dirwalk is a shell-script function that lets you easily change your working directory to a given Git project.

History

I frequently find myself with a lot of Git repositories, and I want to be able to quickly change to the correct directory, without a lot of typing.

I can create a shell alias to change to the root directory, but how can I quickly change to the correct sub-directory, without a lot of typing?

Enter dirwalk!

Just type it, optionally with a regular expression, and it will find the correct sub-directory.

Example

asciicast

Note

Note that this has to be a shell function, otherwise it will change the working directory of a child process, and then it will exit, leaving you where you started.

Supported Shells

I prefer the fish shell, but I also wrote a Zsh version and Bash version. With some fiddling, you could probably get this to work with a more minimal shell, such as the original Bourne shell, or one of the lighter-weight shells such as ash. I may do so, when I find time.

To-Do

I will be adding a ksh specific version soon. I may also see if I can consolidate the POSIX-ish shells, such as Zsh and Bash, into one script. However, currently there are some subtle differences between the shells that makes that challenging, e.g., zsh indexing arrays starting with 1, while Bash starts with 0, etc.

dirwalk's People

Contributors

mojotx avatar

Watchers

 avatar

dirwalk's Issues

Argument passed needs to be correctly quoted

The fish version does not handle the '-' character very well.

For example, if you have a directory named foo-bar, it will find the project if you pass foo, but not if you pass foo-.

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.