Code Monkey home page Code Monkey logo

godir's Introduction

Here you can find godir(), gofile(), and godir-completion.sh to help you easily
reach any directory or file under a certain project tree.

The godir() is modified from the one in Android Open Source Project, AOSP/build/envsetup.sh.

The functionality of gofile is patched by Kent Cheng (chenkaie.)

godir-completion.sh can give them even more magic to find a folder or file, as demonstrated following:

oswin.chou@rd1-3:~$ source godir/godir.sh
oswin.chou@rd1-3:~$ source godir/godir-completion.sh
oswin.chou@rd1-3:~$ cd fdhijack/
oswin.chou@rd1-3:~/fdhijack$ tree
.
├── app
│   ├── chfd
│   │   ├── config.mk
│   │   ├── makefile
│   │   └── src
│   │       └── chfd.c
│   └── xchfd
│       └── xchfd.c
├── config.mk
├── fdhj_2.6.18
│   ├── fdhj.c
│   └── Makefile
├── fdhj_2.6.28
│   ├── fdhj.c
│   └── Makefile
├── fdhj_2.6.34
│   ├── fdhj.c
│   └── Makefile
├── fdhj_2.6.37
│   ├── fdhj.c
│   └── Makefile
├── fdhj_3.10.49
│   ├── fdhj.c
│   └── Makefile
├── inc
│   ├── ceh.h
│   ├── fdhj.h
│   └── libfdhj.h
├── makefile
├── README
├── scr
│   └── fdhj_load
└── src
    ├── ceh.c
	    └── libfdhj.c

12 directories, 23 files
oswin.chou@rd1-3:~/fdhijack$ export T=$PWD
oswin.chou@rd1-3:~/fdhijack$ update_godir_filelist
Creating index... Done

oswin.chou@rd1-3:~/fdhijack$ cd fdhj_2.6.18 # To show that every path can be found regardless of where you are
oswin.chou@rd1-3:~/fdhijack/fdhj_2.6.18$ godir ch[TAB]
oswin.chou@rd1-3:~/fdhijack/fdhj_2.6.18$ godir chfd/[TAB][TAB]
chfd/           chfd/config.mk  chfd/makefile   chfd/src/
oswin.chou@rd1-3:~/fdhijack/fdhj_2.6.18$ godir chfd/s[TAB]
oswin.chou@rd1-3:~/fdhijack/fdhj_2.6.18$ godir chfd/src/$[Enter]
oswin.chou@rd1-3:~/fdhijack/app/chfd/src$ pwd
/home/oswin.chou/fdhijack/app/chfd/src
oswin.chou@rd1-3:~/fdhijack/app/chfd/src$ gofile fdhj.[TAB][TAB]
fdhj.c  fdhj.h
oswin.chou@rd1-3:~/fdhijack/app/chfd/src$ gofile fdhj.c[Enter]
   [1] ./fdhj_2.6.18/fdhj.c
   [2] ./fdhj_2.6.28/fdhj.c
   [3] ./fdhj_2.6.34/fdhj.c
   [4] ./fdhj_2.6.37/fdhj.c
   [5] ./fdhj_3.10.49/fdhj.c
   [6] ./src/libfdhj.c

Select one ([a] -> all): 5[Enter]
(./fdhj_3.10.49/fdhj.c is then opened in $EDITOR)

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.