- similar & forked from gof (thanks
mattn
) - but simplified it & extended just for independent
open2edit
open2cd
& fun? - and bug fix & feat extend or at least
jj
should be a more quick/cool name 😄
go get github.com/Shane-XB-Qian/jj
(or just download the binjj
from this repo).- please think to write
alias jj='jj || if [ $? -eq 6 ]; then $(cat "$HOME/.jj_tmp_fs"); fi'
into your.bashrc
.
$ jj
- Run
jj
and emitctrl-o
, then start to edit (open2edit
) withvim
, whatever it was a file or dir. - Run
jj
and emit<enter>
, then start to edit (open2edit
) withvim
if it was a file, or would quit butcd
to that dir (open2cd
) if it was a dir.
fuzzy
if to 'fuzzy' filter -can be switched -when injj
-byctrl-r
.dirOnly
if to display/show dir only -can be switched -when injj
-byctrl-f
.mruHist
if to display/show MRU hist -can be switched -when injj
-byctrl-v
.curOnly
if to display/show cur only -can be switched -when injj
-byctrl-\
.
-
cur only means only show fs under cur path -or 'cwd' (if set 'root dir')
-
cur only is higher priority than mru hist when if both switched to true.
-
Tips: Use
tab
to complete dir. -
Note:
mruHist
stored abs path. -
Use
ctrl-z
if to multi-select, and/but toopen2cd
only the last one.
Option | Description |
---|---|
-f | Fuzzy match |
-w | Init with dir only on |
-c | Init with cur only on |
-m | Init with mru hist on |
-d [path] | Specify root directory |
- check
-h
for detail.
Key | Description |
---|---|
CTRL-K,CTRL-P,ARROW-UP | Move-up line -or wrap to bottom |
CTRL-J,CTRL-N,ARROW-DOWN | Move-down line -or wrap to top |
CTRL-G | Move-down line -to bottom |
CTRL-A,HOME | Go to head of prompt |
CTRL-E,END | Go to trail of prompt |
ARROW-LEFT | Move-left cursor |
ARROW-RIGHT | Move-right cursor |
CTRL-O | Edit the selected file/dir |
CTRL-I,TAB | Complete dir |
CTRL-Y | Echo cur item to input |
CTRL-T | Toggle view header/trailing of lines |
CTRL-L | Redraw |
CTRL-U | Clear prompt |
CTRL-W | Remove backward word (sep by '/') |
CTRL-H,BS | Remove backward character |
DEL | Delete character on the cursor |
CTRL-Z | Toggle selection |
CTRL-R | Toggle fuzzy option |
CTRL-F | Toggle dirOnly option |
CTRL-\ | Toggle curOnly option |
CTRL-V | Toggle mruHist option |
Enter | Decide : open2edit / open2cd |
CTRL-D,CTRL-C,ESC | Cancel |
MIT
- Yasuhiro Matsumoto (mattn) made
gof
. - Shane.XB.Qian is simplifying
gof
tojj
.
- mostly just a play to myself: only tested with linux/bash and edit default with vim.
- to simple cases should be just fine: quick to jump/edit & have more fun with bash 😄