GitHub - justinmk/vim-gtfo: Go to Terminal or File manager
source link: https://github.com/justinmk/vim-gtfo
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
README.md
gtfo.vim ?
Opens the file manager or terminal at the directory of the current file in Vim.
Features
Mappings
gof
: Go to the current file's directory in the File managergoF
(uppercaseF
) opens the current working directory (:pwd
)
got
: Go to the current file's directory in the TerminalgoT
(uppercaseT
) opens the current working directory (:pwd
)
Settings
-
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' }
Platform Support
- tmux:
got
opens a new tmux pane. - mintty (Git-for-Windows,
Cygwin, etc.):
got
opens a new mintty console. - Windows
gof
opens Windows Explorer.got
opensg:gtfo#terminals['win']
or the first terminal it can find: "Git bash" (Git-for-Windows), mintty, or cmd.exe.- To use powershell:
let g:gtfo#terminals = { 'win': 'powershell -NoLogo -NoExit -Command' }
- To use ye olde cmd.exe:
let g:gtfo#terminals = { 'win': 'cmd.exe /k' }
- Mac OS X
gof
opens Finder.got
opens Terminal.app unless Vim is running in iTerm org:gtfo#terminals['mac']
is set.
To force iTerm (special case, see [above][#settings]):let g:gtfo#terminals = { 'mac': 'iterm' }
- Unix
gof
opens the file manager dictated byxdg-open
.got
opens$SHELL
insidegnome-terminal
unlessg:gtfo#terminals['unix']
is set.- To use termite:
let g:gtfo#terminals = { 'unix': 'termite -d' }
- To use rxvt-unicode:
let g:gtfo#terminals = { 'unix': 'urxvt -cd' }
- To use termite:
Installation
- Pathogen
cd ~/.vim/bundle && git clone git://github.com/justinmk/vim-gtfo.git
- vim-plug
- Add
Plug 'justinmk/vim-gtfo'
to .vimrc - Run
:PlugInstall
- Add
FAQ
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
Credits
- Sangmin Ryu, open-terminal-filemanager
- @tpope, for impeccable Vim plugin reference implementations
- EasyShell
- junegunn for some readme copy
License
Copyright © Justin M. Keyes. MIT license.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK