From df06ac538408585890dc652804994bb9fe6be0a8 Mon Sep 17 00:00:00 2001 From: godot Date: Sun, 14 Apr 2024 22:33:01 +0200 Subject: [PATCH] treesitter dilema --- README.md | 2 ++ init.lua | 18 ++++++++++++++++-- lazy-lock.json | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1afa43a..c9e30af 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ - https://github.com/folke/lazy.nvim (plugin manager) - https://github.com/catppuccin/nvim?tab=readme-ov-file (colour scheme) - https://github.com/nvim-telescope/telescope.nvim (fuzzy finder) +- https://github.com/nvim-treesitter/nvim-treesitter (tree sitter plugin) + ### Tutorials used - [YT - typecraft serie](https://www.youtube.com/watch?v=zHTeCSVAFNY&list=PLsz00TDipIffreIaUNk64KxTIkQaGguqn) diff --git a/init.lua b/init.lua index 87237ea..53aee6c 100644 --- a/init.lua +++ b/init.lua @@ -19,7 +19,9 @@ local plugins = { { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, -- colour scheme -- {'nvim-telescope/telescope.nvim', tag = '0.1.6', -- fuzzy finder (telescope) -- - dependencies = { 'nvim-lua/plenary.nvim' }} + dependencies = { 'nvim-lua/plenary.nvim' }}, + + {"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}, -- tree sitter -- } local opts = {} @@ -31,12 +33,24 @@ require("lazy").setup(plugins, opts) -- packet manager -- local builtin = require("telescope.builtin") -- fuzzy finder -- +local config = require("nvim-treesitter.configs") -- tree sitter plugin config for langs -- +config.setup({ + ensure_installed = { + "lua", "python", + "javascript", "html", "css", + "markdown", + }, + highlight = { enable = true }, + indent = { enable = true }, +}) + + require("catppuccin").setup(plugins, opts) -- color scheme -- vim.cmd.colorscheme "catppuccin" -- Keypams -- vim.keymap.set('n', '', builtin.find_files, {}) -- telescope find -- --- vim.keymap.set('n', '', builtin.live_grep, {}) I dont know what this is doing? -- +-- vim.keymap.set('n', '', builtin.live_grep, {}) -- I dont know what this is doing? -- diff --git a/lazy-lock.json b/lazy-lock.json index 5b68eef..68b5a2b 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,7 @@ { "catppuccin": { "branch": "main", "commit": "fc98570d85ae772e56dc42cf8d7d6a497a909bdb" }, "lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" }, + "nvim-treesitter": { "branch": "master", "commit": "40e8c92f99ef26625ff2206f5e183ac3109f20ba" }, "plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" } } \ No newline at end of file