mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: syntax highlighting
This commit is contained in:
parent
8bb53c93d0
commit
d05728e155
4 changed files with 57 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ local parsers = require'nvim-treesitter.parsers'
|
|||
local configs = require 'nvim-treesitter.configs'
|
||||
local install = require'nvim-treesitter.install'
|
||||
local locals = require'nvim-treesitter.locals'
|
||||
local highlight = require'nvim-treesitter.highlight'
|
||||
|
||||
local M = {}
|
||||
|
||||
|
|
@ -14,6 +15,8 @@ end
|
|||
-- this is the main interface through the plugin
|
||||
function M.setup(lang)
|
||||
if parsers.has_parser(lang) then
|
||||
local autocmd = "autocmd NvimTreesitter FileType %s lua require'nvim-treesitter.highlight'.setup()"
|
||||
api.nvim_command(string.format(autocmd, lang))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue