From: "BenoƮt PIERRE" Date: 2003-07-13T00:28:15+09:00 Subject: Re: Syntax highlighting pager (Was: Ruby T-Shirt Idea) --0F1p//8PRICkK4MW Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 12, 2003 at 05:34:37AM +0900, Josef 'Jupp' Schugt wrote: >=20 > Saluton! >=20 > * Tim Hammerquist; 2003-07-11, 12:27 UTC: > > Reminds me of an answer posted on the vim mailing list: > > =20 > > : > ...any ideas on how to make vim behave like the 'tail' command in u= nix? > > : >=20 > > :=20 > > : On my system "cp /usr/bin/tail /usr/local/bin/vim" does the trick, > > : though Vi compatibility is subsequently somewhat impaired. >=20 > That reminds me of something. Create a $HOME/.vimrc.more containing this: >=20 > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- >=20 > " No compatibility -- necessary for mappings to work. > set nocompatible >=20 > " Status line > set laststatus=3D0 > set cmdheight=3D1 > set nomodifiable " Only in version 6.0 > set readonly >=20 > " My xterms have a navy-blue background, so I need this line too. > set background=3Ddark > " Turn syntax on > syntax on >=20 > " Key bindings. > nmap b > nmap q :q > " To type the following line, type *two* C-V's followed by two > " spaces. This is how you map the spacebar. > nmap ^V nmap >=20 > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- >=20 > and alias "vmore" to "vim -u $HOME/.vimrc.more" and you have a pager > that does RUBY syntax highlighting. >=20 > Gis, >=20 > Josef 'Jupp' Schugt > --=20 > N'attribuez jamais =E0 la malice ce que l'incomp=E9tence explique ! > -- Napol=E9on >=20 also, I use a shell function rather than an alias, this way I can make it works when there is no parameters (reading from stdin) : vmore() { if [ $# -eq 0 ] then vim -u ~/.vim/rc.more - -c ':set nomodified' else vim -u ~/.vim/rc.more "$@" fi } --=20 Beno=EEt PIERRE =C9tudiant EPITA GISTR promo 2004 =2E-------------------------------------. [GnuPG FingerPrint] | Avoid the Gates of Hell. Use Linux | BDEE523CB7AE6D9DB4C0 |_____________________________________| 8B0288677E698B65CC35 --0F1p//8PRICkK4MW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/ECmRiGd+aYtlzDURAhIFAJ9bl5XjYNzoJMUDBtg3migIlFlfBgCePCT3 SgNDE2JnR67m0XhvelUcruY= =ItH2 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--