You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Go to file
Anthony Scopatz 1aa64a86cf
Merge pull request #345 from anderseknert/Rego
Add support for Rego
3 years ago
.authors.yml Updated authorship for 2020.10.10 4 years ago
.gitignore initial rever 5 years ago
.mailmap Updated authorship for 2020.10.10 4 years ago
.travis.yml introduce travis/shellcheck 6 years ago
AUTHORS.rst Updated authorship for 2020.10.10 4 years ago
Dockerfile.nanorc Add missing keywords to Dockerfile 5 years ago
Rnw.nanorc Fix regex error in Rnw.nanorc 5 years ago
apacheconf.nanorc Color trailing whitespace green 7 years ago
arduino.nanorc Handle this the proper way 4 years ago
asciidoc.nanorc Update asciidoc.nanorc 4 years ago
asm.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
awk.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
batch.nanorc Add a link 4 years ago
c.nanorc Added highlighting for printf format specifiers 4 years ago
clojure.nanorc Update clojure.nanorc 8 years ago
cmake.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 4 years ago
coffeescript.nanorc coffeescript regex escapes fixed 8 years ago
colortest.nanorc Rename syntax definitions 8 years ago
conf.nanorc Color trailing whitespace green 7 years ago
conky.nanorc Rename syntax definitions 8 years ago
creole.nanorc Fix collisions between lists and emphasis 4 years ago
csh.nanorc Add files via upload 7 years ago
csharp.nanorc Fix block comments highlighting 4 years ago
css.nanorc * CSS Syntax highlighting: highlight .less files 4 years ago
csv.nanorc Add rainbow CSV highlighting rules (12 column coverage) 5 years ago
cython.nanorc Color trailing whitespace green 7 years ago
dot.nanorc Fix block comments highlighting 4 years ago
dotenv.nanorc add .env file syntax highlight 6 years ago
elixir.nanorc basic elixir highlighting 5 years ago
email.nanorc * Email: Use extension, allow spaces after quote indent 4 years ago
erb.nanorc Color trailing whitespace green 7 years ago
etc-hosts.nanorc fix a typo 5 years ago
fish.nanorc * Syntax Files: Detect more files for highlighting 4 years ago
fortran.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 4 years ago
fsharp.nanorc Fix block comments highlighting 4 years ago
gemini.nanorc Add support for Gophermap and Gemini markdown files 4 years ago
genie.nanorc Fix block comments highlighting 4 years ago
gentoo.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 4 years ago
git.nanorc For conformity, color trailing whitespace green, not red 7 years ago
gitcommit.nanorc added alias to gitcommit for backwards compatibility in nanorc files 11 years ago
glsl.nanorc Fix block comments highlighting 4 years ago
go.nanorc Fix block comments highlighting 4 years ago
gophermap.nanorc Add support for Gophermap and Gemini markdown files 4 years ago
gradle.nanorc Add Gradle syntax highlighting 5 years ago
groff.nanorc Update groff.nanorc 4 years ago
haml.nanorc Color trailing whitespace green 7 years ago
haskell.nanorc Improve haskell.nanorc 4 years ago
hcl.nanorc fix(hcl): quote syntax name to improve v2.9 support 4 years ago
html.j2.nanorc Symlink html.j2.nanorc -> html.nanorc for people using extendsyntax on it 5 years ago
html.nanorc Highlight second curly bracket in html.nanorc 4 years ago
i3.nanorc Added i3 windows manager config file syntax 7 years ago
ical.nanorc Create ical.nanorc 8 years ago
ini.nanorc comment color for visibility on dark terminals 3 years ago
inputrc.nanorc Rename syntax definitions 8 years ago
install.sh Update to install.sh 4 years ago
jade.nanorc Added each and for loops 5 years ago
java.nanorc Fixed higlighting of inline comments in java.nanorc 4 years ago
javascript.nanorc Also highlight TypeScript (.ts) as JavaScript 3 years ago
js.nanorc feat(js): format template strings 4 years ago
json.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 4 years ago
keymap.nanorc Rename syntax definitions 8 years ago
kickstart.nanorc Change tab coloring behavior for several rc's 9 years ago
kotlin.nanorc kotlin: add sealed as a class modifier 4 years ago
ledger.nanorc Rename syntax definitions 8 years ago
license whoops needed to do add 10 years ago
lisp.nanorc Rename syntax definitions 8 years ago
lua.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
m3u.nanorc Fixed main header highlighting 4 years ago
makefile.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
man.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
markdown.nanorc Fixing quotes that span more than one line. 6 years ago
moonscript.nanorc Add support for MoonScript 4 years ago
mpdconf.nanorc Rename syntax definitions 8 years ago
mutt.nanorc Rename syntax definitions 8 years ago
nanorc Merge pull request #150 from ritiek/patch-1 5 years ago
nanorc.nanorc Merge pull request #269 from earboxer/colornanorc 4 years ago
nginx.nanorc Fix #299: Make comments not black in nginx syntax 4 years ago
nmap.nanorc Add files via upload 5 years ago
ocaml.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
octave.nanorc Create octave.nanorc 5 years ago
patch.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
peg.nanorc Rename syntax definitions 8 years ago
perl.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
perl6.nanorc Add pl6 pm6 extensions 5 years ago
php.nanorc * PHP: Make paamayim nekodotayim same color as arrow 4 years ago
pkg-config.nanorc Rename syntax definitions 8 years ago
pkgbuild.nanorc pkgbuild: Add sha224sums and changelog 5 years ago
po.nanorc * Nanorc: Copy comment syntax from nano 4.6 nanorcs 4 years ago
pov.nanorc Fix block comments highlighting 4 years ago
powershell.nanorc Add PowerShell syntax file 4 years ago
privoxy.nanorc Rename syntax definitions 8 years ago
prolog.nanorc fix(prolog): quote syntax name to improve v2.9 support 4 years ago
properties.nanorc highlighting file for Java .properties files 4 years ago
pug.nanorc Fix block comments highlighting 4 years ago
puppet.nanorc Fixed typo (and changed color) for trailing whitespace 7 years ago
python.nanorc Added highlighting for bool and ___bool__ 4 years ago
reST.nanorc Rename syntax definitions 8 years ago
readme.md Clarified where the .nanorc files are unpacked to 4 years ago
rego.nanorc Add support for Rego 3 years ago
rever.xsh rever fix 5 years ago
rpmspec.nanorc Rename syntax definitions 8 years ago
ruby.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
rust.nanorc Fix block comments highlighting 4 years ago
scala.nanorc Fix block comments highlighting 4 years ago
sed.nanorc Rename syntax definitions 8 years ago
sh.nanorc Merge remote-tracking branch 'origin/master' into morefiles 4 years ago
shellcheck.sh introduce travis/shellcheck 6 years ago
sieve.nanorc Add Sieve script syntax 4 years ago
sls.nanorc Color trailing whitespace green 7 years ago
sparql.nanorc GH-333 initial sparql support 4 years ago
sql.nanorc Rename syntax definitions 8 years ago
svn.nanorc add syntax highlight for svn commit file 6 years ago
swift.nanorc Handle this the proper way 4 years ago
systemd.nanorc systemd .timer & comments color for dark terminal 3 years ago
tcl.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
tex.nanorc * NanoRC Files: Copy linter and magic from nano 4.6 configs 4 years ago
toml.nanorc Add copyright notice 4 years ago
ts.nanorc Fix typo: "cotal" => "octal" 3 years ago
twig.nanorc * Syntax Files: Detect more files for highlighting 4 years ago
vala.nanorc Fix block comments highlighting 4 years ago
verilog.nanorc Handle this the proper way 4 years ago
vi.nanorc Rename syntax definitions 8 years ago
x11basic.nanorc Added nanorc file for X11-Basic (BASIC programming language) 5 years ago
xml.nanorc - syntax: Add a few more file endings 4 years ago
xresources.nanorc Rename syntax definitions 8 years ago
yaml.nanorc Add a red highlight to YAML lines with trailing whitespace 4 years ago
yum.nanorc Rename syntax definitions 8 years ago
zig.nanorc Added support for Zig 4 years ago
zsh.nanorc Add .zsh-theme ext to zsh.nanorc 6 years ago
zshrc.nanorc Adds missing zshrc symlink 9 years ago

readme.md

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