Saturday, April 4, 2009

How to use script highlight on 'less' (vim)


The title might be a bit misleading. As far as I know 'less' does not support script highlight (please correct me if I'm wrong). However I did find out that vim has a built-in script that allows you to use it as less.

So here's a very simple solution, add an alias to your ~/.bashrc pointing the vim script:

alias lessv='/usr/share/vim/vim71/macros/less.sh'

You can see from the screenshot bellow that the file is open as read-only and not modifications are allowed. Some of 'less' commands (like “q” to quit) are also replicated.



1 comment:

zippy1981 said...

Thats great to know. I'm trying to get that working in vim for windows.