Ⅰ. 插件描述
Go to Terminal or File manager :point_right:Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'justinmk/vim-gtfo'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'justinmk/vim-gtfo'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'justinmk/vim-gtfo'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/justinmk/vim-gtfo
Ⅳ. 文档说明
gtfo.vim :point_right:
Opens the
file manager
or terminal at the
directory of the current file in Vim.
Features
Mappings
gof: Go to the directory of the current file in the File managergoF: Go to the working directory (:pwd)
got: Go to the directory of the current file in the TerminalgoT: Go to the working directory (:pwd)
Options
g:gtfo#terminalsOptional dictionary with one or more of the following keys:win,mac,unixThe
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:
gotopens a new tmux pane. - **mintty (Git-for-Windows,
Cygwin, etc.):**gotopens a new mintty console. Windows
gofopens Windows Explorer.gotopensg:gtfo#terminals['win']or the first terminal it can find:
"Git bash", 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
gofopens Finder.gotopens Terminal.app unless Vim is running in iTerm org:gtfo#terminals['mac']is set.<br/>
To force iTerm (special case, see above):let g:gtfo#terminals = { 'mac': 'iterm' }
Unix
gofopens the file manager dictated by
xdg-open.gotopens$SHELLinsidegnome-terminalunlessg: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' }
Installation
cd ~/.vim/bundle && git clone git://github.com/justinmk/vim-gtfo.git
- 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,
gofdoes 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.