initial support for tags: we start with: syntax

This commit is contained in:
Rene Schallner
2021-12-08 19:04:01 +01:00
parent ddfc7a3ac9
commit e710d725fe
8 changed files with 165 additions and 28 deletions

View File

@@ -9,6 +9,7 @@ local utils = require("telescope.utils")
local previewers = require("telescope.previewers")
local make_entry = require("telescope.make_entry")
local debug_utils = require("plenary.debug_utils")
local filetype = require("plenary.filetype")
-- declare locals for the nvim api stuff to avoid more lsp warnings
local vim = vim
@@ -60,6 +61,7 @@ M.Cfg = {
},
close_after_yanking = false,
insert_after_inserting = true,
install_syntax = true
}
local function file_exists(fname)
@@ -1481,6 +1483,14 @@ local function Setup(cfg)
weekly = M.Cfg.template_new_weekly,
}
if M.Cfg.install_syntax then
-- for previewers to pick up our syntax, we need to tell plenary to override `.md` with our syntax
filetype.add_file("telekasten")
-- now activate our syntax also for all markdown files
vim.cmd("autocmd filetype markdown set syntax=telekasten")
end
if debug then
print("Resulting config:")
print("-----------------")