Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 1.67 KB

README.md

File metadata and controls

42 lines (26 loc) · 1.67 KB

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 kamailio

Enjoy!