A resposta selecionada por James Baxter está incorreta.
Para ativar o realce de sintaxe para nano
no Cygwin, você precisará criar ~/.nanorc
, que é o arquivo que nano
procura ao carregar o realce de sintaxe.
Nesse arquivo, você deve incluir todas as instruções include
contendo caminhos para os arquivos de realce de sintaxe, que geralmente estão localizados em /usr/share/nano
.
O conteúdo do meu ~/.nanorc
:
include /usr/share/nano/asm.nanorc
include /usr/share/nano/autoconf.nanorc
include /usr/share/nano/awk.nanorc
include /usr/share/nano/c.nanorc
include /usr/share/nano/changelog.nanorc
include /usr/share/nano/cmake.nanorc
include /usr/share/nano/css.nanorc
include /usr/share/nano/debian.nanorc
include /usr/share/nano/default.nanorc
include /usr/share/nano/elisp.nanorc
include /usr/share/nano/fortran.nanorc
include /usr/share/nano/gentoo.nanorc
include /usr/share/nano/go.nanorc
include /usr/share/nano/groff.nanorc
include /usr/share/nano/guile.nanorc
include /usr/share/nano/html.nanorc
include /usr/share/nano/java.nanorc
include /usr/share/nano/javascript.nanorc
include /usr/share/nano/json.nanorc
include /usr/share/nano/lua.nanorc
include /usr/share/nano/makefile.nanorc
include /usr/share/nano/man.nanorc
include /usr/share/nano/mgp.nanorc
include /usr/share/nano/mutt.nanorc
include /usr/share/nano/nanorc.nanorc
include /usr/share/nano/nftables.nanorc
include /usr/share/nano/objc.nanorc
include /usr/share/nano/ocaml.nanorc
include /usr/share/nano/patch.nanorc
include /usr/share/nano/perl.nanorc
include /usr/share/nano/php.nanorc
include /usr/share/nano/po.nanorc
include /usr/share/nano/postgresql.nanorc
include /usr/share/nano/pov.nanorc
include /usr/share/nano/python.nanorc
include /usr/share/nano/ruby.nanorc
include /usr/share/nano/rust.nanorc
include /usr/share/nano/sh.nanorc
include /usr/share/nano/spec.nanorc
include /usr/share/nano/tcl.nanorc
include /usr/share/nano/tex.nanorc
include /usr/share/nano/texinfo.nanorc
include /usr/share/nano/xml.nanorc
A maneira mais fácil de fazer isso é simples:
ls -1 /usr/share/nano | sed 's@^@include /usr/share/nano/@' > ~/.nanorc
Se o seu /usr/share/nano
ainda não contém nenhum arquivo .nanorc
, apenas faça o download deles no repositório do Git .