Ⅰ. 插件描述
Visual Studio Code like workspace support for Vim and Neovim. Not actively maintainedⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'andreyorst/simpleworkspaces-vim'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'andreyorst/simpleworkspaces-vim'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'andreyorst/simpleworkspaces-vim'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/andreyorst/simpleworkspaces.vim
Ⅳ. 文档说明
# Maintenance warning
I'm not using Vim as my primary editor anymore, therefore I'm not writing
Vim Script and not using this plugin. My focus shifted to
Kakoune editor, which I do like more than Vim and its
scripting model is more appealing to me. This plugin works, it is capable to do
many things, but currently I'm not using it and not planning to. Therefore if
Vim will change somehow that this plugin will stop working I will not know about
it and will not be able to fix it. I'll gradually accept pull request that fixes
the problem, but that's it. If you want to take the task of maintenance and
improvement of this plugin, contact me via e-mail or
open an issue I'll provide an ownership for this repository, or add a note about
currently maintained fork.
SimpleWorkspaces.vim
SimpleWorkspaces.vim is a plugin, which provides a Visual Studio Code like
workspace feature to Vim and Neovim.
For those who never used VS Code, or Atom, workspace in general is a certain
area, where are all your files are accessible by editor features, like fuzzy
file finding, search for file contents recursively, etc. You can add specific
folders or files to workspace, so you could search over them. Usually workspaces
are useful when you need to work on certain part of a huge project, and you
don't need other files. By adding only workflow related files and folders to
workspace, so you'll be able to open those files with different fuzzy matchers,
like fzf, Denite, CtrlP, and even Vim's wildcards, and unnecessary files will
not stand in your way. Or for example you need to work with two or more projects
alongside, or just add a separate folder to current project. Workspaces allow
you to do it.
You can read more about workspaces at Visual Studio Code
docs.
Install
If you're using vim-plug, add this to
your .vimrc or init.vim:
Plug 'andreyorst/SimpleWorkspaces.vim'Then:
:w | so % | PlugInstallUsage
After installation new commands will be added to Vim:
:WorkspaceInit- creates new workspace and adds current directory to it;:WorkspaceOpen- Opens existing workspace:WorkspaceAdd- adds file or directory to current workspace:WorkspaceDelete- removes file or directory from current workspace:WorkspaceQuit- exits workspace:WorkspaceSave- save workspace with a meaningful name
More deep explanations are available in docs.
This plugin will ask you to create a workspace prefix, which is a directory
where workspaces are stored. By default it is ~/.cache/vim_workspaces, if you
don't want your workspaces to stay after reboot, or want to use different
directory, consider using g:workspace_prefixvariable.
You can automatically open your last workspace on Vim startup, by setting
variable g:open_previous_workspace to 1.
How it works
This plugin uses symbolic links, to add files and folders to workspace. Because
symbolic links are just files in a workspace folder, you can use external tools
like grep or fzf on them. Most of the plugins can work through symlincs. Some
tools like gitgrep may require special flags to follow symbolic links. Pay
attention to such things.
Windows support is experimental, because it is not POSIX compatible, and it uses
different way of managing symbolic links. This needs more testing, but I don't
use Vim on windows, so feedback is always appreciated.
About
This plugin is created and being maintained by
@andreyorst.
It is being tested against Vim 8.0, Vim 7.4.1689 and neovim 0.3.*. Other versions
are not officially supported, but might work. If you found an issue, or want to
propose a change, you're welcome to do so at SimpleWorkspaces.vim GitHub
repository: https://github.com/andreyorst/SimpleWorkspaces.vim