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