diff --git a/lazy-lock.json b/lazy-lock.json index 48a70bf..fddf7f3 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -36,7 +36,7 @@ "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, "nvim-scrollview": { "branch": "main", "commit": "ba6c48bf7919dd48a371e7b9c683b8858053e885" }, "nvim-tree.lua": { "branch": "master", "commit": "7282f7de8aedf861fe0162a559fc2b214383c51c" }, - "nvim-treesitter": { "branch": "master", "commit": "69388e84c34d40c3d5c7d2f310db13276f2179e1" }, + "nvim-treesitter": { "branch": "master", "commit": "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "a8c86f48c1030acee22b9e071e3c531de77bf253" }, "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" }, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 4093cea..7c4d8f3 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -55,7 +55,16 @@ return { end, }, -- include treesitter - require("plugins.treesitter"), + -- require("plugins.treesitter"), + { + "nvim-treesitter/nvim-treesitter", + commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac", + run = ":TSUpdate", + event = "BufWinEnter", + opts = function() + require("user.treesitter") + end, + }, { "kyazdani42/nvim-web-devicons", commit = "563f3635c2d8a7be7933b9e547f7c178ba0d4352", @@ -159,7 +168,7 @@ return { { "mg979/vim-visual-multi", event = "BufWinEnter" }, { "windwp/nvim-ts-autotag", - dependencies = "nvim-treesitter", + dependencies = "nvim-treesitter/nvim-treesitter", init = function() require("nvim-ts-autotag").setup() end, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter_________.lua similarity index 80% rename from lua/plugins/treesitter.lua rename to lua/plugins/treesitter_________.lua index 1a0f364..5a32e2b 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter_________.lua @@ -1,8 +1,8 @@ return { { "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "BufReadPost", + -- build = ":TSUpdate", + -- event = "BufReadPost", ---@type TSConfig opts = { sync_install = false, @@ -36,19 +36,19 @@ return { ensure_installed = { "bash", "html", - "c", - "javascript", - "json", - "lua", - "python", - "typescript", - "tsx", - "css", - "rust", - "java", - "yaml", - "markdown", - "markdown_inline", + -- "c", + -- "javascript", + -- "json", + -- "lua", + -- "python", + -- "typescript", + -- "tsx", + -- "css", + -- "rust", + -- "java", + -- "yaml", + -- "markdown", + -- "markdown_inline", }, }, ---@param opts TSConfig diff --git a/lua/user/lsp/null-ls.lua b/lua/user/lsp/null-ls.lua index 7b4542a..4a0e10d 100644 --- a/lua/user/lsp/null-ls.lua +++ b/lua/user/lsp/null-ls.lua @@ -15,10 +15,10 @@ null_ls.setup({ sources = { --formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), formatting.prettier, - formatting.prettierd, + -- formatting.prettierd, formatting.black.with({ extra_args = { "--fast" } }), formatting.stylua, - formatting.eslint_d, + -- formatting.eslint_d, formatting.google_java_format, formatting.phpcbf, -- formatting.clang_format, diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua new file mode 100644 index 0000000..3d1060e --- /dev/null +++ b/lua/user/treesitter.lua @@ -0,0 +1,56 @@ +local status_ok, configs = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end + +configs.setup({ + ensure_installed = { + "bash", + "html", + "c", + "javascript", + "json", + "lua", + "python", + "typescript", + "tsx", + "css", + "rust", + "java", + "yaml", + "markdown", + "markdown_inline", + }, -- one of "all" or a list of languages + ignore_install = { "phpdoc" }, -- List of parsers to ignore installing + highlight = { + enable = true, -- false will disable the whole extension + disable = { "css" }, -- list of language that will be disabled + additional_vim_regex_highlighting = false, + }, + autopairs = { + enable = true, + }, + indent = { enable = true, disable = { "python", "css" } }, + context_commentstring = { + enable = true, + enable_autocmd = false, + config = { + -- Languages that have a single comment style + typescript = "// %s", + css = "/* %s */", + scss = "/* %s */", + html = "", + svelte = "", + vue = "", + json = "", + }, + }, + autotag = { enable = true }, + incremental_selection = { enable = true }, + rainbow = { + enable = true, + disable = { "html" }, + extended_mode = false, + max_file_lines = nil, + }, +})