Подсветка синтаксиса в
редакторе nano в CentOS
1. В
домашней директории пользователя создаем файл
#touch
~/.nanorc
2.
Открываем данный файл
#nano
~/.nanorc
3.
Добавляем туда строки обеспечивающие подсветку соответствующих языков:
## TeX
include "/usr/share/nano/patch.nanorc"
## POV-Ray
include "/usr/share/nano/pov.nanorc"
## Perl
include "/usr/share/nano/perl.nanorc"
## Nanorc files
include "/usr/share/nano/nanorc.nanorc"
## Python
include "/usr/share/nano/python.nanorc"
## C/C++
include "/usr/share/nano/c.nanorc"
## Groff
include "/usr/share/nano/groff.nanorc"
## Assembler
include "/usr/share/nano/asm.nanorc"
## Ruby
include "/usr/share/nano/ruby.nanorc"
## Manpages
include "/usr/share/nano/man.nanorc"
## HTML
include "/usr/share/nano/html.nanorc"
## Bourne shell scripts
include "/usr/share/nano/sh.nanorc"
## Sun Java
include "/usr/share/nano/java.nanorc"
include "/usr/share/nano/patch.nanorc"
## POV-Ray
include "/usr/share/nano/pov.nanorc"
## Perl
include "/usr/share/nano/perl.nanorc"
## Nanorc files
include "/usr/share/nano/nanorc.nanorc"
## Python
include "/usr/share/nano/python.nanorc"
## C/C++
include "/usr/share/nano/c.nanorc"
## Groff
include "/usr/share/nano/groff.nanorc"
## Assembler
include "/usr/share/nano/asm.nanorc"
## Ruby
include "/usr/share/nano/ruby.nanorc"
## Manpages
include "/usr/share/nano/man.nanorc"
## HTML
include "/usr/share/nano/html.nanorc"
## Bourne shell scripts
include "/usr/share/nano/sh.nanorc"
## Sun Java
include "/usr/share/nano/java.nanorc"
4.
Сохраняем файл (Ctrl + X)
5. Теперь,
если файл будет иметь расширение py (программа python), то открыв файл
редактором nano мы увидим подсветку синтаксиса.
Комментариев нет:
Отправить комментарий