Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 189

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 190

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 191

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 192

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/script-loader.php on line 20

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/script-loader.php on line 23

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/script-loader.php on line 26

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/script-loader.php on line 29

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/script-loader.php on line 32

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/script-loader.php on line 35

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 193

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 194

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 195

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 196

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 197

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 198

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 199

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 200

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 201

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 202

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 203

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 204

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 205

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 206

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 207

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/class-http.php on line 11

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 208

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 209

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 210

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 211

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 212

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 213

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 214

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 215

Warning: require_once(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/class-requests.php on line 146

Warning: require_once(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/class-requests.php on line 146

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 216

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 217

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 218

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 219

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 220

Warning: require_once(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-includes/nav-menu-template.php on line 11

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 221

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 222

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 223

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 224

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 225

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 226

Warning: require(): Unable to allocate memory for pool. in /home/clecio/public_html/blog/wp-settings.php on line 227
Como habilitar Syntax Highlighting no Nano | Clécio Oliveira

Como habilitar Syntax Highlighting no Nano

Nano é um popular editor de texto que pode ser instalado sem a necessidade de um servidor X. O Nano já possui suporte Syntax Highlighting para linguagens de programação como: C, Perl, Python, PHP entre outras, porém por padrão vem desativado.
No entetando, para ativar é muito simples. Os arquivos de configurações se encontra no diretório:

/usr/share/nano/

Por exemplo, a saída do comando ls /usr/share/nano no meu computador:

# ls /usr/share/nano/
apache2.nanorc config.nanorc pov.nanorc js.nanorc python.nanorc apacheconf.nanorc config2.nanorc man.nanorc mutt.nanorc ruby.nanorc bash.nanorc config3.nanorc nanorc.nanorc patch.nanorc sh.nanorc c-file.nanorc css.nanorc perl.nanorc tex.nanorc xml.nanorc c.nanorc groff.nanorc php.nanorc html.nanorc xorg.nanorc conf.nanorc php2.nanorc java.nanorc

Essas são as regras das linguagens configuradas no meu computador. Caso você não encontre alguns arquivos de configurações para a linguagem que deseja, você pode acessar a página do Projeto Nanosyntax no Google Code baixar/copiar o código e criar o arquivo de configuração de acordo com a linguagem desejada em:

/usr/share/nano/php.nanorc

Para habilitar o Syntax Highlighting para uma determinada linguagem basta editar o arquivo ~/.nanorc. Será necessário criar este arquivo caso você não tenha. Em seguida, adicione as linhas dessa forma:

include “/usr/share/nano/php.nanorc”

E assim por diante, para cada linguagem que você deseja habilitar o Syntax Highlighting  é necessário ter a regra da linguagem na pasta /usr/share/nano e habilitá-la no arquivo ~/.nanorc.

Veja abaixo como ficou o Syntax Highlighting habilitado no Nano:

AFK

Um comentário

  1. Bino disse:

    Muito bom tutorial Clécio.

    []’s

Deixe um comentário

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d blogueiros gostam disto: