- Notifications
You must be signed in to change notification settings - Fork13
mattn/gof
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Go Fuzzy
Open files in Vim directly (inside Vim terminal)
$ go install github.com/mattn/gof@latest
- Faster and startup
- Working on windows
- Glob files and edit the selected file with vim.
$ vim`gof`
- Read from stdin
$ find /tmp| gof
Key | Description |
---|---|
CTRL-K,CTRL-P,ARROW-UP | Move-up line |
CTRL-J,CTRL-N,ARROW-DOWN | Move-down line |
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-I | Toggle view header/trailing of lines |
CTRL-L | Redraw |
CTRL-U | Clear prompt |
CTRL-W | Remove backward word |
BS | Remove backward character |
DEL | Delete character on the cursor |
CTRL-Z | Toggle selection |
CTRL-R | Toggle fuzzy option |
Enter | Decide |
CTRL-D,CTRL-C,ESC | Cancel |
Option | Description |
---|---|
-f | Fuzzy match |
-x | Exit code for cancel (default: 1) |
-d [path] | Specify root directory |
-a | Register action keys |
-t | Open via Vim's Terminal API |
-tf [funcname] | Terminal API's function name |
gof -t
orgof -tf [prefix]
opens selected files in Vim usingTerminal API.If you want to add
-t
option automatically whether you are inside Vimterminal or not, you can define alias like this
gof() {if ["$VIM_TERMINAL" ];thencommand gof -t"$@"elsecommand gof"$@"fi}
- If you are familiar with Vim script, you may want to send
["call", "[funcname]", "[file information]"]
instead of["drop", "[filename]"]
. You can usegof -tf [funcname]
to sendcall
command
[file information] = { "filename": [relative filename path (string)], "fullpath": [absolute filename path (string)], "root_dir": [root directory (string)], "action_key": [action key of -a (string)]}
- You can define utility Vim command
:Gof
. Quickly callsgof -t
command andopens selected files in Vim buffer
ifexecutable('gof')command! -nargs=* Gofterm++close gof-tendif
- Please tryvargs if you want to communicate easily with Vim terminal API from shell
MIT
Yasuhiro Matsumoto (a.k.a mattn)
About
No description or website provided.
Topics
Resources
Stars
Watchers
Forks
Packages0
No packages published