Coder Social home page Coder Social logo

nanorc's Introduction

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 [email protected]: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

nanorc's People

Contributors

andreadejangrande avatar astronautlevel2 avatar cirku17 avatar coffeetableespresso avatar creekpld avatar davidhcefx avatar dbkaplun avatar divinity76 avatar earboxer avatar elofu17 avatar esler avatar g-rath avatar gmcclins avatar hdquemada avatar htdebeer avatar mariuszs avatar mobluse avatar msfjarvis avatar nl6720 avatar ritiek avatar scopatz avatar simon-v avatar starlitghost avatar supersandro2000 avatar tenzer avatar thomasr avatar tjapro avatar willow385 avatar yochem avatar yzzyx-network avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nanorc's Issues

Trailing whitespace

Hi!

Please run:
cd ~/.nano/
grep ,green *

You will see that in 47 (out of 83) files, you highlight trailing whitespace as inverted green, like this:

color ,green "[[:space:]]+$"

This is great!
Could you please add the same to all files?

[coffeescript] Bad regex, Invalid range end

Since commit a983d29 I get the following error with nano 2.6.1

Error in /usr/share/nano-syntax-highlighting/coffeescript.nanorc on line 4: Bad regex "[!&|=/*+\-<>]|\<(and|or|is|isnt|not)\>": Invalid range end

Press Enter to continue starting nano.

Ruby addition

Add Capfile and Vagrantfile to the list of filenames to highlight as ruby. Capfile is for Capistrano, Vagrantfile is for Vagrant...

More issues with OSX

This is similar to #3, using nano 2.2.6 on OSX compiled by homebrew, I get errors in cython.nanorc, fish.nanorc and pkgbuild.nanorc:

Error in /usr/local/Cellar/nano/2.2.6/share/nano/cython.nanorc on line 5: Bad regex "cpdef [ 0-9A-Z_]+\(.*?\):": repetition-operator operand invalid

Error in /usr/local/Cellar/nano/2.2.6/share/nano/cython.nanorc on line 6: Bad regex "cdef cppclass [ 0-9A-Z_]+\(.*?\):": repetition-operator operand invalid

Error in /usr/local/Cellar/nano/2.2.6/share/nano/fish.nanorc on line 4: Command "magic" not understood

Error in /usr/local/Cellar/nano/2.2.6/share/nano/pkgbuild.nanorc on line 7: Bad regex "(\$|\$\{|\$\()(pkgbase|pkgname|pkgver|pkgrel|pkgdesc|arch|url|license)(|\}|\))": empty (sub)expression

Error in /usr/local/Cellar/nano/2.2.6/share/nano/pkgbuild.nanorc on line 10: Bad regex "(\$|\$\{|\$\()(depends|makedepends|optdepends|conflicts|provides|replaces)(|\}|\))": empty (sub)expression

Error in /usr/local/Cellar/nano/2.2.6/share/nano/pkgbuild.nanorc on line 13: Bad regex "(\$|\$\{|\$\()(groups|backup|noextract|options)(|\}|\))": empty (sub)expression

Error in /usr/local/Cellar/nano/2.2.6/share/nano/pkgbuild.nanorc on line 16: Bad regex "(\$|\$\{|\$\()(install|source|md5sums|sha1sums|sha256sums|sha384sums|sha512sums)(|\}|\))": empty (sub)expression

Multiline triple quotes in Python

The multiline triple quotes in Python tend to highlight most part of the document like it is a string. More particularly when you have multiple multiline triple quotes in a document (for instance when there are multiple documented functions).

What's weird is that the document looks okay when loading it. It considers everything as a doc string when adding a new line to the code...

Regex Errors

Hi! I am using apacheconf.nanorc on Centos 6.5 and I am getting a bunch of Regex errors

