Improved Nano Syntax Highlighting Files. Forked: https://github.com/scopatz/nanorc
Go to file
Ricardo Fernández Serrata b2831a5ee4
fix a space in readme.md
2024-05-09 14:30:00 -04:00
.authors.yml Updated authorship for 2020.10.10 2020-10-10 14:25:18 -05:00
.gitignore initial rever 2019-10-17 16:14:51 -04:00
.mailmap Updated authorship for 2020.10.10 2020-10-10 14:25:18 -05:00
.travis.yml introduce travis/shellcheck 2017-12-28 01:31:13 -05:00
apacheconf.nanorc Color trailing whitespace green 2016-12-06 21:37:13 +01:00
arduino.nanorc Handle this the proper way 2019-12-02 18:58:54 +05:30
asciidoc.nanorc Update asciidoc.nanorc 2020-04-27 00:09:25 -04:00
asm.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
AUTHORS.rst Updated authorship for 2020.10.10 2020-10-10 14:25:18 -05:00
awk.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
batch.nanorc Add a link 2020-09-01 05:05:02 +08:00
c.nanorc Added highlighting for printf format specifiers 2020-08-27 09:44:59 -05:00
clojure.nanorc Update clojure.nanorc 2016-08-30 13:02:50 -07:00
cmake.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 2019-12-18 11:13:13 -05:00
coffeescript.nanorc coffeescript regex escapes fixed 2016-07-17 18:49:37 +08:00
colortest.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
conf.nanorc Color trailing whitespace green 2016-12-06 21:47:45 +01:00
conky.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
creole.nanorc Fix collisions between lists and emphasis 2020-06-08 12:29:48 +02:00
csh.nanorc Add files via upload 2017-07-16 05:27:32 +03:00
csharp.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
css.nanorc * CSS Syntax highlighting: highlight .less files 2019-12-18 09:41:41 -05:00
csv.nanorc Add rainbow CSV highlighting rules (12 column coverage) 2019-01-04 16:43:43 +02:00
cython.nanorc Color trailing whitespace green 2016-12-06 21:56:28 +01:00
Dockerfile.nanorc Add missing keywords to Dockerfile 2019-03-15 08:31:46 +01:00
dot.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
dotenv.nanorc add .env file syntax highlight 2018-06-13 16:15:43 +02:00
elixir.nanorc basic elixir highlighting 2019-07-21 21:40:02 -07:00
email.nanorc * Email: Use extension, allow spaces after quote indent 2020-04-19 17:33:58 -04:00
erb.nanorc Color trailing whitespace green 2016-12-06 21:58:21 +01:00
etc-hosts.nanorc fix a typo 2018-12-13 10:50:46 +01:00
fish.nanorc * Syntax Files: Detect more files for highlighting 2019-12-18 09:34:49 -05:00
fortran.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 2019-12-18 11:13:13 -05:00
fsharp.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
gemini.nanorc Add support for Gophermap and Gemini markdown files 2020-04-24 09:22:09 -05:00
genie.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
gentoo.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 2019-12-18 11:13:13 -05:00
git.nanorc For conformity, color trailing whitespace green, not red 2016-12-06 22:41:58 +01:00
gitcommit.nanorc added alias to gitcommit for backwards compatibility in nanorc files 2013-05-31 15:45:45 -05:00
glsl.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
go.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
gophermap.nanorc Add support for Gophermap and Gemini markdown files 2020-04-24 09:22:09 -05:00
gradle.nanorc Add Gradle syntax highlighting 2019-10-02 16:42:17 +05:30
groff.nanorc Update groff.nanorc 2020-04-30 21:10:06 -04:00
haml.nanorc Color trailing whitespace green 2016-12-06 22:00:19 +01:00
haskell.nanorc Improve haskell.nanorc 2020-04-08 09:16:57 -04:00
hcl.nanorc fix(hcl): quote syntax name to improve v2.9 support 2020-03-18 14:09:28 +13:00
html.j2.nanorc Symlink html.j2.nanorc -> html.nanorc for people using extendsyntax on it 2019-01-05 16:47:53 +02:00
html.nanorc Highlight second curly bracket in html.nanorc 2020-10-08 18:43:13 +03:00
i3.nanorc Added i3 windows manager config file syntax 2017-01-23 11:00:40 -06:00
ical.nanorc Create ical.nanorc 2016-09-30 08:56:06 +02:00
ini.nanorc comment color for visibility on dark terminals 2020-11-08 09:00:24 +01:00
inputrc.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
install.sh Update to install.sh 2020-01-30 23:28:08 -06:00
jade.nanorc Added each and for loops 2019-04-28 04:01:57 +02:00
java.nanorc Fixed higlighting of inline comments in java.nanorc 2020-08-27 09:18:20 -05:00
javascript.nanorc Also highlight TypeScript (.ts) as JavaScript 2020-11-21 23:28:55 +01:00
js.nanorc feat(js): format template strings 2020-04-16 12:33:49 +12:00
json.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 2019-12-18 11:13:13 -05:00
keymap.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
kickstart.nanorc Change tab coloring behavior for several rc's 2015-10-24 06:58:36 -04:00
kotlin.nanorc kotlin: add sealed as a class modifier 2020-06-20 23:03:33 +05:30
ledger.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
license whoops needed to do add 2014-03-04 22:54:17 -06:00
lisp.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
lua.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
m3u.nanorc Fixed main header highlighting 2020-02-09 11:57:37 +02:00
makefile.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
man.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
markdown.nanorc Fixing quotes that span more than one line. 2017-12-20 23:49:51 -06:00
moonscript.nanorc Add support for MoonScript 2020-05-05 06:46:23 -05:00
mpdconf.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
mutt.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
nanorc Merge pull request #150 from ritiek/patch-1 2019-10-18 13:07:13 -04:00
nanorc.nanorc Merge pull request #269 from earboxer/colornanorc 2019-12-18 14:19:22 -05:00
nginx.nanorc Fix #299: Make comments not black in nginx syntax 2020-04-12 09:30:31 -04:00
nmap.nanorc Add files via upload 2019-04-07 23:05:34 +08:00
ocaml.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
octave.nanorc Create octave.nanorc 2019-04-24 20:07:13 -05:00
patch.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
peg.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
perl.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
perl6.nanorc Add pl6 pm6 extensions 2019-03-07 11:44:55 -06:00
php.nanorc * PHP: Make paamayim nekodotayim same color as arrow 2020-07-15 14:52:33 -04:00
pkg-config.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
pkgbuild.nanorc pkgbuild: Add sha224sums and changelog 2018-12-04 11:26:47 +01:00
po.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 2019-12-18 11:13:13 -05:00
pov.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
powershell.nanorc Add PowerShell syntax file 2020-08-10 18:42:56 +05:30
privoxy.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
prolog.nanorc fix(prolog): quote syntax name to improve v2.9 support 2020-03-18 14:10:35 +13:00
properties.nanorc highlighting file for Java .properties files 2020-03-21 16:18:26 +01:00
pug.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
puppet.nanorc Fixed typo (and changed color) for trailing whitespace 2016-12-06 19:11:24 +01:00
python.nanorc Added highlighting for bool and ___bool__ 2020-08-26 19:13:33 +02:00
readme.md fix a space in readme.md 2024-05-09 14:30:00 -04:00
rego.nanorc Add support for Rego 2020-12-17 09:42:22 +01:00
reST.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
rever.xsh rever fix 2019-10-17 16:34:06 -04:00
Rnw.nanorc Fix regex error in Rnw.nanorc 2019-10-02 11:08:36 +02:00
rpmspec.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
ruby.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
rust.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
scala.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
sed.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
sh.nanorc Merge remote-tracking branch 'origin/master' into morefiles 2019-12-18 15:23:01 -05:00
shellcheck.sh introduce travis/shellcheck 2017-12-28 01:31:13 -05:00
sieve.nanorc Add Sieve script syntax 2020-05-08 12:15:24 -05:00
sls.nanorc Color trailing whitespace green 2016-12-06 22:17:01 +01:00
sparql.nanorc GH-333 initial sparql support 2020-10-07 18:32:33 +02:00
sql.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
svn.nanorc add syntax highlight for svn commit file 2018-04-03 22:49:51 +02:00
swift.nanorc Handle this the proper way 2019-12-02 18:58:54 +05:30
systemd.nanorc systemd .timer & comments color for dark terminal 2020-11-22 11:42:58 +01:00
tcl.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
tex.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 2019-12-18 11:20:31 -05:00
toml.nanorc Add copyright notice 2020-02-04 11:19:43 -08:00
ts.nanorc Fix typo: "cotal" => "octal" 2020-11-19 16:49:48 +01:00
twig.nanorc * Syntax Files: Detect more files for highlighting 2019-12-18 09:34:49 -05:00
vala.nanorc Fix block comments highlighting 2019-12-22 16:57:25 +05:30
verilog.nanorc Handle this the proper way 2019-12-02 18:58:54 +05:30
vi.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
x11basic.nanorc Added nanorc file for X11-Basic (BASIC programming language) 2019-06-05 12:45:35 +02:00
xml.nanorc - syntax: Add a few more file endings 2019-12-18 22:08:43 -05:00
xresources.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
yaml.nanorc Add a red highlight to YAML lines with trailing whitespace 2020-08-14 13:04:24 +02:00
yum.nanorc Rename syntax definitions 2016-03-02 20:51:19 +01:00
zig.nanorc Added support for Zig 2020-10-02 00:46:00 -07:00
zsh.nanorc Add .zsh-theme ext to zsh.nanorc 2018-02-04 12:18:29 -05:00
zshrc.nanorc Adds missing zshrc symlink 2015-09-19 22:21:48 -04:00

