vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 3ad602a567f13bf2f87b5864b9f934b40a6b09c0
parent 9854f5493a60a694f11f52779247b54d7a17aa81
Author: parazyd <parazyd@dyne.org>
Date:   Tue, 12 Jan 2021 11:04:17 +0100

filetype: Detect make shebang for "makefile".

This is useful when writing "debian/rules" files in packages.

Diffstat:
Mlua/plugins/filetype.lua | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua @@ -250,6 +250,9 @@ vis.ftdetect.filetypes = { makefile = { ext = { "%.iface$", "%.mak$", "%.mk$", "GNUmakefile", "makefile", "Makefile" }, mime = { "text/x-makefile" }, + detect = function(_, data) + return data:match("^#!/usr/bin/make") + end }, man = { ext = {