diff --git a/lua/core/init.lua b/lua/core/init.lua index 3d6240e..8cd9efe 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -3,7 +3,6 @@ require("user.options") require("user.keymaps") require("user.autocommands") require("user.format_onsave") -require("user.treesitter") -- require("user.colorscheme") -- require("user.snip") -- require("user.bufferline") diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 0e6b21e..5969fe4 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -12,7 +12,19 @@ return { -- coloring code { "nvim-treesitter/nvim-treesitter", + priority = 1000, -- make sure to load this before all the other start plugins event = "BufRead", + dependencies = { + { "JoosepAlviste/nvim-ts-context-commentstring", event = "BufRead" }, + { "p00f/nvim-ts-rainbow", event = "BufRead" }, + { + "windwp/nvim-ts-autotag", + event = "BufRead", + config = function() + require("nvim-ts-autotag").setup() + end, + }, + }, cmd = { "TSBufDisable", "TSBufEnable", @@ -28,20 +40,20 @@ return { "TSUpdate", "TSUpdateSync", }, - -- build = function() - -- local status_ok, ts = pcall(require, "nvim-treesitter.install") - -- if not status_ok then - -- return - -- end - -- ts.update({ with_sync = true })() - -- end, - -- config = function() - -- local status_ok, _ = pcall(require, "nvim-treesitter") - -- if not status_ok then - -- return - -- end - -- require("user.treesitter") - -- end, + build = function() + local status_ok, ts = pcall(require, "nvim-treesitter.install") + if not status_ok then + return + end + ts.update({ with_sync = true })() + end, + config = function() + local status_ok, _ = pcall(require, "nvim-treesitter") + if not status_ok then + return + end + require("user.treesitter") + end, }, -- snippets { @@ -176,7 +188,6 @@ return { end, }, -- untuk comment - { "JoosepAlviste/nvim-ts-context-commentstring", event = "BufRead" }, { "numToStr/Comment.nvim", event = "BufRead", @@ -214,14 +225,6 @@ return { -- for multi cursor select { "mg979/vim-visual-multi", event = "BufRead" }, -- for auto close tag - { - "windwp/nvim-ts-autotag", - event = "BufRead", - dependencies = "nvim-treesitter/nvim-treesitter", - config = function() - require("nvim-ts-autotag").setup() - end, - }, -- for auto detection file and run code { "CRAG666/code_runner.nvim", @@ -311,7 +314,6 @@ return { -- for check startuptime { "dstein64/vim-startuptime", cmd = "StartupTime", event = "BufRead" }, -- for coloring pairs - { "p00f/nvim-ts-rainbow", event = "BufRead", dependencies = "nvim-treesitter/nvim-treesitter" }, -- for git { "lewis6991/gitsigns.nvim",