Improved Nano Syntax Highlighting Files

This repository holds {lang}.nanorc files that have improved definitions of syntax highlighting for various languages.

Installation

There are three ways to install this repo.

1. Automatic installer

Copy the following code to download and run the installer script:

curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh

If your machine doesn't have curl command, use this code:

wget https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh -O- | sh

This automatically unpacks all the .nanorc files to ~/.nano.

Note

Some syntax definitions which exist in Nano upstream may be preferable to the ones provided by this package.
The install.sh script may be run with -l or --lite to insert the included syntax definitions from this package with lower precedence than the ones provided by the standard package.

2. Package managers

The follow table lists all systems with this package published.
Feel free to add your official package manager.

Systems that are based in others' package managers or repositories are compatible. For example: pacman based systems are compatible with Arch Linux.

System Command
Arch Linux pacman -S nano-syntax-highlighting

3. Clone repo (copy the files)

The files should be placed inside of the ~/.nano/ directory.

You can put the files in another directory inside the correct .nano folder. For example: ~/.nano/nanorc/. For readability will use $install_path for the path of your choose (in system wide the path is always /usr/share/nano-syntax-highlighting/).

For user, only run:

git clone git@github.com:scopatz/nanorc.git $install_path or
git clone https://github.com/scopatz/nanorc.git $install_path

