From 1fd3bb55f0f668953dbb9cb4abfd7511a496e205 Mon Sep 17 00:00:00 2001 From: bravoman Date: Mon, 3 Jan 2022 14:18:52 +0100 Subject: [PATCH 1/2] Made etc-hosts path regex match more strict. This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict. --- etc-hosts.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc-hosts.nanorc b/etc-hosts.nanorc index eb8a51ec..aee54fd4 100644 --- a/etc-hosts.nanorc +++ b/etc-hosts.nanorc @@ -1,5 +1,5 @@ ## Make /etc/hosts nicer to read, see `man hosts 5` to see the format -syntax "/etc/hosts" "hosts" +syntax "/etc/hosts" "^/etc/hosts$" # IPv4 color yellow "^[0-9\.]+\s" From 245a24b10143ba6afce96e72e4460a5f9f9bf535 Mon Sep 17 00:00:00 2001 From: bravoman Date: Mon, 3 Jan 2022 14:27:48 +0100 Subject: [PATCH 2/2] Added matching for shebang headers like #!/bin/php Should also match: #!/usr/bin/env php #!php --- php.nanorc | 1 + 1 file changed, 1 insertion(+) diff --git a/php.nanorc b/php.nanorc index 693695f9..d3ba9595 100644 --- a/php.nanorc +++ b/php.nanorc @@ -1,5 +1,6 @@ ## PHP Syntax Highlighting syntax "PHP" "\.php[2345s~]?$|\.module$" +header "^#!.*php" magic "PHP script" comment "//" color white start="<\?(php|=)?" end="\?>"