From d6add13a718e260b27a54c80d840f46206faf95d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 17 Jun 2018 15:00:23 +1200 Subject: Use autoload function for tidy filters --- vim/autoload/filter.vim | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 vim/autoload/filter.vim (limited to 'vim/autoload') diff --git a/vim/autoload/filter.vim b/vim/autoload/filter.vim new file mode 100644 index 00000000..f499f432 --- /dev/null +++ b/vim/autoload/filter.vim @@ -0,0 +1,7 @@ +" Run a filter over the entire buffer, but save the window position and +" restore it after doing so +function! filter#Stable(command) abort + let l:view = winsaveview() + execute '%' . a:command + call winrestview(l:view) +endfunction -- cgit v1.2.3