This commit is contained in:
asep komarudin 2023-01-15 00:57:57 +07:00
parent 1a1483a2d2
commit f1e6c8c266
5 changed files with 85 additions and 20 deletions

View file

@ -36,7 +36,7 @@
"nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" },
"nvim-scrollview": { "branch": "main", "commit": "ba6c48bf7919dd48a371e7b9c683b8858053e885" }, "nvim-scrollview": { "branch": "main", "commit": "ba6c48bf7919dd48a371e7b9c683b8858053e885" },
"nvim-tree.lua": { "branch": "master", "commit": "7282f7de8aedf861fe0162a559fc2b214383c51c" }, "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-treesitter-textobjects": { "branch": "master", "commit": "a8c86f48c1030acee22b9e071e3c531de77bf253" },
"nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "4a42b30376c1bd625ab5016c2079631d531d797a" },

View file

@ -55,7 +55,16 @@ return {
end, end,
}, },
-- include treesitter -- 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", "kyazdani42/nvim-web-devicons",
commit = "563f3635c2d8a7be7933b9e547f7c178ba0d4352", commit = "563f3635c2d8a7be7933b9e547f7c178ba0d4352",
@ -159,7 +168,7 @@ return {
{ "mg979/vim-visual-multi", event = "BufWinEnter" }, { "mg979/vim-visual-multi", event = "BufWinEnter" },
{ {
"windwp/nvim-ts-autotag", "windwp/nvim-ts-autotag",
dependencies = "nvim-treesitter", dependencies = "nvim-treesitter/nvim-treesitter",
init = function() init = function()
require("nvim-ts-autotag").setup() require("nvim-ts-autotag").setup()
end, end,

View file

@ -1,8 +1,8 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", -- build = ":TSUpdate",
event = "BufReadPost", -- event = "BufReadPost",
---@type TSConfig ---@type TSConfig
opts = { opts = {
sync_install = false, sync_install = false,
@ -36,19 +36,19 @@ return {
ensure_installed = { ensure_installed = {
"bash", "bash",
"html", "html",
"c", -- "c",
"javascript", -- "javascript",
"json", -- "json",
"lua", -- "lua",
"python", -- "python",
"typescript", -- "typescript",
"tsx", -- "tsx",
"css", -- "css",
"rust", -- "rust",
"java", -- "java",
"yaml", -- "yaml",
"markdown", -- "markdown",
"markdown_inline", -- "markdown_inline",
}, },
}, },
---@param opts TSConfig ---@param opts TSConfig

View file

@ -15,10 +15,10 @@ null_ls.setup({
sources = { sources = {
--formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), --formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
formatting.prettier, formatting.prettier,
formatting.prettierd, -- formatting.prettierd,
formatting.black.with({ extra_args = { "--fast" } }), formatting.black.with({ extra_args = { "--fast" } }),
formatting.stylua, formatting.stylua,
formatting.eslint_d, -- formatting.eslint_d,
formatting.google_java_format, formatting.google_java_format,
formatting.phpcbf, formatting.phpcbf,
-- formatting.clang_format, -- formatting.clang_format,

56
lua/user/treesitter.lua Normal file
View file

@ -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 = "<!-- %s -->",
svelte = "<!-- %s -->",
vue = "<!-- %s -->",
json = "",
},
},
autotag = { enable = true },
incremental_selection = { enable = true },
rainbow = {
enable = true,
disable = { "html" },
extended_mode = false,
max_file_lines = nil,
},
})