A brief post on getting this done on Atom and Vim.


Just install language-haproxy Atom plugin through either Atom UI or apm .

apm install language-haproxy

When opening an haproxy.cfg file, Atom will detect and highlight accordingly.


Syntax highlighting in Vim for HAProxy configuration has been available for more than 10 years it seems from VimAwesome. To enable this, just clone the Github repository, copy the .vim file inside syntax/ folder to $HOME/.vim/syntax .

git clone https://github.com/vim-scripts/haproxy.git
mkdir -p $HOME/.vim/syntax 
cp haproxy/syntax/haproxy.vim $HOME/.vim/syntax/

Now add the following line to $HOME/.vimrc .

au BufRead,BufNewFile haproxy* set ft=haproxy

Now you should be able to see syntax highlighting enabled for HAProxy configuration files in Vim.

Written on July 13, 2017 by chamila de alwis.

Originally published on Medium