diff --git a/Makefile b/Makefile index 1482240..7830f80 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,14 @@ endif all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc +# Neovim expects parser/. on its runtimepath. Build with +# `make nvim-parser` after cloning so the drop-in runtime tree works. +nvim-parser: parser/tumblr.$(SOEXT) + +parser/tumblr.$(SOEXT): $(PARSER) $(EXTRAS) + @mkdir -p parser + $(TS) build --output $@ + lib$(LANGUAGE_NAME).a: $(OBJS) $(AR) $(ARFLAGS) $@ $^ @@ -112,4 +120,4 @@ clean: test: $(TS) test -.PHONY: all install uninstall clean test +.PHONY: all install uninstall clean test nvim-parser diff --git a/ftdetect/tumblr.lua b/ftdetect/tumblr.lua new file mode 100644 index 0000000..1b216dc --- /dev/null +++ b/ftdetect/tumblr.lua @@ -0,0 +1,8 @@ +vim.filetype.add({ + extension = { + tumblr = "tumblr", + }, + pattern = { + [".*%.tumblr%.html"] = "tumblr", + }, +}) diff --git a/ftplugin/tumblr.lua b/ftplugin/tumblr.lua new file mode 100644 index 0000000..c62f988 --- /dev/null +++ b/ftplugin/tumblr.lua @@ -0,0 +1,11 @@ +if vim.b.did_ftplugin then + return +end +vim.b.did_ftplugin = true + +local ok = pcall(vim.treesitter.start, 0, "tumblr") +if not ok then + return +end + +vim.bo.commentstring = ""