nano --version
 GNU nano version 2.2.6 (compiled 01:54:56, Nov 22 2010)
 (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
 2008, 2009 Free Software Foundation, Inc.
 Email: [email protected]    Web: http://www.nano-editor.org/
 Compiled options: --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8
Error in /usr/share/nano/apacheconf.nanorc on line 4: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 5: Command ""(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 6: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 7: Command ""(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 8: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 9: Command ""(Allow|AllowCONNECT|AllowEncodedSlashes|AllowOverride|Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 10: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 11: Command ""(Anonymous_VerifyEmail|AssignUserID|AuthAuthoritative|AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile|AuthDigestAlgorithm)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 12: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 13: Command ""(AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 14: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 15: Command ""(AuthGroupFile|AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 16: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 17: Command ""(AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl|AuthName|AuthType|AuthUserFile)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 18: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 19: Command ""(BrowserMatch|BrowserMatchNoCase|BS2000Account|BufferedLogs|CacheDefaultExpire|CacheDirLength|CacheDirLevels|CacheDisable|CacheEnable|CacheExpiryCheck)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 20: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 21: Command ""(CacheFile|CacheForceCompletion|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheIgnoreCacheControl|CacheIgnoreHeaders)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 22: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 23: Command ""(CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire|CacheMaxFileSize|CacheMinFileSize|CacheNegotiatedDocs|CacheRoot|CacheSize|CacheTimeMargin)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 24: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 25: Command ""(CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckSpelling|ChildPerUserID|ContentDigest|CookieDomain|CookieExpires|CookieLog|CookieName)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 26: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 27: Command ""(CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavLockDB|DavMinTimeout|DefaultIcon|DefaultLanguage|DefaultType)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 28: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 29: Command ""(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize|Deny|Directory|DirectoryIndex|DirectoryMatch|DirectorySlash)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 30: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 31: Command ""(DocumentRoot|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|Example|ExpiresActive|ExpiresByType)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 32: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 33: Command ""(ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FileETag|Files|FilesMatch|ForceLanguagePriority|ForceType|ForensicLog|Group|Header)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 34: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 35: Command ""(HeaderName|HostnameLookups|IdentityCheck|IfDefine|IfModule|IfVersion|ImapBase|ImapDefault|ImapMenu|Include|IndexIgnore|IndexOptions|IndexOrderDefault)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 36: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 37: Command ""(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer|KeepAlive|KeepAliveTimeout)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 38: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 39: Command ""(LanguagePriority|LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 40: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 41: Command ""(LDAPTrustedCA|LDAPTrustedCAType|Limit|LimitExcept|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 42: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 43: Command ""(LimitXMLRequestBody|Listen|ListenBackLog|LoadFile|LoadModule|Location|LocationMatch|LockFile|LogFormat|LogLevel|MaxClients|MaxKeepAliveRequests)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 44: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 45: Command ""(MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MCacheMaxObjectCount|MCacheMaxObjectSize)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 46: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 47: Command ""(MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 48: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 49: Command ""(MMapFile|ModMimeUsePathInfo|MultiviewsMatch|NameVirtualHost|NoProxy|NumServers|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|PassEnv|PidFile)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 50: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 51: Command ""(ProtocolEcho|Proxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyIOBufferSize|ProxyMatch|ProxyMaxForwards|ProxyPass|ProxyPassReverse)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 52: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 53: Command ""(ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia|ReadmeName|Redirect|RedirectMatch)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 54: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 55: Command ""(RedirectPermanent|RedirectTemp|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 56: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 57: Command ""(Require|RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule|RLimitCPU|RLimitMEM|RLimitNPROC)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 58: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 59: Command ""(Satisfy|ScoreBoardFile|Script|ScriptAlias|ScriptAliasMatch|ScriptInterpreterSource|ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock|SecureListen)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 60: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 61: Command ""(SendBufferSize|ServerAdmin|ServerAlias|ServerLimit|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetEnv|SetEnvIf|SetEnvIfNoCase|SetHandler)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 62: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 63: Command ""(SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSLCACertificateFile|SSLCACertificatePath)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 64: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 65: Command ""(SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 66: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 67: Command ""(SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 68: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 69: Command ""(SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 70: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 71: Command ""(SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|StartServers|StartThreads|SuexecUserGroup|ThreadLimit)"" not understood

Error in /usr/share/nano/apacheconf.nanorc on line 72: Missing regex string

Error in /usr/share/nano/apacheconf.nanorc on line 73: Command ""(ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnsetEnv|UseCanonicalName|User|UserDir|VirtualDocumentRoot)"" not understood

I really wouldn't know how to fix these โ€” but perhaps somebody else might.

Command "header" not understood

After following the installation instructions, there are several errors when running nano:

awk.nanorc line 2: command "header" not understood
coffeescript.nanorc line 2: command "header" not understood
ini.nanorc line 2: command "header" not understood
json.nanorc line 2: command "header" not understood
makefile.nanorc line 2: command "header" not understood
nginx.nanorc line 2: command "header" not understood
perl.nanorc line 4: command "header" not understood
python.nanorc line 4: command "header" not understood
ruby.nanorc line 4: command "header" not understood
sed.nanorc line 2: command "header" not understood
sh.nanorc line 4: command "header" not understood
sh. nanorc line 11: bad regex "^\s+?[0-9A-Z_]++?()": repetition-operator operand invalid
systemd.nanorc line 2: command "header" not understood
tcl.nanorc: line 2: command "header" not understood
yaml.nanorc line 2: command "header" not understood
zsh.nanorc line 2: bad regex ".?zsh[^.]+?$": repetition-operator operand invalid
zsh.nanorc line 3: command "header" not understood
zsh.nanorc line 23: bad regex "^\s+?(function\s+)?[0-9A-Z_]+\s+?()": repetition-operator operand invalid

Installer scrambles the original ~/.nanorc file

If the user already had a ~/.nanorc, the installer will completely scramble it as it does a sort -u in the process.
THe result is a file with all preferences and comments sorted alphabetically. Especially if a comment was multiline, the line are separated and moved all around the file. Also all blank lines are removed, ending in an unstructured file.

Add linenumber

Hey! Is it possible to add the "set linenumber" to your config files? Thanks!

.nanorc regex errors on nano 2.8+

Here is contents of the file. No errors in 2.7.4

2.8+ says bad regex.

Any idea if its a bug or just some tightening up of criteria that has caught out legit bad regex?, thanks.

`set tabsize 4

Here is an example for Bourne shell scripts.

syntax "sh" ".sh$"
header "^#!./(ba|k|pdk)?sh[-0-9_]"
icolor brightgreen "^[0-9A-Z_]+()"
color green "[:<:][[:>:]]"
color green "({|}|(|)|;|]|[|`|\|$|<|>|!|=|&||)"
color green "-[Ldefgruwx][[:>:]]"
color green "-(eq|ne|gt|lt|ge|le|s|n|z)[[:>:]]"
color brightcyan "[:<:][[:>:]]"
icolor brightred "${?[0-9A-Z_!@#$?-]+}?"
color cyan "(^|[[:space:]])#.
$"
color brightyellow ""(\.|[^"])"" "'(\.|[^'])'"

trailing whitespace

color ,green "[[:space:]]+$"

multiples of eight spaces at the start a line

(after zero or more tabs) should be a tab

color ,green "^([TAB]*[ ]{8})+"

highlight indents that have an odd number of spaces

color ,red "^(([ ]{2})+|(TAB+))*[ ]{1}[^ ]{1}"

Here is an example for PHP

syntax "php" ".php[2345s~]?$"

php markings

color brightgreen "(<?(php)?|?>)"

functions

color white "[[:<:]][a-z_]*("

types

color green "[:<:][[:>:]]"

structure

color brightyellow "[:<:][[:>:]]"

control flow

color magenta "[:<:][[:>:]]"

strings

color brightyellow "<[^= ]>" ""(.|[^"])""

comments

color cyan "//."
color cyan start="/*" end="*/"
#color blue start="<" end=">"
#color red "&[^;[[:space:]]]
;"

Trailing whitespace

color ,green "[[:space:]]+$"

Here is an example for Perl.

syntax "perl" ".p[lm]$"
header "^#!./perl[-0-9._]"
color red "[:<:][[:>:]]" "[:<:][[:>:]]" "[:<:][[:>:]]" "[:<:][[:>:]]" "[:<:][[:>:]]"
color magenta "[:<:][[:>:]]"
icolor cyan start="[$@%]" end="( |[^0-9A-Z_]|-)"
color yellow ""."|qq|.|"
color white "[sm]/./"
color white start="(^use| = new)" end=";"
color green "#.
"
color yellow start="<< 'STOP'" end="STOP"

Here is a short example for HTML.

syntax "html" ".html$"
color brightcyan start="<" end=">"
color red "&[^;[[:space:]]]*;"

CMake syntax highlighter for GNU Nano

syntax "cmake" "(CMakeLists.txt|.cmake)$"

icolor green "^[[:space:]][A-Z0-9_]+"
icolor brightyellow "^[[:space:]]
(include|include_directories|include_external_msproject)[[:>:]]"

icolor brightgreen "^[[:space:]]*[:<:][[:>:]]"
color brightgreen "[:<:][[:>:]][[:space:]]"
color brightgreen "[[:space:]][:<:][[:>:]][[:space:]]"

icolor brightred "^[[:space:]]*[:<:]"

icolor cyan start="$({|ENV{)" end="}"
color magenta "[:<:][[:>:]]"

icolor brightcyan "^([[:space:]])?#."
icolor brightcyan "[[:space:]]#.*"
color ,green "[[:space:]]+$"

unattributed syntax highlighting example from wiki.linuxhelp.net/

syntax "makefile" "Makefile[^/]$"
color red "[:=]"
color magenta "[:<:][[:>:]]"
color brightcyan "$+[{(][a-zA-Z0-9_-]+[})]"
color brightcyan "^[^ ]+:"
color green "#.
$"

Here is an example for css files.

syntax "css" ".css$"
color brightred "."
color brightyellow start="{" end="}"
color brightwhite start=":" end="([;^{]|$)"
color brightcyan ":active|:focus|:hover|:link|:visited|:link|:after|:before|$"
color brightcyan start="/*" end="\*/"
color green ";|:|{|}"

Here is an example for patch files.

syntax "patch" ".(patch|diff)$"
color brightgreen "^+."
color green "^+++.
"
color brightcyan "^ ."
color brightred "^-.
"
color red "^---."
color brightyellow "^@@.
"
color magenta "^diff.*"

Here is an example for Ruby.

syntax "ruby" ".rb$"
header "^#!./ruby[-0-9._]"

Asciibetical list of reserved words

color yellow "[:<:][[:>:]]"

Constants

color brightcyan "($|@|@@)?[[:<:]][A-Z]+[0-9A-Z_a-z]*"

Ruby "symbols"

icolor magenta "([ ]|^):[0-9A-Z_]+[[:>:]]"

Some unique things we want to stand out

color brightyellow "[:<:][[:>:]]"

Regular expressions

color brightmagenta "/([^/]|(\/))/[iomx]" "%r{([^}]|(\}))}[iomx]"

Shell command expansion is in backticks or like %x{this}. These are

"double-quotish" (to use a perlism).

color brightcyan "[^]`" "%x{[^}]}"

Strings, double-quoted

color green ""([^"]|(\"))"" "%[QW]?{[^}]}" "%[QW]?([^)])" "%[QW]?<[^>]>" "%[QW]?[[^]]]" "%[QW]?$[^$]$" "%[QW]?^[^^]^" "%[QW]?![^!]!"

Expression substitution. These go inside double-quoted strings,

"like #{this}".

color brightgreen "#{[^}]*}"

Strings, single-quoted

color green "'([^']|(\'))'" "%[qw]{[^}]}" "%[qw]([^)])" "%[qw]<[^>]>" "%[qw][[^]]]" "%[qw]$[^$]$" "%[qw]^[^^]^" "%[qw]![^!]!"

Comments

color cyan "#[^{].$" "#$"
color brightcyan "##[^{].
$" "##$"

"Here" docs

color green start="<<-?'?EOT'?" end="^EOT"

Some common markers

color brightcyan "(XXX|TODO|FIXME|???)"

Here is an example for xml files.

syntax "xml" ".([jrs]html?|sgml?|xml|xslt?)$"
color green start="<" end=">"
color cyan "<[^> ]+"
color cyan ">"
color yellow start="<!DOCTYPE" end="[/]?>"
color yellow start=""
color red "&[^;]*;"

trailing whitespace

color ,green "[[:space:]]+$"

multiples of eight spaces at the start a line

(after zero or more tabs) should be a tab

color ,green "^([TAB]*[ ]{8})+"

highlight indents that have an odd number of spaces

color ,red "^(([ ]{2})+|(TAB+))*[ ]{1}[^ ]{1}"`

Command "header" not understood

I tapped into dupes, installed nano, then ran this command to add syntax highlighting for all languages:

$ /bin/ls /usr/local/share/nano/*.nanorc | xargs -I {} echo 'include "{}"' >> ~/.nanorc

Now when I run nano I get this error:

Error in /usr/local/Cellar/nano/2.2.6/share/nano/mgp.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /usr/local/Cellar/nano/2.2.6/share/nano/perl.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /usr/local/Cellar/nano/2.2.6/share/nano/python.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /usr/local/Cellar/nano/2.2.6/share/nano/ruby.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /usr/local/Cellar/nano/2.2.6/share/nano/sh.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.

I'm kind of new to this tap; any suggestions where to start, or is this an easy fix I could dive into?

Extending ledger syntax to include beancount

Beancount is a ledger-like accounting system that has a very ledger-like syntax. As such, beancount files can be partially parsed with the ledger syntax highlighting rules, provided that the file is named "*.ledger". The following modification to the "ledger.nanorc" file extends the syntax highlighting to beancount files (at least in a basic way).

1c1
< syntax "ledger" "(^|\.|/)ledger$"

---
> syntax "ledger" "(^|\.|/)ledger|lgr|beancount$"
3,4c3,4
< color brightmagenta  "^([0-9]{4}/[0-9]{2}/[0-9]{2}|[=~]) .*"
< color blue   "^[0-9]{4}/[0-9]{2}/[0-9]{2}"

---
> color brightmagenta  "^([0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}|[=~]) .*"
> color blue   "^[0-9]{4}(/|-)[0-9]{2}(/|-)[0-9]{2}"

Errors in sql.nanorc

I added just wanted the sql highlighting and included that file in my ~/.nanorc

When I open a SQL file with nano I now get the following errors:

Error in /usr/local/share/nano/sql.nanorc on line 6: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 7: Command ""\<(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\>"" not understood

Error in /usr/local/share/nano/sql.nanorc on line 11: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 12: Command ""\<(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\>"" not understood

Error in /usr/local/share/nano/sql.nanorc on line 14: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 15: Command ""\<(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\>"" not understood

Error in /usr/local/share/nano/sql.nanorc on line 19: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 20: Command ""\<(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\>"" not understood

Error in /usr/local/share/nano/sql.nanorc on line 22: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 23: Command ""\<(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\>"" not understood

Error in /usr/local/share/nano/sql.nanorc on line 26: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 27: Command ""\<(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|INTEGER|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\>"" not understood

Error in /usr/local/share/nano/sql.nanorc on line 31: Missing regex string

Error in /usr/local/share/nano/sql.nanorc on line 32: Command ""\.\<(import|indices|mode|nullvalue|output|prompt|quit|read)\>"" not understood

The highlighting still seems to work though.

Syntax definition titles conflict with nano's internals

nano comes with predefined .nanorc files, which are located in /usr/share/nano/ (may be somewhere else on your OS)

It is a bad idea to redefine existing syntax definitions, since that can cause other syntax definitions to break. For example:

syntax "xml"      # ignored!
โ€ฆ                 # ignored!
syntax "markdown" # ignored!
โ€ฆ                 # ignored!
syntax "xml"
โ€ฆ

This also happens if the definitions come from different files, and even if they're included automatically. For example, including xml.nanorc may break the highlighting for markdown(!) โ€” see #87

# include /usr/share/nano/*.nanorc # nano does this internally
include "~/.nano/markdown.nanorc"
include "~/.nano/xml.nanorc" # redefines "xml" syntax, and thus breaks markdown

Results may vary, depending on the order and amount of includes.

A quick fix consists in using different syntax names.

Here is a list of nano's bundled syntax names in v2.5.3

asm
autoconf
awk
c
changelog
cmake
css
sources.list
default
elisp
fortran
ebuild
/etc/portage
go
groff
guile
html
java
javascript
json
lua
makefile
man
mgp
mutt
nanorc
nftables
m
ocaml
patch
perl
php
po
sql
pov
python
ruby
sh
spec
tcl
tex
texinfo
xml

And these are problematic, since they get redefined by this project:

asm
awk
cmake
c
css
fortran
gentoo
go
groff
html
java
json
lua
makefile
man
mutt
nanorc
ocaml
patch
perl6
perl
php
po
pov
python
ruby
sh
sql
tcl
tex

A bunch of syntax errors

I ran the install.sh and then my nano got a bunch of errors:

$ nano .nanorc 

Error in /home/ec2-user/.nano/awk.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/coffeescript.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/ini.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/json.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/makefile.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/nginx.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/perl.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/python.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/ruby.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/sed.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/sh.nanorc on line 4: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/systemd.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/tcl.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/yaml.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /home/ec2-user/.nano/zsh.nanorc on line 3: Command "header" not understood

Press Enter to continue starting nano.

[yaml] Syntax highlighting hardly works

First of all, thanks for all the work you put in these rc files!

OS: Mac
Nano: 2.9.5 (brew)
Terminal: Hyper

When i tried using the yaml.nanorc file, it worked only partly (only the whitespaces aka the last 2)
Here is a screenshot of a yaml file with the current rc file:

Current file

I created my own yaml rc file. The colors are inspired on the Atom One Dark theme.

Own file

Let me know what you think!

Bad regex in php.nanorc, sh.nanorc & zsh.nanorc using nano 2.3.6 on Mac OS X from brew

Using GNU nano version 2.3.6 (on the Mac after brew tap homebrew/dupes & brew install nano), copying the recommended starting .nanorc from the clone, I get the following errors:

Error in /Users/ChristopherA/.nano/php.nanorc on line 30: Bad regex "('[^']*?')|(\"[^\"]*?\")": repetition-operator operand invalid

Error in /Users/ChristopherA/.nano/sh.nanorc on line 11: Bad regex "^\s+?[0-9A-Z_]+\s+?\(\)": repetition-operator operand invalid

Error in /Users/ChristopherA/.nano/zsh.nanorc on line 2: Bad regex "\.?zsh[^\.]+?$": repetition-operator operand invalid

Error in /Users/ChristopherA/.nano/zsh.nanorc on line 23: Bad regex "^\s+?(function\s+)?[0-9A-Z_]+\s+?\(\)": repetition-operator operand invalid

For now I have copied copied php.nanorc and sh.nanorc from brew files at /usr/local/share/nano/, but I've found no replacement for the bad zsh.nanoc.

-- Christopher Allen

Bad regex and Invalid character class name

It works well in nano 2.7.4 on my mac, but it warning me "bad regex" when I upgrade to nano 2.8.0 by brew.

I tried to fix out that problem and found that I can replaces the characters '<' and '>' by \b in all the nanorc file, and the error message gone. But it may not be a good solution.

http://jimmybonney.com/articles/configure_nano_syntax_highlighting_synology/

Error message:

Error in /Users/vinson/.nano/rpmspec.nanorc on line 3: Bad regex "[:<:]:": Invalid character class name

Error in /Users/vinson/.nano/rpmspec.nanorc on line 4: Bad regex "[:<:]:": Invalid character class name

Command "header" not understood

In the first place, great job. Finally I can enjoy of the syntax highlight in nano.

However, after installing, I have those error messages when I open nano:

Error in /root/.nano/awk.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/coffeescript.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/ini.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/json.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/makefile.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/nginx.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/sed.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/systemd.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.


Error in /root/.nano/yaml.nanorc on line 2: Command "header" not understood

Press Enter to continue starting nano.

Bad syntax in yaml.nanorc

Error in /usr/share/nano-syntax-highlighting/yaml.nanorc on line 2: Command "comment" not understood

No highlighting in md/cs

As the title says, I'm getting no highlighting in either markdown and c# (so far I've checked python, rst, md and c#). I cloned the repo and then added all the languages to the .nanorc file as per the instructions.

Javascript Template Literal Support

Currently, the following code block (and variations thereof) aren't highlighted with the javascript.nanorc rules.

` this is an example ${template}`
`${template}`
``

I've tried (and failed) to create a solution, but will keep working on it.

'(' in javascript is there.. but set to black.

Using this repository.. just open up a new javascript file and type ()... the ( is set to the background color.

I can't figure this out however.. I don't see where that is obvious in the javascript.nanorc.

Comment highlighting should be last in *.nanorc

Purely cosmetic issue, but all comment highlighting should be the last in each nanorc. Since nano parses these configurations line by line from top to bottom, any definitions after the comment highlighting will be highlighted even if its within a comment, which is undesirable.

Solarized?

Any chance for branch that uses the Solarized theme? It is probably the most popular color theme.

-- Christopher Allen

Javascript duplicated?

We seem to have two javascript syntax files, javascript.nanorc and js.nanorc. Is this purposeful, and if not, shall we remove one of them?

Makefile syntax file throws errors

Thanks for these! FYI this one file seems to have issues

Error in /Users/whoami/.nano/gentoo.nanorc on line 19: Bad regex "<(do|new)(ins|s?bin|doc|lib(|.so|.a)|man|info|exe|initd|confd|envd|pam|menu|icon)>": empty (sub)expression

Error in /Users/whoami/.nano/gentoo.nanorc on line 21: Bad regex "prepall(|docs|info|man|strip)": empty (sub)expression

Error in /Users/whoami/.nano/gentoo.nanorc on line 22: Bad regex "<(|doc|ins|exe)into>": empty (sub)expression

mac os x 10.6.8
nano 2.0.6 (whoa really old could that be it?)

Bad regex in yaml.nanorc

Error in ~/.nano/yaml.nanorc on line 9: Bad regex "(^|\s+).+\s:(\s|$)": repetition-operator operand invalid

Some syntax definitions are inferior to Nano upstream

Here is a quick comparison by line number:

NANORC_GIT_DIR = "~/git/nanorc"
NANORC_STD_DIR = "/usr/share/nano"
standard_nanorcs = `ls #{NANORC_STD_DIR} | xargs wc -l`.split("\n").map { |row| lcount, fname = row.lstrip.split(" "); [lcount.to_i, fname]}[0...-1]
standard_nanorcs.each do |lcount, fname|
  `test -e #{NANORC_GIT_DIR}/#{fname}`
  next unless $? == 0
  lcount_new = `wc -l #{NANORC_GIT_DIR}/#{fname}`.split(" ").first.to_i
  if lcount > lcount_new
    puts "Standard syntax definition is more verbose for: #{fname}... #{lcount} vs #{lcount_new}"
  end
end
Standard syntax definition is more verbose for: asm.nanorc... 25 vs 17
Standard syntax definition is more verbose for: awk.nanorc... 37 vs 25
Standard syntax definition is more verbose for: gentoo.nanorc... 68 vs 50
Standard syntax definition is more verbose for: go.nanorc... 46 vs 22
Standard syntax definition is more verbose for: groff.nanorc... 26 vs 24
Standard syntax definition is more verbose for: html.nanorc... 28 vs 11
Standard syntax definition is more verbose for: java.nanorc... 16 vs 13
Standard syntax definition is more verbose for: json.nanorc... 34 vs 11
Standard syntax definition is more verbose for: man.nanorc... 18 vs 9
Standard syntax definition is more verbose for: mutt.nanorc... 9 vs 4
Standard syntax definition is more verbose for: nanorc.nanorc... 29 vs 16
Standard syntax definition is more verbose for: ocaml.nanorc... 29 vs 27
Standard syntax definition is more verbose for: patch.nanorc... 26 vs 10
Standard syntax definition is more verbose for: po.nanorc... 29 vs 8
Standard syntax definition is more verbose for: pov.nanorc... 18 vs 15
Standard syntax definition is more verbose for: ruby.nanorc... 35 vs 34
Standard syntax definition is more verbose for: sh.nanorc... 29 vs 15
Standard syntax definition is more verbose for: xml.nanorc... 21 vs 14

While sometimes the verbose definition might not be superior - it clearly is in a number of cases. For example here is the po.nanorc from the upstream repo:

## Colouring for PO files.

syntax "po" "\.pot?$"
comment "#"

# Comments.
color green "^#.*$"
color yellow "Copyright|\(C\)"
# Header fields.
color brightred "^\"X-Bugs:.*\"$"
color brightmagenta "\<(Project\-Id\-Version|Report\-Msgid\-Bugs\-To|Last\-Translator|Language(\-Team)?|X-Bugs|X-Generator|Plural\-Forms)\>"
color cyan "\<(POT\-Creation\-Date|PO\-Revision\-Date|MIME\-Version|Content\-Type|Content\-Transfer\-Encoding)\>"
# Encodings and numbers.
color yellow "\<(UTF|ISO|Windows|Mac|IBM)\>\-[0-9]"
color yellow "[0-9]|pre[0-9]|[0-9]bit"
# Msgids.
color brightblue "^(msgid|msgid_plural|msgstr)\>"
# Tags.
color red " fuzzy(,|$)"
color yellow " (no-)?[-[:alpha:]]+-format(,|$)"
# Format specifiers.
color brightmagenta "%([1-9]\$)?[a-z]*"
# Quotes and newlines.
color yellow "\""
color cyan "\\n"
# Reminders.
color ,yellow "(FIXME|TODO|XXX)"
# Obsolete strings.
color red "#~.*$"

vs. the one provided by this repo:

syntax "PO" "\.pot?$"

color cyan  "\<(msgid|msgstr)\>"
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
color magenta   "\\.?"
color brightblack "(^|[[:space:]])#([^{].*)?$"
color ,green "[[:space:]]+$"

I'd recommend remove syntax definitions which already exist upstream, or to add a note in the README regarding the ones which may be out-dated.

License for nanorc files?

Hello @scopatz,

Thanks for a terrific resource. Would you mind specifying the license for the files in your README (or in a separate file / in each file's comment) ? Just to help share the code in a clear way.
Hopefully, it's a permissive license (e.g. MIT/BSD/CC-SA) ?

Thanks!

Problems with git.nanorc & gitcommit.nanorc with nano 2.7 installed by brew

I am using nano on a Mac installed by homebrew brew tap homebrew/dupes & brew install cask nano

It installs nano 2.7

$ nano --version
 GNU nano, version 2.7.0
 (C) 1999..2016 Free Software Foundation, Inc.
 (C) 2014..2016 the contributors to nano
 Email: [email protected]    Web: https://nano-editor.org/
 Compiled options: --disable-libmagic --enable-utf8

When I use your nanorc file, and I startup nano, I get:

Error in /Users/admin/.nano/git.nanorc on line 19: A syntax name must be quoted

Error in /Users/admin/.nano/git.nanorc on line 22: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 25: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 28: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 29: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 30: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 31: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 32: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 35: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 37: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 38: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 39: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 40: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 41: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 46: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 49: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 53: A syntax name must be quoted

Error in /Users/admin/.nano/git.nanorc on line 56: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 59: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 62: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 63: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 64: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 65: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 66: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 67: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 68: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 69: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 70: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 71: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 72: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 73: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 76: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/git.nanorc on line 79: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 19: A syntax name must be quoted

Error in /Users/admin/.nano/gitcommit.nanorc on line 22: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 25: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 28: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 29: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 30: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 31: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 32: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 35: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 37: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 38: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 39: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 40: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 41: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 46: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 49: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 53: A syntax name must be quoted

Error in /Users/admin/.nano/gitcommit.nanorc on line 56: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 59: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 62: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 63: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 64: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 65: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 66: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 67: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 68: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 69: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 70: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 71: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 72: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 73: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 76: A 'color' command requires a preceding 'syntax' command

Error in /Users/admin/.nano/gitcommit.nanorc on line 79: A 'color' command requires a preceding 'syntax' command

Press Enter to continue starting nano.

Errors in files

Hi!

I just installed this on a FreeBSD machine with nano 2.7.0, and I found some errors.

I list all of them here instead of creating several issues.
(also, I don't know how they should best be corrected, so I create no PR's)

The files zshrc.nanorc and gitcommit.nanorc are totally wrong and cannot be included in nano.
Either you should remove them or fix them.
If you fix them, remember to also add an entry for zshrc in the file nanorc.
If you remove them, also remove the gitcommit entry in the file nanorc.

When you update the nanorc file, also add includes for these missing ones:

  • conky
  • erb
  • (and possibly zshrc, see above)

Nano 2.7.0 says:
Error in /home/foo/.nano/coffeescript.nanorc on line 4: Bad regex "[!&|=/*+-[[:<:]][[:>:]]]|[:<:][[:>:]]": invalid character range

Please fix the character range to whatever it should be.

prolog.nanorc

$ nano

Error in /home/palermo/GIT/nanorc/prolog.nanorc on line 3: Regex strings must begin and end with a " character

Error in /home/palermo/GIT/nanorc/prolog.nanorc on line 4: Command "comment" not understood

Error in /home/palermo/GIT/nanorc/prolog.nanorc on line 7: Color "normal" not understood.
Valid colors are "green", "red", "blue",
"white", "yellow", "cyan", "magenta" and
"black", with the optional prefix "bright"
for foreground colors.

Error in /home/palermo/GIT/nanorc/prolog.nanorc on line 21: Color "normal" not understood.
Valid colors are "green", "red", "blue",
"white", "yellow", "cyan", "magenta" and
"black", with the optional prefix "bright"
for foreground colors.

Press Enter to continue starting nano.
 GNU nano, version 2.5.3
 (C) 1999..2016 Free Software Foundation, Inc.
 Email: [email protected]    Web: http://www.nano-editor.org/
 Compiled options: --disable-libmagic --disable-wrapping-as-root --enable-utf8
Merge: 19feaf5 0726842
Author: Anthony Scopatz <[email protected]>
Date:   Wed Sep 5 08:30:59 2018 -0400

    Merge pull request #185 from yochem/master
    
    Added syntax highlighting for Prolog

Command "header" not understood

Error in ~/.nano/json.nanorc on line 2: Command "header" not understood

json.nanorc seems to have a header command:

header "^\{$"

Need some quotes on the local .nanorc file

Hey guys,
nano didn't show highlighting till I put quotes on every include statement in that file? Should I fire a pull request with the fix?

GNU nano version 2.2.6 (compiled 16:56:37, Jul 16 2014)
(C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009 Free Software Foundation, Inc.
Email: [email protected] Web: http://www.nano-editor.org/
Compiled options: --disable-wrapping-as-root --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

Not an issue - just wanted to say thanks!!

Thank you so much for maintaining this branch
I've been using nano on all my *NIX variants for years and the syntax highlighting is so, so great
Please keep the repo up indefinitely!
Thank you - thank you - thank you - thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.