diff --git a/README.md b/README.md index c5c8b1e..a910146 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,9 @@ I know this not the first vim plugin available to update a DNS-zone serial numbe * it lacks functionalities. It chose not to fork the original plugin but to write a new one from scratch mainly for legal purposes, but also because I did not found the code as simple as I expected. + + +Configuration +------------- + +You can turn off the automatic serial update by setting `let g:dnsserial_auto_update = 0` in your vimrc. diff --git a/ftplugin/bindzone.vim b/ftplugin/bindzone.vim index 7881921..8fb7aa6 100644 --- a/ftplugin/bindzone.vim +++ b/ftplugin/bindzone.vim @@ -13,7 +13,13 @@ " limitations under the License. -augroup dnsserial - autocmd! - autocmd BufWritePre DNSSerialUpdate -augroup END +if !exists('g:dnsserial_auto_update') + let g:dnsserial_auto_update = 1 +endif + +if g:dnsserial_auto_update + augroup dnsserial + autocmd! + autocmd BufWritePre DNSSerialUpdate + augroup END +endif