Powered By

Powered by Blogger

Tampilkan postingan dengan label nano. Tampilkan semua postingan
Tampilkan postingan dengan label nano. Tampilkan semua postingan

Senin, 22 Februari 2010

PHP, CSS And XML Syntax Highlighting In Nano (Linux Text Editor)

nano text editor

A few days ago I was telling you about using syntax highlighting in Nano (Linux command line text editor). Unfortunately Nano doesn't come with syntax highlighting for some of the most used languages such as CSS, PHP and XML by default.

But thanks to Sckyzo, you can have syntax highlighting in Nano for those too. The package which will be downloaded using the command below will download syntax highlighting plugins for: PHP, CSS, XML, xorg.conf and Generic .conf. To install them all, simply paste this in a terminal:

wget http://blog.sckyzo.com/wp-content/nano-supplement.tar
tar -xvf nano-supplement.tar
sudo mv *nanorc /usr/share/nano
sudo rm /usr/share/nano/sourceslist.nanorc

The last command removes sourceslist.nanorc because I got 3 errors when trying to start nano because of it.

And finally, to enable syntax highlighting for these programming languages, open the nanorc file with the following command:
sudo nano /etc/nanorc

And paste this at the end of the file:
## Config Files (.ini)
include "/usr/share/nano/ini.nanorc"

## Xorg.conf
include "/usr/share/nano/xorg.nanorc"

## CSS
include "/usr/share/nano/css.nanorc"

## XML
include "/usr/share/nano/xml.nanorc"

## Generic .conf
include "/usr/share/nano/conf.nanorc"

## PHP
include "/usr/share/nano/php.nanorc"


Once again thanks to Sckyzo!

Rabu, 17 Februari 2010

Use Syntax Highlighting In Nano Editor [Quick Linux Tip]

nano syntax highlighting


Nano is an easy to use Linux shell text editor. Here is a very easy to follow tip to get syntax highlighting in Nano.


Enter this in a terminal (for Ubuntu):
sudo nano /etc/nanorc

And at the end of the file, paste this (or if this already exists in your nanorc file, remove the "#" before each "include" line):

## Nanorc files
include "/usr/share/nano/nanorc.nanorc"

## C/C++
include "/usr/share/nano/c.nanorc"

## HTML
include "/usr/share/nano/html.nanorc"

## TeX
include "/usr/share/nano/tex.nanorc"

## Quoted emails (under e.g. mutt)
include "/usr/share/nano/mutt.nanorc"

## Patch files
include "/usr/share/nano/patch.nanorc"

## Manpages
include "/usr/share/nano/man.nanorc"

## Groff
include "/usr/share/nano/groff.nanorc"

## Perl
include "/usr/share/nano/perl.nanorc"

## Python
include "/usr/share/nano/python.nanorc"

## Ruby
include "/usr/share/nano/ruby.nanorc"

## Java
include "/usr/share/nano/java.nanorc"

## Assembler
include "/usr/share/nano/asm.nanorc"

## Bourne shell scripts
include "/usr/share/nano/sh.nanorc"

## POV-Ray
include "/usr/share/nano/pov.nanorc"


Now close Nano and open the nanorc file again and see the difference:
nano /etc/nanorc