diff --git a/init.lua b/init.lua index 0fc7f3b..747f9f3 100644 --- a/init.lua +++ b/init.lua @@ -36,7 +36,6 @@ g.indent_blankline_buftype_exclude = {"terminal"} g.indent_blankline_show_trailing_blankline_indent = false g.indent_blankline_show_first_indent_level = false -require "treesitter-nvim" require "mappings" require "telescope-nvim" diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 34fa61e..2b63744 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -11,7 +11,14 @@ return packer.startup( use "norcalli/nvim-colorizer.lua" -- lang stuff - use "nvim-treesitter/nvim-treesitter" + use { + "nvim-treesitter/nvim-treesitter", + event = "BufRead", + config = function() + require("treesitter-nvim").config() + end + } + use "neovim/nvim-lspconfig" -- load compe in insert mode only @@ -35,9 +42,9 @@ return packer.startup( -- use "alvan/vim-closetag" -- for html -- Comment - use "terrortylor/nvim-comment" + use "terrortylor/nvim-comment" -- snippet support - -- snippet support + -- snippet use { "hrsh7th/vim-vsnip", event = "InsertCharPre" diff --git a/lua/treesitter-nvim.lua b/lua/treesitter-nvim.lua index 5ee27c4..234f490 100644 --- a/lua/treesitter-nvim.lua +++ b/lua/treesitter-nvim.lua @@ -1,19 +1,25 @@ -local ts_config = require("nvim-treesitter.configs") +local M = {} -ts_config.setup { - ensure_installed = { - "javascript", - "html", - "css", - "bash", - "lua", - "json", - "python" - -- "rust", - -- "go" - }, - highlight = { - enable = true, - use_languagetree = true +M.config = function() + local ts_config = require("nvim-treesitter.configs") + + ts_config.setup { + ensure_installed = { + "javascript", + "html", + "css", + "bash", + "lua", + "json", + "python" + -- "rust", + -- "go" + }, + highlight = { + enable = true, + use_languagetree = true + } } -} +end + +return M