http://vim.sourceforge.net/scripts/script.php?script_id=1649
"scrollfix.vim - keep cursor at fixed visual line of window"

" This plugin, scrollfix, maintains cursor at fixed visual line of window
" (except when near beginning of file and near end of file. The
" latter is configurable. You can choose whether to fix cursor
" near end of file or not, see g:fixeof below). This is enhancement
" to the 'set scrolloff=999' setting that allows any visual of
" window to keep cursor at, not only middle line of window.
"
" You choose the visual line of screen in percentages from top of
" screen. For example, setting 100 means lock cursor a bottom
" line of screen, setting 0 mean keep cursor at top line of
" screen, setting 50 means middle line of screen, setting 60
" (default) is about two-third from top of screen.
" As shipped, cursor is at 60% (let g:scrollfix=60)
" You control persentage of scrollfix in following ways:
" - :set g:scrollfix=NNN         " in vimrc. -1 disables plugin
" - edit file ~/.vim/plugin/scrollfix.vim, change number in line
"          let g:scrollfix=NNN
" - command :FIX NNN
"
" CONTROL VARIABLES:
" g:scrollfix - percentage from top of screen where to lock cursor
"               -1 - disables. Default: 60
" g:fixeof    - 1=>fix cursor also near end-of-file; 0=>no. Default:0
" g:scrollinfo - 1=>inform when scrollfix is turned on, 0=>no. Default: 1
"
" NB:
" - You need vim version at least 7.0.91 or later (vim6 won't work).
"   If you have vim7 before 7.0.91, you can use vimscript#1473 to build
"   & install the latest vim7 executable.
" - this is beta version of the scrollfix plugin.
"   Your feedback is welcome. Please send your feedback to iler at
gmail dot com.
"................................................................

install details
Download script scrollfix.vim from the link below and copy it into your
personal plugin directory, the ~/.vim/plugin. Create this directory if
it does not exist. Restart vim. Make sure your vim is version 7.0.91
or later.

To customize the plugin, edit this file:
   vim ~/.vim/plugin/scrollfix.vim
and edit following lines:
"------------------- Parameterization Variables -----------------------
let g:scrollfix=60  " percentable of screen height to keep visual cursor on
let g:fixeof=0  " 1=>fix cursor also near end-of-file; 0=>no.
let g:scrollinfo=1 " 1=>inform when scrollfix is turned on, 0=>no
"---------------- End of Parameterization Variables -------------------

Yakov

Reply via email to