VIM plugin for kamailio.cfg syntax highlighting

Daniel-Constantin Mierla 71d1d6b11c Merge pull request #1 from mMontu/pathogen_warning 9 years ago
ftdetect a0078532a8 utils/misc/vim: vim specific files migrated to name kamailio 11 years ago
syntax 94d8e1d7e0 utils/misc/vim: added few missing tokens to vim syntax highlighting 9 years 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 98f01c2232 Include details for alternative install method 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:

Install

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

alternative installation: 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!