Opens the file manager or terminal at the directory of the current file in Vim.
gof
: Go to the directory of the current file in the File manager
goF
: Go to the working directory (:pwd
)got
: Go to the directory of the current file in the Terminal
goT
: Go to the working directory (:pwd
)g:gtfo#terminals
Optional dictionary with one or more of the following keys: win
, mac
, unix
The g:gtfo#terminals.<key>
value is the name (or absolute path) of
a terminal program followed by the necessary flags (-e
, /k
, etc.) for
executing a command on startup.
Special case (OS X): To use iTerm instead of Terminal.app, use the special value "iterm":
let g:gtfo#terminals = { 'mac': 'iterm' }
got
opens a new tmux pane.got
opens a new mintty console.gof
opens Windows Explorer.got
opens g:gtfo#terminals['win']
or the first terminal it can find:
"Git bash", mintty, or cmd.exe.let g:gtfo#terminals = { 'win': 'pwsh' }
let g:gtfo#terminals = { 'win': 'powershell -NoLogo -NoExit -Command' }
let g:gtfo#terminals = { 'win': 'cmd.exe /k' }
gof
opens Finder.got
opens Terminal.app unless Vim is running in iTerm or g:gtfo#terminals['mac']
is set.let g:gtfo#terminals = { 'mac': 'iterm' }
gof
opens the file manager dictated by
xdg-open
.got
opens $SHELL
inside gnome-terminal
unless g:gtfo#terminals['unix']
is set.
let g:gtfo#terminals = { 'unix': 'termite -d' }
let g:gtfo#terminals = { 'unix': 'urxvt -cd' }
cd ~/.vim/bundle && git clone git://github.com/justinmk/vim-gtfo.git
Plug 'justinmk/vim-gtfo'
to .vimrc:PlugInstall
got
(orgof
) doesn't work
Try :verbose map gof
to see if some other plugin is using that mapping.
On Linux without a gui,
gof
does nothing, or launches w3m
xdg-open
defaults to w3m if no GUI is available (eg, in ssh or tty console).
To change the default: xdg-mime default application/x-directory foo
Copyright © Justin M. Keyes. MIT license.