Idea for this script borrowed from a friend. Found the original here. This is pipe-able if you add a ‘-’ after ‘vim’ in the alias, but this will break regular file viewing (or you could just use ‘less’ since this won’t give you syntax highlighting on your piped stuff anyway). I added an ‘!’ to the keybinding for ‘q’ so vim won’t complain, it’s not like you’re going to be writing to anything anyway.
” alias vmore=”vim -u ~/.vimrc.more”
” No compatibility — necessary for mappings to work.
set nocompatible” Status line
set laststatus=0
set cmdheight=1
set nomodifiable ” Only in version 6.0
set readonly” Syntax colouring — lines taken from syntax.txt discussion on colour xterms.
” See ‘:help color-xterm’. Use appropriate lines for your own set-up.
if has(”terminfo”)
set t_Co=16
set t_Sf=[3%p1%dm
set t_Sb=[4%p1%dm
else
set t_Co=16
set t_Sf=[3%dm
set t_Sb=[4%dm
endif
” My xterms have a navy-blue background, so I need this line too.
set background=dark
” Turn syntax on
syntax on” Key bindings.
nmap b <C-B><C-G>
nmap q :q!<CR>
” To type the following line, type *two* C-V’s followed by two spaces. This
” is how you map the spacebar.
nmap ^V <C-F><C-G>