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 f71033167d
Merge pull request #150 from ritiek/patch-1
Add kotlin
5 years ago
.authors.yml Updated authorship for 2019.10.17 5 years ago
.gitignore initial rever 5 years ago
.mailmap Updated authorship for 2019.10.17 5 years ago
.travis.yml introduce travis/shellcheck 6 years ago
AUTHORS.rst Updated authorship for 2019.10.17 5 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 Rename syntax definitions 8 years ago
asciidoc.nanorc Rename syntax definitions 8 years ago
asm.nanorc Rename syntax definitions 8 years ago
awk.nanorc Rename syntax definitions 8 years ago
c.nanorc Add "least", "fast" and "max" C fixed-width types 5 years ago
clojure.nanorc Update clojure.nanorc 8 years ago
cmake.nanorc Highlight whitespace 8 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
csh.nanorc Add files via upload 7 years ago
csharp.nanorc Rename syntax definitions 8 years ago
css.nanorc Color trailing whitespace green 7 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 Rename syntax definitions 8 years ago
dotenv.nanorc add .env file syntax highlight 6 years ago
elixir.nanorc basic elixir highlighting 5 years ago
email.nanorc Rename syntax definitions 8 years ago
erb.nanorc Color trailing whitespace green 7 years ago
etc-hosts.nanorc fix a typo 5 years ago
fish.nanorc Rename syntax definitions 8 years ago
fortran.nanorc Color trailing whitespace green 7 years ago
fsharp.nanorc Fix fsharp.nanorc formatting issues 5 years ago
genie.nanorc Add comments 7 years ago
gentoo.nanorc Rename syntax definitions 8 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 Rename syntax definitions 8 years ago
go.nanorc Rename syntax definitions 8 years ago
gradle.nanorc Add Gradle syntax highlighting 5 years ago
groff.nanorc Rename syntax definitions 8 years ago
haml.nanorc Color trailing whitespace green 7 years ago
haskell.nanorc Color trailing whitespace green 7 years ago
hcl.nanorc Changed author 6 years ago
html.j2.nanorc Symlink html.j2.nanorc -> html.nanorc for people using extendsyntax on it 5 years ago
html.nanorc Update HTML highlighting ruleset and merge J2 templating rules into it 5 years ago
i3.nanorc Added i3 windows manager config file syntax 7 years ago
ical.nanorc Create ical.nanorc 8 years ago
ini.nanorc Add cfg extension to ini file rules 5 years ago
inputrc.nanorc Rename syntax definitions 8 years ago
install.sh Remove useless checks, formatting 5 years ago
jade.nanorc Added each and for loops 5 years ago
java.nanorc Added basic number highlighting 8 years ago
javascript.nanorc javascript.nanorc - highlights ending brace too 5 years ago
js.nanorc Fix not balanced parentheses 6 years ago
json.nanorc Rename syntax definitions 8 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 Add copyright 7 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 Highlight trailing whitespaces 8 years ago
makefile.nanorc makefile: bightmagenta for start of lines beginning with += 8 years ago
man.nanorc Rename syntax definitions 8 years ago
markdown.nanorc Fixing quotes that span more than one line. 6 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 Add highlighting of colors after "set <keyword>" 5 years ago
nginx.nanorc Added missing proxy_ directives 6 years ago
nmap.nanorc Add files via upload 5 years ago
ocaml.nanorc Color trailing whitespace green 7 years ago
octave.nanorc Create octave.nanorc 5 years ago
patch.nanorc Rename syntax definitions 8 years ago
peg.nanorc Rename syntax definitions 8 years ago
perl.nanorc Color trailing whitespace green 7 years ago
perl6.nanorc Add pl6 pm6 extensions 5 years ago
php.nanorc fix PHP classes with underscore character 5 years ago
pkg-config.nanorc Rename syntax definitions 8 years ago
pkgbuild.nanorc pkgbuild: Add sha224sums and changelog 5 years ago
po.nanorc Rename syntax definitions 8 years ago
pov.nanorc Rename syntax definitions 8 years ago
privoxy.nanorc Rename syntax definitions 8 years ago
prolog.nanorc Added prolog syntax highlighting 6 years ago
pug.nanorc Added each and for loops 5 years ago
puppet.nanorc Fixed typo (and changed color) for trailing whitespace 7 years ago
python.nanorc Add python keywords async and await to highlight list 5 years ago
reST.nanorc Rename syntax definitions 8 years ago
readme.md More convenient info. 5 years ago
rever.xsh rever fix 5 years ago
rpmspec.nanorc Rename syntax definitions 8 years ago
ruby.nanorc Color trailing whitespace green 7 years ago
rust.nanorc Color trailing whitespace green 7 years ago
scala.nanorc Updated Scala files extensions 5 years ago
sed.nanorc Rename syntax definitions 8 years ago
sh.nanorc Add missing builtins to sh.nanorc 5 years ago
shellcheck.sh introduce travis/shellcheck 6 years ago
sls.nanorc Color trailing whitespace green 7 years ago
sql.nanorc Rename syntax definitions 8 years ago
svn.nanorc add syntax highlight for svn commit file 6 years ago
swift.nanorc added Unicode and Integer Literals 8 years ago
systemd.nanorc Rename syntax definitions 8 years ago
tcl.nanorc For conformity, color trailing whitespace green, not blue 7 years ago
tex.nanorc Update tex.nanorc 8 years ago
ts.nanorc Add TypeScript language syntax highlight 5 years ago
vala.nanorc Rename syntax definitions 8 years ago
verilog.nanorc Added Verilog 6 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 Color trailing whitespace green 7 years ago
xresources.nanorc Rename syntax definitions 8 years ago
yaml.nanorc YAML comments are now grey/brightblue 6 years ago
yum.nanorc Rename syntax definitions 8 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

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.
Fell free to add your official package manager.

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

System Command
Arch Linux aurman -Ss nano-syntax-highlight
aurman -S nano-syntax-highlighting-git

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 onento 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?

It is a good question, but the way that nano reads the files matters.
In other words, the regex instructions should be in a specific order (you can see that in some nanorc files).
So, if we include or extendsyntax (yes, there is also this command) the colors or other things won't be work well.
The best way to do is copying and editing the original files (if it is needed).
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