Replace the function call with a user command.
A user command is much more user-friendly than a function.
This commit is contained in:
parent
0c5a670463
commit
c11e41624b
1 changed files with 3 additions and 1 deletions
|
@ -26,7 +26,7 @@ function! s:IncrementSerial(old_date, old_nb)
|
||||||
return curr_date.curr_nb
|
return curr_date.curr_nb
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! DNSSerialUpdate()
|
function! s:DNSSerialUpdate()
|
||||||
let pattern = '\(\d\{8}\)\(\d\{2}\)\s*;\s*\cserial'
|
let pattern = '\(\d\{8}\)\(\d\{2}\)\s*;\s*\cserial'
|
||||||
if search(pattern) == 0
|
if search(pattern) == 0
|
||||||
echom "No serial found."
|
echom "No serial found."
|
||||||
|
@ -38,3 +38,5 @@ function! DNSSerialUpdate()
|
||||||
execute "s/".old_serial."/".new_serial."/"
|
execute "s/".old_serial."/".new_serial."/"
|
||||||
echom "Serial updated to ".new_serial."."
|
echom "Serial updated to ".new_serial."."
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
command! DNSSerialUpdate call s:DNSSerialUpdate()
|
||||||
|
|
Reference in a new issue