From d0497495f68920ca72c4bbd2314d65461bd631d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Tue, 25 Jul 2023 12:11:39 +0200 Subject: [PATCH] Added new custom function for fortigate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .config/nvim/init.vim | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ded6e37..702fa41 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -660,8 +660,20 @@ set grepprg=rg\ --vimgrep " Custom functions " function! RemoveForti() :%g/set uuid .*/d - :%g/set comments .*/d - :%s/edit .*/edit 0/g + :%g/set comment .*/d :%s/ \+//g + :%s/edit \(\d\{1,}\)/edit 0/g :g/^$/d endfunction + +function! RemoveFortiAddresses() + :e! + :%g/set uuid .*/d + :%g/set comment .*/d + :%s/ \+//g + :%s/edit \(\d\{1,}\)/edit 0/g + :%s/next\n/set allow-routing enable\rnext\r/g + :g/^$/d + :%!uniq + :w! +endfunction