14 lines
534 B
Lua
14 lines
534 B
Lua
|
-- Link the 'hiswikiLink' highlight group to the existing 'Underlined' group.
|
||
|
vim.api.nvim_set_hl(0, "hiswikiLink", { link = "Underlined" })
|
||
|
|
||
|
-- Remove all existing hiswikiLink syntax matches.
|
||
|
vim.cmd("syntax clear hiswikiLink")
|
||
|
|
||
|
-- Find the directory of the current file.
|
||
|
local base_dir = vim.fn.expand("%:h")
|
||
|
|
||
|
-- Loop through all files in the directory, and add a syntax match for each one.
|
||
|
for _, file in ipairs(vim.fn.readdir(base_dir)) do
|
||
|
vim.cmd("syntax match hiswikiLink /\\c\\V\\<" .. vim.fn.escape(file, "/\\") .. "/")
|
||
|
end
|