Code Monkey home page Code Monkey logo

cdp's Introduction

cdp

Quickly cd into your projects.

How it works

Searches recursively every folder from the specified ROOT_DIR until finding a STOPPER (.git folder by default). When the STOPPER has been found, adds its parent directory to a filterable list and continues searching.

example

Usage

  1. Download the binary.
  2. Add the following to your .bashrc (or the equivalent file in other shells).
cdp() {
	cd "$(/path/to/cdp /path/to/ROOT_DIR "$@")"
}
  1. Restart your terminal or source .bashrc.
  2. Run cdp or run cdp folder, where folder is a string that will match one of the paths in the list. This will immediately cd into that folder without bringing up the list UI.

Tip

You can use cd - to go back to the previous directory after running cdp.

Key bindings

  • Go up: Up arrow/Ctrl+K
  • Go down: Down arrow/Ctrl+J
  • Go to first entry: Home
  • Go to last entry: End
  • Exit: Escape/Ctrl+C
  • Accept: Enter

Arguments

Important

If you want to run --help or --version commands, use the full path to the binary eg. /path/to/cdp --version
otherwise the output will be mangled. This is due to a limitation in clap rust library, which can't print the output of these flags to stderr.

Usage: cdp [OPTIONS] <ROOT_DIR> [SEARCH_QUERY]

Arguments:
  <ROOT_DIR>      Search recursively from this directory
  [SEARCH_QUERY]  Jump into the first directory matching this string (optional)

Options:
      --stopper <STOPPER>  Search for directories containing this file [default: .git]
      --greedy             Continue searching in a directory subtree when a stopper file is found
      --cpus <CPUS>        Amount of logical cores to use for searching the root_dir, defaults to half available
      --case-sensitive
  -h, --help               Print help
  -V, --version            Print version

cdp's People

Contributors

mwojtyna avatar

Stargazers

Ciren avatar Ved_s avatar Clayton Kehoe avatar Sergey Bryukhovskikh avatar

Watchers

 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.