Ⅰ. 插件描述
Tab-specific directoriesⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'oinksoft/tcd-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'oinksoft/tcd-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'oinksoft/tcd-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/vim-scripts/tcd.vim
Ⅳ. 文档说明
#tcd.vim: Tab-specific directories
For Vim version 7.x
This script is also available at http://www.vim.org/scripts/script.php?script_id=4431
Tcd lets you set a working directory for a specific tab. Great if you've
got a session open and are editing some file in another location on the
filesystem, and decide you need to open more files in that directory.
This plugin works particularly well in combination with NERD_Tree.vim
Global Commands
:Tcd <dir>
Changes the current working directory, but only in your current tab.
When you enter this tab, the specified path will become your current
working directory. Saves the real current working directory, so when you
exit this tab, you will return to your prior location.
Known Issues
- The "old cwd" (the one you switch to when leaving the tab in which
you called :Tcd) is set the first time you call :Tcd. This means
that if change your working directory later with the built-in :cd
command, this new location will be ignored when leaving :Tcd tabs.Workaround: Don't use :cd if you are still using :Tcd tabs.
Instead, call :Tcd in other tabs. I don't expect there to be a real
fix for this unless Vim adds some autocommand that is run whenever
the current working directory changes. "old cwd" is sometimes set incorrectly when using more than one
Tcd tab. When this happens, you will have your working directory
set to that of the previous :Tcd tab when switching to a non-:Tcd- This issue is intermittent.
Use the same workaround as in #1, using Tcd on problem tabs if this
happens.
Acknowledgements
Thanks to the following people for their help on this project:
joshcinirc.freenode.net##workingsetfor help making the
Makefile simpler and more effective.
License
tcd.vim is released under the MIT license. See the comments at the head
of tcd.vim for the full license text, or the "COPYING" file you should
have received with your copy of this software.