From a1733f2a0365f2ebbfc285935647c2874fff25c1 Mon Sep 17 00:00:00 2001 From: parazyd Date: Tue, 12 Jan 2021 11:04:17 +0100 Subject: filetype: Detect make shebang for "makefile". This is useful when writing "debian/rules" files in packages. --- lua/plugins/filetype.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lua') diff --git a/lua/plugins/filetype.lua b/lua/plugins/filetype.lua index 5aebdcc..5b6c2ab 100644 --- 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 = { -- cgit v1.2.3