Pages

Blog is moving

My blog is moving to http://victormendonca.com/blog/. If you are looking for a specific or older post you are in the right place Otherwise check out my new page for more up to date content.

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.