Giter Club home page Giter Club logo

fish-bd's Introduction

fish-bd

Quickly go back to a parent directory up in your current working directory tree. Don't write 'cd ../../..' redundantly, use bd instead.

This is a fish implementation of vigneshwaranr/bd by Vigneshwaran Raveendran.

Usage

# fish-bd v1.3.3 (https://github.com/0rax/bd-fish)

Description:
    Quickly go back to a parent directory up in your current working directory tree.
    Don't write 'cd ../../..' redundantly, use bd instead.

Usage:
    bd [option] <pattern>

Examples:
    # You are in /home/user/my/path/is/very/long/
    # And you want to go back to 'path', simple type
    > bd path
    # or
    > bd -s pa
    # or
    > bd -i Pat
    # And you are now in /home/user/my/path/

Options:
    -c <pattern>
            Classic mode : goes back to the first directory matching the pattern (default)
            Set if default using (set -gx BD_OPT 'classic')
            Default mode when BD_OPT or CLI options are specified
    -s <pattern>
            Seems mode: goes back to the first directory starting with pattern
            Set it as default using (set -gx BD_OPT 'sensitive')
    -i <pattern>
            Case insensitive mode: same as seems mode without case sensitity
            Set it as default using (set -gx BD_OPT 'insensitive')
    -h      Print this help and exit

Note:
    Fuzzy matching of a directory can be done with any mode using the built-in
    fish-shell autocompletion. This allows you to enter any part of the path
    and still match it

Installation

Using Fisher (recommended method)

# This method allows you to update bd automatically via `fisher`
fisher install 0rax/fish-bd

Using Symlinks

# This method allows you to update narwhal by just doing a 'git pull'
git clone https://github.com/0rax/fish-bd ~/.config/fish/fish-bd
mkdir -p ~/.config/fish/functions/ ~/.config/fish/completions/
ln -s ~/.config/fish/fish-bd/functions/bd.fish   ~/.config/fish/functions/
ln -s ~/.config/fish/fish-bd/completions/bd.fish ~/.config/fish/completions/

Using Make

make install # Assumes your fish config directory is '~/.config/fish'

Manual Install

set -l FISH_CONFIG_FOLDER ~/.config/fish/
cp functions/bd.fish   $FISH_CONFIG_FOLDER/functions/
cp completions/bd.fish $FISH_CONFIG_FOLDER/completions/

License

fish-bd is MIT licensed. See LICENSE.

fish-bd's People

Contributors

0rax avatar gitter-badger avatar mikebobroski avatar najamelan avatar therealmarv avatar znculee 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  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  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

fish-bd's Issues

Seems mode requires argument to be prefix

The doc states that seems "goes back to the first directory containing string", which makes sense.

This means that, being in /home/user/my/path/is/very/long/, bd -s th should take me to /home/user/my/path.

It does not, however. bd finds "no such occurrence".

Sed error using case insensitive mode

When using the case insensitive mode (either from flag, or BD_OPT), receive a sed error when there is a second argument (the string to match)

Error:
sed: 1: "s|(./sch[^/]/).*|\1|I": bad flag in substitute command: 'I'
test: Missing argument at index 2

screen shot 2015-11-17 at 4 14 39 pm

Do you know how to fix this problem? Am I doing something wrong? Let me know if you need anymore information about this issue

use stderr for error messages

I want to disable the echoing of the directory but I still want to see error messages. This would happen easily if error messages were written to stderr but the directory was echoed to stdout, I could just redirect stdout to /dev/null.

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.