" Vim script to work like "less" " Maintainer: Bram Moolenaar " Last Change: 2001 May 03 set nocp syntax on set so=0 set hlsearch set incsearch nohlsearch " Used after each command: put cursor at end and display position if &wrap noremap L L0:file au VimEnter * normal L0 else noremap L Lg0:file au VimEnter * normal Lg0 endif " When reading from stdin don't consider the file modified. au VimEnter * set nomod " Can't modify the text set noma " Give help noremap h :call Help() map H h fun! s:Help() echo " One page forward b One page backward" echo "d Half a page forward u Half a page backward" echo " One line forward k One line backward" echo "G End of file g Start of file" echo "N% percentage in file" echo "\n" echo "/pattern Search for pattern" echo "n next pattern match N Previous pattern match" echo "\n" echo ":n Next file :p Previous file" echo "\n" echo "q Quit v Edit file" let i = input("Hit Enter to continue") endfun " Scroll one page forward noremap