Skip to content

Instantly share code, notes, and snippets.

@Jagua
Created January 1, 2017 08:47
Show Gist options
  • Save Jagua/1095c4130e869f04cae21c576232e067 to your computer and use it in GitHub Desktop.
Save Jagua/1095c4130e869f04cae21c576232e067 to your computer and use it in GitHub Desktop.
nnoremap <SID>[Scroll] <Nop>
if 0
nmap j j<SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]j
\ (line('.') == line('$') ? "L\<SID>[Scroll]" : "j\<SID>[Scroll]")
nmap k k<SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]k
\ (line('.') == 1 ? "H\<SID>[Scroll]" : "k\<SID>[Scroll]")
endif
nmap <C-d> <C-d><SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]d
\ (line('.') == line('$') ? "L\<SID>[Scroll]" : "\<C-d>\<SID>[Scroll]")
nmap <C-u> <C-u><SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]u
\ (line('.') == 1 ? "H\<SID>[Scroll]" : "\<C-u>\<SID>[Scroll]")
nmap <C-f> <C-f><SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]f
\ (line('.') == line('$') ? "L\<SID>[Scroll]" : "\<C-f>\<SID>[Scroll]")
nmap <C-b> <C-b><SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]b
\ (line('.') < winheight(0) ? "H\<SID>[Scroll]" : "\<C-b>\<SID>[Scroll]")
nmap <C-e> <C-e><SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]e
\ (line('.') == line('$') ? "L\<SID>[Scroll]" : "\<C-e>\<SID>[Scroll]")
nmap <C-y> <C-y><SID>[Scroll]
nnoremap <script><expr> <SID>[Scroll]y
\ (line('.') == 1 ? "H\<SID>[Scroll]" : "\<C-y>\<SID>[Scroll]")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment