From 8abbcfd645c517424a5a57bc8bba10c551560126 Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 21 Dec 2022 22:23:18 +0100 Subject: nvim: Add tree-sitter integration .config/nvim/init.lua: Add tree-sitter integration. --- .config/nvim/init.lua | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index b554b81..13e7619 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -70,7 +70,10 @@ vim.api.nvim_create_autocmd({'BufNewFile', 'BufRead'}, { -- ale: https://github.com/dense-analysis/ale vim.g['ale_completion_enabled'] = 1 -vim.g['ale_linters'] = { ['rust'] = {'rustc', 'analyzer'} } +vim.g['ale_linters'] = { + ['rust'] = {'rustc', 'analyzer'}, + ['python'] = {'bandit', 'flake8', 'mypy', 'pydocstyle', 'pyright'}, +} vim.opt.omnifunc = 'ale#completion#OmniFunc' -- scnvim: https://github.com/davidgranstrom/scnvim @@ -201,3 +204,47 @@ require('lspconfig')['rust_analyzer'].setup{ } } } + +-- treesitter: https://github.com/nvim-treesitter/nvim-treesitter +vim.opt.runtimepath:append("~/.local/state/nvim/parsers/") +require'nvim-treesitter.configs'.setup { + ensure_installed = { + "bash", + "c", + "cmake", + "cpp", + "diff", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + "go", + "html", + "latex", + "lua", + "make", + "markdown", + "meson", + "ninja", + "php", + "python", + "regex", + "rst", + "rust", + -- "sql", + "supercollider", + -- "toml", + "typescript", + "vim", + "yaml", + "zig", + }, + sync_install = false, + auto_install = false, + ignore_install = { "javascript" }, + parser_install_dir = "~/.local/state/nvim/parsers/", + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, +} -- cgit v1.2.3-70-g09d2