Giter VIP home page Giter VIP logo

pcd's Introduction

Project change directory – pcd

Bash shell script code for navigating between project directories on the command line, including auto completion.

Installation

  1. Copy pcd.sh to your home directory:
curl https://raw.githubusercontent.com/oyvindstegard/pcd/main/pcd.sh \
     -o ~/.pcd.sh
  1. Add code to shell init file ~/.bashrc:
PROJECTS_PATH=~/your-projects-root-directory
source ~/.pcd.sh
  1. Open a shell, type pcd and hit TAB three times – you should see your project directories being auto completed.

Usage

After loading the code, type pcd and hit TAB a couple of times to see completion of all project directories. Hit ENTER to jump to project. It will also complete into a project sub-directory as optional second argument.

To jump up to a project root directory you can use pcd .. – this works if it is a git repository. You can combine it with a second arg to drill into another directory tree of the same project:

~/dev/myrepo/target/build/foo/bar$ pcd .. src
~/dev/myrepo/src$ 

Lastly, you can use the option -p to use pushd instead cd when changing directory.

Screencast

Screencast

Future ideas

  • Consider supporting a colon-delimited PROJECTS_PATH-variable with multiple roots.

pcd's People

Contributors

oyvindstegard avatar

Stargazers

Malte Bublitz avatar

Watchers

James Cloos avatar  avatar

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.