For system wide, run:

sudo git clone https://github.com/scopatz/nanorc.git $install_path

Configuration

After installation, you need to inform nano to used the new highlight files. The configuration file is located at ~/.nanorc, for users, and at /etc/nanorc, for system wide. If this file doesn't exist, create a new one.

Again there are three ways:

1. Include all

Append the content of the folder in one line, with wildcard:

echo "include $install_path/*.nanorc" >> ~/.nanorc or
echo "include $install_path/*.nanorc" >> /etc/nanorc

2. Include/append our nanorc file

Simply run:

cat $install_path/nanorc >> ~/.nanorc or
cat $install_path/nanorc >> /etc/nanorc

3. One by one

Add your preferable languages one by one into the file. For example:

## C/C++
include "~/.nano/c.nanorc"

Tricks & Tweaks

MacOS

\< and \> are regular character escapes on MacOS.
The bug is fixed in Nano, but this might be a problem if you are using an older version
If this is the case, replace them respectively with [[:<:]] and [[:>:]]. This is reported in Issue 52.

Why not include the original files?

Good question! It's due to the way that nano reads the files, the regex instructions should be in a specific order which is evident in some nanorc files. And if we use the include or extendsyntax commands, the colors or other things may not work as expected.
The best way to make changes is by copying and editing the original files.
Please see this issue.
But if some original nanorc file needs an update, feel free to patch it!

My shortcut is not working!

Please see this issue.

Acknowledgements

Some of these files are derived from the original Nano editor repo