From c11e41624b1d71ffa48a83d09924d9109ce7c1ed Mon Sep 17 00:00:00 2001 From: Rodolphe Breard Date: Sun, 18 Oct 2015 19:23:09 +0200 Subject: [PATCH] Replace the function call with a user command. A user command is much more user-friendly than a function. --- plugin/dnsserial.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/dnsserial.vim b/plugin/dnsserial.vim index d246e67..421dbc2 100644 --- a/plugin/dnsserial.vim +++ b/plugin/dnsserial.vim @@ -26,7 +26,7 @@ function! s:IncrementSerial(old_date, old_nb) return curr_date.curr_nb endfunction -function! DNSSerialUpdate() +function! s:DNSSerialUpdate() let pattern = '\(\d\{8}\)\(\d\{2}\)\s*;\s*\cserial' if search(pattern) == 0 echom "No serial found." @@ -38,3 +38,5 @@ function! DNSSerialUpdate() execute "s/".old_serial."/".new_serial."/" echom "Serial updated to ".new_serial."." endfunction + +command! DNSSerialUpdate call s:DNSSerialUpdate()