From 6db3e9995cce3ea7a7188f83631db9503d066286 Mon Sep 17 00:00:00 2001 From: materus Date: Sat, 21 Mar 2026 20:46:29 +0100 Subject: [PATCH] Neovim: Treesitter, indent config --- config/editor/neovim/init.lua | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/config/editor/neovim/init.lua b/config/editor/neovim/init.lua index f67368e..f230986 100644 --- a/config/editor/neovim/init.lua +++ b/config/editor/neovim/init.lua @@ -1,8 +1,8 @@ vim.opt.number = true vim.opt.expandtab = true -vim.opt.shiftwidth = 4 -vim.opt.softtabstop = 4 -vim.opt.tabstop = 4 +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 +vim.opt.tabstop = 2 vim.opt.clipboard:append { 'unnamed', 'unnamedplus' } local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" @@ -18,7 +18,7 @@ if vim.fn.executable("git") == 1 then }) end vim.opt.rtp:prepend(lazypath) - + local opts = {} local plugins = { { @@ -33,7 +33,18 @@ if vim.fn.executable("git") == 1 then dependencies = {"nvim-tree/nvim-web-devicons","lewis6991/gitsigns.nvim"} }, + { + 'nvim-telescope/telescope.nvim', version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + } + }, + { + 'nvim-treesitter/nvim-treesitter', + lazy = false, + build = ':TSUpdate' + }, --[[ { "kevinhwang91/nvim-ufo", @@ -43,5 +54,14 @@ if vim.fn.executable("git") == 1 then } require("lazy").setup(plugins, opts) + if vim.fn.executable("tree-sitter") == 1 then + require('nvim-treesitter').setup { + -- Directory to install parsers and queries to (prepended to `runtimepath` to have priority) + install_dir = vim.fn.stdpath('data') .. '/site', + highlight = {enable = true}, + indent = { enable = true}, + } + require('nvim-treesitter').install { 'lua' } + end vim.cmd [[colorscheme dracula]] end