Ⅰ. 插件描述
VIM plugin for kamailio.cfg syntax highlightingⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'kamailio/vim-kamailio-syntax'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'kamailio/vim-kamailio-syntax'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'kamailio/vim-kamailio-syntax'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/kamailio/vim-kamailio-syntax
Ⅳ. 文档说明
Overview
Vim scripts to auto-detect Kamailio configuration files (aka kamailio.cfg)
and enable syntax highlighting for them. More about Kamailio can be found at:
Installation
Manual Installation
Run 'make install' in this folder, or:
- copy ftdetect/kamailio.vim to ~/.vim/ftdetect/kamailio.vim
- copy syntax/kamailio.vim to ~/.vim/syntax/kamailio.vim
Using Plugin Managers
As this is a regular Vim plugin, the 'make install' isn't strictly necessary; it can be installed used any plugin manager.
For example, for pathogen.vim you could simply copy and paste:
cd ~/.vim/bundle
git clone git://github.com/kamailio/vim-kamailio-syntax.git
Note that using the regular approach of plugin manager may cause the autodetection to fail in some cases. For instance, when when using the netrw plugin to open a file in a remote machine it works fine at first; but when the file is saved the detection fails, mainly because that plugin relies on the :filetype detect command, which only search for the first item of the 'runtimepath' option. Thus it is necessary to symlink or copy the file to the default location, outside the bundle directory:
ln -s ~/.vim/bundle/vim-kamailio-syntax/ftdetect/* ~/.vim/ftdetect/
Usage
Autodetection is based on .cfg extension and match of __#!KAMAILIO__,
#!SER__, (and other variants), __modparam or route keywords in
first 400 lines of file. You can enable syntax highlighting for files
not auto-detected with vim command:
setf kamailioEnjoy!