I’ve been looking for a way to use less with syntax highlight and ended up in a page of Ubuntu Tutorials website with a very good tip: Using VIM as a syntax highlighting pager.
All you’ll need is the package vim-full, só, in Debian-like systems, you’ll need to execute:
# aptitude install vim-full
Then, you’ll have to execute:
$ vim -u /usr/share/vim/vim72/macros/less.vim <FILE>
And you have it working!
NOTE: Depending on the version of your VIM, the path to less.vim might be different.
You can make this command simpler by creating an alias and adding it to your .bashrc file:
$ echo "alias vless=\"vim -u /usr/share/vim/vim72/macros/less.vim\"" >> ~/.bashrc
Now the system will need to re-read your .bashrc file, so the changes may be applied:
And after this you can test vless:
Adding a codebox to your wordpress blog is really simple, all you have to do is download the one you want, upload it to wp-content/plugins directory in your blog, then you’ll have to access the admin page of your blog and activate it in the plugins section. Just as any other plugin.
I recommend CodeColorer plugin, the one i use here in my blog. CodeColorer is developed by Dmytro Shteflyuk, you can find it at it’s homepage: http://kpumuk.info/projects/wordpress-plugins/codecolorer. This plugins supports more than 100 languages.
After some customizations, my codebox is like this:
/* Hello World in C */
If you want to look for other highlight plugins you can find more at http://wordpress.org/extend/plugins/search.php?q=code+highlight.