diff --git a/lazy-lock.json b/lazy-lock.json index d11e201..3b74cea 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,4 +1,5 @@ { "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "nvim-treesitter": { "branch": "main", "commit": "5a7e5638e7d220575b1c22c8a2e099b52231886e" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" } } diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 1134061..7785726 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -17,14 +17,10 @@ end vim.opt.rtp:prepend(lazypath) -- Initialize lazy.nvim -require("lazy").setup({ - { - "folke/tokyonight.nvim", - lazy = false, -- load immediately - priority = 1000, -- load before other plugins - config = function() - vim.cmd("colorscheme tokyonight") - end, - }, -}) +local plugins = { + require("plugins.tokyonight"), -- theme + require("plugins.treesitter"), -- syntax tree +} + +require("lazy").setup(plugins) diff --git a/lua/config/treesitter.lua b/lua/config/treesitter.lua new file mode 100644 index 0000000..bbcb54e --- /dev/null +++ b/lua/config/treesitter.lua @@ -0,0 +1,11 @@ +return { + "nvim-treesitter/nvim-treesitter", + run = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "c", "cpp", "rust" }, + highlight = { enable = true, additional_vim_regex_highlighting = false }, + indent = { enable = true }, + }) + end, +} diff --git a/lua/plugins/tokyonight.lua b/lua/plugins/tokyonight.lua new file mode 100644 index 0000000..e708011 --- /dev/null +++ b/lua/plugins/tokyonight.lua @@ -0,0 +1,8 @@ +return { + "folke/tokyonight.nvim", + lazy = false, -- load immediately + priority = 1000, -- load before other plugins + config = function() + vim.cmd("colorscheme tokyonight") + end, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..152810a --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,12 @@ +return { + "nvim-treesitter/nvim-treesitter", + lazy = false, + run = ":TSUpdate", + config = function() + require'nvim-treesitter'.install { 'lua', 'c', 'cpp', 'rust' } + vim.api.nvim_create_autocmd('FileType', { + pattern = { '' }, + callback = function() vim.treesitter.start() end, + }) + end, +}