Ⅰ. 插件描述
Redmine wiki syntax highlighting for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 's3rvac/vim-syntax-redminewiki'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 's3rvac/vim-syntax-redminewiki'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 's3rvac/vim-syntax-redminewiki'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/s3rvac/vim-syntax-redminewiki
Ⅳ. 文档说明
Redmine Wiki Syntax For Vim
A Vim syntax-highlighting file for the Redmine wiki.
Installation
If you use pathogen, simply go into
the bundle directory and clone the repository in there:
cd ~/.vim/bundle
git clone https://github.com/s3rvac/vim-syntax-redminewiki.gitYou can also install the plugin manually by copying thesyntax/redminewiki.vim
file to your ~/.vim/syntax directory. If that directory does not exist,
create it.
Usage
When you edit a Redmine wiki page in Vim, execute :set ft=redminewiki to
select the Redmine wiki highlighting (make sure that you have enabled syntax
highlighting). Alternatively, you can put the following autocommand to your.vimrc:
" Consider all .redmine files as Redmine wiki files.
au BufNewFile,BufRead *.redmine set filetype=redminewikiwhere redmine is the suffix of your Redmine wiki files.
If you use the It's All Text Firefox
plugin to edit textareas in Vim, you can add something along these lines to
your .vimrc:
let s:opened_file_path = expand('%:p')
if s:opened_file_path =~ '\.mozilla/firefox/.*redmine'
au BufRead,BufNewFile *.txt set filetype=redminewiki
endifThen, when you launch Vim to edit a Redmine page (e.g. wiki or issue), a proper
file type will be selected automatically. Of course, this can be set up also
for other browser plugins, such as
Vimperator. You just need to adjust the
regular expression matching s:opened_file_path.
Credits
This syntax file is heavily based on the
textile.vim syntax file by Kornelius
Kalnbach <korny@cYcnus.de>, 2006.