From 7c698a9c3a2ae2135223f873a143e894b1a71134 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 27 Sep 2020 19:35:27 +0200 Subject: [PATCH] syntax: sh: recognize some shell scripts by their Emacs modeline This helps with recognizing most files in /usr/share/bash*/completions/, where --magic is powerless. --- syntax/sh.nanorc | 1 + 1 file changed, 1 insertion(+) diff --git a/syntax/sh.nanorc b/syntax/sh.nanorc index 2a8abb32..773a87d1 100644 --- a/syntax/sh.nanorc +++ b/syntax/sh.nanorc @@ -2,6 +2,7 @@ syntax sh "(\.sh|(\.|/)(a|ba|c|da|k|mk|pdk|tc|z)sh(rc|_profile)?|/(etc/|\.)profile)$" header "^#!.*/(((a|ba|c|da|k|mk|pdk|tc|z)?sh)|(busybox|env) +sh|openrc-run|runscript)" +header "-\*-.*shell-script.*-\*-" magic "(POSIX|Bourne-Again) shell script.*text" comment "#"