Skip to content

Commit

Permalink
Efreak/nanorc/main (#1)
Browse files Browse the repository at this point in the history
* [Nginx] Update directives

- Full list of directives updated from: http://nginx.org/en/docs/dirindex.html
- Deleted 3 keywords, added 233 keywords

* [Python] Improve colorings and fix bugs

- Improve colorings based on iPython (colors=Linux):
    - Green for exceptions and function names.
    - Red for keywords such as `from` and `not`.
    - Cyan for keywords such as `for` and `if`.
- Fix empty strings not correctly highlighted.
- Fix block comments not correctly highlighted when nothing follows `===`.
- Add support for "TODO".

* Force all syntax regex to ends with $

- Lots of syntax regex are poorly written and did not ends with a '$',
   which caused them competing with other regex rules.

* no octave.nanorc in .nano/nanorc

* Apply hcl to "nomad" extension

* nanorc.nanorc: icolor normal instead of brightnormal

Fixes complaint from GNU nano from git, v6.3-7-g18a40caa:

Error in /home/vorburger/dev/nanorc/nanorc.nanorc on line 26: Color 'normal' takes no prefix

* nanooo

* maj

* Update Dockerfile

* Update Dockerfile

* add solidity highlighting

* add zeek highlighting

* fix highlighting for v2.9.*

Get rid of message `Error in /usr/share/nano-syntax-highlighting/etc-hosts.nanorc on line 11: Color "normal" not understood.` after nano exits.

* update documentation and installation script for v2.9 branch

* remove comment syntax for compability with v2.3

* Update prolog.nanorc

* Update prolog.nanorc

* fix script run on Ubuntu 18.04

  inflating: nanorc-2.9/zsh.nanorc
    linking: nanorc-2.9/zshrc.nanorc  -> zsh.nanorc
finishing deferred symbolic links:
  nanorc-2.9/gitcommit.nanorc -> git.nanorc
  nanorc-2.9/html.j2.nanorc -> html.nanorc
  nanorc-2.9/zshrc.nanorc -> zsh.nanorc
+ mv 'nanorc-v2.9/*' ./
mv: cannot stat 'nanorc-v2.9/*': No such file or directory
+ rm -rf nanorc-v2.9
+ rm /tmp/nanorc.zip
+ '[' ']'
+ _update_nanorc
+ touch /c/Users/home/.nanorc
install.sh: line 20: /c/Users/home/.nano/nanorc: No such file or directory

* New Readme file, with more organised information.

* Fix heading levels, remove quote sections

* Fixed readme errors and wording

* Fix block comments highlighting

Signed-off-by: Harsh Shandilya <[email protected]>

* Update .gitignore

* Update nanorc.nanorc

* * PHP: Fix highlighting of special values

* * XML: Enhance with different opening/closing tag colors

* * Yaml: Fix highlighting of spaces

* Create shellcheck.yml

* CI: migrate from Travis CI to Github Actions

- Removed .travis.yml and shellcheck.sh
- Added CI badge to README

* CI: Add highlight_test and badges

* [C] Add highlightings for "TODO" and g++ linter

* [PowerShell] Various Enhancements Based on highlight.js

- Basing on highlight.js, I enhanced the highlighting rules in various aspects.
- See also: scopatz#358

* Fix shellcheck error

* Enhancements: Batch, HTML, JS

- [Batch] Fix that using "::" as comments sometimes failed
- [html] Tabs give 2 spaces by default
- [JS] Tabs give 2 spaces by default; Allow comments to be inline with code.
- [Sh] Also highlight PKGBUILD; Fix `${v%tail}` not highlighted; Use shellcheck as linter

* [test] Adapt new error message and new behavior

- New error message "Standard input is not a terminal" should be ignored.
- nano changed its behavior to produce error messages AFTER program exited.

* Added matching for shebang headers like #!/bin/php

Should also match:
#!/usr/bin/env php
#!php

* Ditto in .zsh files

* Update yaml.nanorc

It's valid for yaml files like this to exist:
```yaml
- my
- list
- of
- strings
```

* mdown

* Add .typescript and .javascript support

* feat: add create-branches.sh

* fix create-branches script to work upstream

* Create switch-branch.sh

* chmod +x switch-branch.sh

* fix: rename to pre-5.0 color names

* fix: comment out 4.5's tabgives

* Add syntax highlighting for pipe operator in elixir.nanorc file

* Add syntax highlighting for Expect scripts. File is a copy of tcl.nanorc
with Expect commands added (Expect is a TCL extension).

* Modified expect.nanorc

* Added Zig to default nanorc

* Fixed Zig nanorc file

* markdown heading fix and added tagging

* color fix

* comments

Removed commented lines and adjusted heading comments

* fix(hcl): only highlight keywords when they're actually keywords

* Syntax highlighting for Julia

* Few more unicode operators

* handle transpose operator

* Remove syntax error

* [ps] Change to a more mainstream color-coding convension

- Use the same coding convension as most languages' (eg. bash) highlighting colors.

* [powershell] Various enhancements

- Commands:
    - remove not workable regex
    - change to use *official-approved verbs* instead
    - add 157 builtin aliases
- Comparison operators:
    - add 47 more operators not been covered
- Keywords (statement):
    - add 28 more keywords not been covered
- Types:
    - add 14 new types highlighting
- Comments:
    - fix a buggy case of block comment
- Quoted text:
    - add a here-string case not been covered

* Including mdx as part of the markdown.nanorc

* Improved and separated ledger and beancount syntaxes

* Fix heading levels, remove quote sections

* fix(yaml): highlighting of spaces

Originally proposed in scopatz#378

* feat(subrip): Add subrip.nanorc

Originally proposed in scopatz#380

* fix(etc-hosts): Made path regex match more strict.

This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict.

Originally proposed in scopatz#386

* fix(git): Git uses tabs in config files, we should warn on spaces but not tabs

* fix(js): fix cotal -> octal typo

* chore(powershell): Add note about comment syntax seeming a bit off

* chore(readme): Update readme with fork information

* Update name extracted from master.zip

The master.zip contains a folder "nano-syntax-highlighting-master" now in the fork where originally it extracted as "nanorc-master".

---------

Signed-off-by: Harsh Shandilya <[email protected]>
Co-authored-by: davidhcefx <[email protected]>
Co-authored-by: KaKooDa <[email protected]>
Co-authored-by: André <[email protected]>
Co-authored-by: Michael Vorburger ⛑️ <[email protected]>
Co-authored-by: 0x07CB <[email protected]>
Co-authored-by: ak <a@k>
Co-authored-by: Ondřej Ešler <[email protected]>
Co-authored-by: Ondřej Ešler <[email protected]>
Co-authored-by: Nicolas Vitaterna <[email protected]>
Co-authored-by: Muhammad Hussein Fattahizadeh <[email protected]>
Co-authored-by: CSRedRat <[email protected]>
Co-authored-by: Tiago Almeida <[email protected]>
Co-authored-by: Sandro <[email protected]>
Co-authored-by: CryptoDragonLady <[email protected]>
Co-authored-by: Harsh Shandilya <[email protected]>
Co-authored-by: hdquemada <[email protected]>
Co-authored-by: Hector Quemada <[email protected]>
Co-authored-by: Zach DeCook <[email protected]>
Co-authored-by: bravoman <[email protected]>
Co-authored-by: Samantaz Fox <[email protected]>
Co-authored-by: Will Stott <[email protected]>
Co-authored-by: Yash Singh <[email protected]>
Co-authored-by: Ross Smith II <[email protected]>
Co-authored-by: Francine Guimarães <[email protected]>
Co-authored-by: Dennis Rardin <[email protected]>
Co-authored-by: Exonorid <[email protected]>
Co-authored-by: Bruce DuPlanty <[email protected]>
Co-authored-by: Bruce <[email protected]>
Co-authored-by: Gareth Jones <[email protected]>
Co-authored-by: Tymoteusz Wołodźko <[email protected]>
Co-authored-by: Tymoteusz Wołodźko <[email protected]>
Co-authored-by: Feixu <[email protected]>
Co-authored-by: Mike Foden <[email protected]>
Co-authored-by: AlphaJack <[email protected]>
Co-authored-by: Sven Wick <[email protected]>
Co-authored-by: Galen Guyer <[email protected]>
Co-authored-by: Simon Thyßen <[email protected]>
  • Loading branch information
Show file tree
Hide file tree
Showing 60 changed files with 657 additions and 1,087 deletions.
677 changes: 0 additions & 677 deletions .authors.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: shellcheck
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: ShellCheck
uses: ludeeus/[email protected]
#with:
# A space separated list of additional filename to check
#additional_files: # optional, default is
# Paths to ignore when running ShellCheck
#ignore: # optional, default is
# Minimum severity of errors to consider. Options: [error, warning, info, style]
#severity: # optional, default is
# Run shellcheck on _all_ files at once, instead of one at a time
#check_together: # optional, default is
# Directory to be searched for files. Defaults to .
#scandir: # optional, default is .
# Set to true to skip using problem-matcher
#disable_matcher: # optional, default is false
# Output format (checkstyle, diff, gcc, json, json1, quiet, tty)
#format: # optional, default is gcc
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:
highlight_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install build dependencies
run: sudo apt-get install -y autoconf automake autopoint gcc gettext git groff make pkg-config texinfo libncurses5-dev

- name: Clone and configure GNU nano
run: |
git clone --depth 100 git://git.savannah.gnu.org/nano.git
cd nano
./autogen.sh
./configure --prefix=/usr
cd -
- name: Build and install nano
run: |
cd nano
make -j
sudo make install
cd -
nano --version
- name: Test highlighting files
run: |
mkdir -p ~/.nano/
cp -al *.nanorc ~/.nano/
echo "" | TERM=xterm timeout 1s nano --rcfile ./nanorc >/dev/null 2>error.txt || true
if grep -v -e "Received SIGHUP or SIGTERM" -e "Too many errors from stdin" \
-e "Standard input is not a terminal" error.txt; then
exit 1
fi
echo "All seems good!"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ search_history

# Rever
rever/

.DS_Store
144 changes: 0 additions & 144 deletions .mailmap

This file was deleted.

12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

136 changes: 0 additions & 136 deletions AUTHORS.rst

This file was deleted.

4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM alpine:latest
RUN apk add --no-cache python3 py3-pip nano curl
RUN curl https://raw.githubusercontent.com/scopatz/nanorc/master/install.sh | sh
ENTRYPOINT [ "nano" ]
2 changes: 1 addition & 1 deletion Rnw.nanorc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Here is a short example for TeX files.
##
syntax "Tex" "\.Rnw$" "bib" "\.bib$" "cls" "\.cls$"
syntax "Tex" "\.Rnw$" "bib$" "\.bib$" "cls$" "\.cls$"
color yellow "\$(\\\$|[^$])*[^\\]\$"
color yellow "\$\$(\\\$|[^$])*[^\\]\$\$"
icolor green "\\.|\\[A-Z]*"
Expand Down
2 changes: 1 addition & 1 deletion apacheconf.nanorc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Apache files
syntax "Apacheconf" "httpd\.conf|mime\.types|vhosts\.d\\*|\.htaccess"
syntax "Apacheconf" "(httpd\.conf|mime\.types|vhosts\.d\\*|\.htaccess)$"
color yellow ".+"
color brightcyan "(AcceptMutex|AcceptPathInfo|AccessFileName|Action|AddAlt|AddAltByEncoding|AddAltByType|AddCharset|AddDefaultCharset|AddDescription|AddEncoding)"
color brightcyan "(AddHandler|AddIcon|AddIconByEncoding|AddIconByType|AddInputFilter|AddLanguage|AddModuleInfo|AddOutputFilter|AddOutputFilterByType|AddType|Alias|AliasMatch)"
Expand Down
Loading

0 comments on commit fd2eb93

Please sign in to comment.