From b814d2f4225b026047795e7a01bbf9742250a274 Mon Sep 17 00:00:00 2001 From: Subhaditya Nath Date: Sat, 31 Oct 2020 15:41:04 +0530 Subject: [PATCH] Make ^F scroll past EOL See: psliwka/vim-smoothie#11 --- autoload/smoothie.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoload/smoothie.vim b/autoload/smoothie.vim index 4dc3ac9..3df0e19 100644 --- a/autoload/smoothie.vim +++ b/autoload/smoothie.vim @@ -1,3 +1,5 @@ +let s:ctrl_f_invoked = v:false + if !exists('g:smoothie_update_interval') "" " Time (in milliseconds) between subseqent screen/cursor postion updates. @@ -59,6 +61,9 @@ function s:step_down() endif call s:execute_preserving_scroll("normal! 1\") return 0 + elseif s:ctrl_f_invoked && winline() > 1 + call s:execute_preserving_scroll("normal! \") + return 0 else return 1 endif @@ -185,6 +190,7 @@ endfunction "" " Smooth equivalent to ^D. function smoothie#downwards() + let s:ctrl_f_invoked = v:false call s:count_to_scroll() call s:update_target(&scroll) endfunction @@ -192,6 +198,7 @@ endfunction "" " Smooth equivalent to ^U. function smoothie#upwards() + let s:ctrl_f_invoked = v:false call s:count_to_scroll() call s:update_target(-&scroll) endfunction @@ -199,11 +206,13 @@ endfunction "" " Smooth equivalent to ^F. function smoothie#forwards() + let s:ctrl_f_invoked = v:true call s:update_target(winheight(0) * v:count1) endfunction "" " Smooth equivalent to ^B. function smoothie#backwards() + let s:ctrl_f_invoked = v:false call s:update_target(-winheight(0) * v:count1) endfunction