Add treesitter
This commit is contained in:
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
|
"nvim-treesitter": { "branch": "main", "commit": "5a7e5638e7d220575b1c22c8a2e099b52231886e" },
|
||||||
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }
|
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,14 +17,10 @@ end
|
|||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
-- Initialize lazy.nvim
|
-- Initialize lazy.nvim
|
||||||
require("lazy").setup({
|
local plugins = {
|
||||||
{
|
require("plugins.tokyonight"), -- theme
|
||||||
"folke/tokyonight.nvim",
|
require("plugins.treesitter"), -- syntax tree
|
||||||
lazy = false, -- load immediately
|
}
|
||||||
priority = 1000, -- load before other plugins
|
|
||||||
config = function()
|
require("lazy").setup(plugins)
|
||||||
vim.cmd("colorscheme tokyonight")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|||||||
11
lua/config/treesitter.lua
Normal file
11
lua/config/treesitter.lua
Normal file
@ -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,
|
||||||
|
}
|
||||||
8
lua/plugins/tokyonight.lua
Normal file
8
lua/plugins/tokyonight.lua
Normal file
@ -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,
|
||||||
|
}
|
||||||
12
lua/plugins/treesitter.lua
Normal file
12
lua/plugins/treesitter.lua
Normal file
@ -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 = { '<filetype>' },
|
||||||
|
callback = function() vim.treesitter.start() end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user