feat(nvim): drop-in runtime tree
This commit is contained in:
@@ -51,6 +51,14 @@ endif
|
||||
|
||||
all: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc
|
||||
|
||||
# Neovim expects parser/<lang>.<soext> 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
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
tumblr = "tumblr",
|
||||
},
|
||||
pattern = {
|
||||
[".*%.tumblr%.html"] = "tumblr",
|
||||
},
|
||||
})
|
||||
@@ -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 = "<!-- %s -->"
|
||||
Reference in New Issue
Block a user