From bc0a08394bff1b7881c0ad130893bc7661f18de4 Mon Sep 17 00:00:00 2001 From: jdhao Date: Mon, 12 Jul 2021 23:44:27 +0800 Subject: [PATCH] Add treesitter --- lua/config/treesitter.lua | 8 ++++++++ lua/plugins.lua | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 lua/config/treesitter.lua diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua new file mode 100644 index 0000000..dc03fdb --- /dev/null +++ b/lua/config/treesitter.lua @@ -0,0 +1,8 @@ +require'nvim-treesitter.configs'.setup { + ensure_installed = {'python', 'cpp', 'lua', 'bash'}, + ignore_install = {}, -- List of parsers to ignore installing + highlight = { + enable = true, -- false will disable the whole extension + disable = {}, -- list of language that will be disabled + }, +} diff --git a/lua/plugins.lua b/lua/plugins.lua index f2482c1..95a0745 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -32,6 +32,10 @@ require('packer').startup( -- auto-completion engine use { 'hrsh7th/nvim-compe', event = 'InsertEnter *', config = [[require('config.compe')]] } + if (vim.g.is_mac > 0) or (vim.g.is_linux > 0) then + use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', config = [[require('config.treesitter')]]} + end + -- Python syntax highlighting and more if (vim.g.is_mac == 1) or (vim.g.is_win == 1) then use {'numirias/semshi', ft = 'python', config = 'vim.cmd [[UpdateRemotePlugins]]'}