fod (meaning File Open Dialog) is a tool to select the directories and files interactively. will output the path of the selected directories and files to standard output.
Usage
cd $(fod)
mv $(fod)
git add $(fod)
git add $(fod -m --separator=' ')
For example, If you run fod
on this project repository working copy.
If you are not given the option, it will be a mode in which you can select one of the directory.
It will see the display as follows:
>
[d] ../
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/.git
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/_vendor
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/pkg-config-files
Items that focus is highlighted. You can change the items that you have focus in the up and down arrow keys.
When you press Ctrl + S, it will be marked by the selected item. To the marked item is displayed '*'.
>
[d] ../
[d] * /Users/kandayasu/.go/src/github.com/ykanda/fod/.git
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/_vendor
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/pkg-config-files
If you mark the other items, the mark of the current item is excluded.
If you want to select multiple items at the same time, use the --multiple
option.
When you press Ctrl + O, and then exit the selection. The marked items are displayed in the standard output.
If you see with the left side of the list of items '[d]', that item is a directory. In the case of the file is displayed as '[f]'.
When you press Enter in a state of focus item is a directory, you can change the directory For example, if you press Enter in a state of focus the .git directory, it will be displayed as follows:
>
[d] ../
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/branches
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/hooks
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/info
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/logs
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/objects
[d] /Users/kandayasu/.go/src/github.com/ykanda/fod/refs
TODO
option | Explaination |
---|---|
--mode, -m | select mode (f, file, directory, dir, d) |
--base, -b | base dir |
--multi | multiple selection mode |
--separator, -s | path separator string (use with --multi) |
go get github.com/ykanda/fod
KEY | Explaination |
---|---|
Enter | open directory |
Arrow Up | move cursor up |
Arrow Down | move cursor down |
Arrow Left | move parent directory |
Arrow Right | move sub directory |
Ctrl + S | toggle marked / unmarked |
Ctrl + H | toggle dotfile filter |
Ctrl + O | OK, exit and output selcted item |
Ctrl + C | cancel and exit, no output |
Ctrl + Q | cancel and exit, no output |
Esc | cancel and exit, no output |
- Please fork repository on GitHub.
- Execute
go get github.com/your_id_on_github/fod
, to make working copy on your computer. - Checkout working branch.
- Editing code.
- Send PR.
Too see glide.yaml file. I thank the authors of the library.
Copyright (C) 2015 Yasuhiro KANDA (@kandayasu)
- test
- configuable key bind
- symlinks
- windows support