VIM plugin for kamailio.cfg syntax highlighting

Daniel-Constantin Mierla b53860dd2c syntax: agname as keyword 8 months ago
ftdetect 85e1b0b7e1 detect file type also on ifndef 3 years ago
syntax b53860dd2c syntax: agname as keyword 8 months ago
.gitignore fabd8fcb42 added git ignore file 9 years ago
LICENSE 986fd1e82b readded license file after creating dedicated repo 9 years ago
Makefile 051e027b5f utils/misc/vim: added target in Makefile to remove old ser vim files 11 years ago
README.md d2571ad331 restructured installation section 9 years ago

README.md

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!