Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Commit

Permalink
Make ^F scroll past EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
subnut committed Oct 31, 2020
1 parent 74fef37 commit b814d2f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions autoload/smoothie.vim
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -59,6 +61,9 @@ function s:step_down()
endif
call s:execute_preserving_scroll("normal! 1\<C-D>")
return 0
elseif s:ctrl_f_invoked && winline() > 1
call s:execute_preserving_scroll("normal! \<C-E>")
return 0
else
return 1
endif
Expand Down Expand Up @@ -185,25 +190,29 @@ 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

""
" 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

""
" 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

0 comments on commit b814d2f

Please sign in to comment.