Ⅰ. 插件描述
Basic syntax highlighting for the ROOT Data Analysis FrameworkⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'parnmatt/vim-root'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'parnmatt/vim-root'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'parnmatt/vim-root'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/parnmatt/vim-root
Ⅳ. 文档说明
# vim-root
Basic syntax highlighting for the ROOT Data Analysis Framework
http://root.cern.ch/
Initially inspired by Theo Christoudias' plugin: [cern_root.vim][].
In contrast to [cern_root.vim][], this plugin is structured to work with
common Vim plugin managers. It attempts to be semantically correct,
which also allows seamless integration with both the PyROOT, as
well as the original C++ implementation.
Usage
There are several methods for activating this plugin's syntax
highlighting:
| Command | Short hand |
|---|---|
:setfiletype cpp.root | :setf cpp.root |
:set filetype=cpp.root | :se ft=cpp.root |
:set syntax=cpp.root | :se syn=cpp.root |
:setfiletype python.root | :setf python.root |
:set filetype=python.root | :se ft=python.root |
:set syntax=python.root | :se syn=python.root |
However, the methods that hold the most power, are those that are
set using an equality; it is easier to chain the syntax. Therefore
regardless of whether you are using the C++ implementation or
PyROOT, the following will include the syntax:
| Command | Short hand |
|---|---|
:set filetype+=.root | :se ft=.root |
:set syntax+=.root | :se syn=.root |
So long as Vim had detected the use of c, cpp or python before,
which it almost certainly would if you have the following in your vimrc.
filetype on
syntax enableAlthough setting the filetype is more semantically correct, there can
be some issues with plugins that use the &filetype variable to add
- If this occurs, then please inject the highlighting by
- the
&syntaxvariable, as described above.
Reïterating the safest method is to use:
:se syn+=.rootInstallation
Install this plugin by your preferred method. A few examples are given
below.
Vim Package Managers
You can install this using your favourite Vim package manager. If you
are not using a package manager, you may find it helpful.
There are many different package managers, and it is assumed you know
how to install the one of your choice and how to use them.
Vim Plug
(Author's suggestion)
Place this in your .vimrc:
Plug 'parnmatt/vim-root'
Then run the following in Vim:
:source $MYVIMRC
:PlugInstall
Vundle
Place this in your .vimrc:
Plugin 'parnmatt/vim-root'
Then run the following in Vim:
:source $MYVIMRC
:PluginInstall
For Vundle version < 0.10.2, replace Plugin with Bundle above.
NeoBundle
Place this in your .vimrc:
NeoBundle 'parnmatt/vim-root'
Then run the following in Vim:
:source $MYVIMRC
:NeoBundleInstall
Pathogen
Run the following in a terminal:
$ git clone https://github.com/parnmatt/vim-root ${VIMRUNTIME:-$HOME/.vim}/bundle/vim-root
Manual Installation
Clone this repository
$ git clone https://github.com/parnmatt/vim-rootPlace syntax file in Vim runtime path
$VIMRUNTIME/syntax/root.vim$ mkdir -p ${VIMRUNTIME:-$HOME/.vim}/syntax/ $ mv vim-root/syntax/root.vim ${VIMRUNTIME:-$HOME/.vim}/syntax/Remove repository
$ rm -rf vim-root
The above presumes you do not wish to keep the repository. If you do,
It is suggested to either hard- or soft-link the files, rather than
move them and delete the repository. This gives the added advantage of
updating the file when new commits are pulled.
Packages
Contributing
If you want to help improve vim-root, please refer to CONTRIBUTING.md.
License
vim-root is published under the MIT license (see LICENSE).