From 446d2716e7bb83e58fb516ec27e5c7750069e98c Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 2 May 2025 16:05:47 +0300 Subject: =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D1=88=D0=B5=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=B0=20lazy=20nvim,=20=D0=BD=D0=B0=D0=B2=D0=B5=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=80=D1=8F=D0=B4=D0=BE=D0=BA=20=D0=B2=20=D0=BF=D0=BB?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nvim/lua/plugins/cmp.lua | 104 ++++++++++++++++---------- nvim/lua/plugins/columns.lua | 10 +++ nvim/lua/plugins/conform.lua | 34 +++++++++ nvim/lua/plugins/dap.lua | 158 ++++++++++++++++++++++++++++++++++++++-- nvim/lua/plugins/dapui.lua | 75 +++++++++++++++++++ nvim/lua/plugins/format.lua | 28 ------- nvim/lua/plugins/go.lua | 12 +++ nvim/lua/plugins/goimpl.lua | 21 ++++++ nvim/lua/plugins/init.lua | 99 ------------------------- nvim/lua/plugins/lualine.lua | 77 ++++++++++---------- nvim/lua/plugins/onedark.lua | 33 +++++++++ nvim/lua/plugins/snippets.lua | 8 ++ nvim/lua/plugins/telescope.lua | 23 ++++-- nvim/lua/plugins/tree.lua | 68 +++++++++++------ nvim/lua/plugins/treesitter.lua | 111 ++++++++++++++++------------ 15 files changed, 578 insertions(+), 283 deletions(-) create mode 100644 nvim/lua/plugins/columns.lua create mode 100644 nvim/lua/plugins/conform.lua create mode 100644 nvim/lua/plugins/dapui.lua delete mode 100644 nvim/lua/plugins/format.lua create mode 100644 nvim/lua/plugins/go.lua create mode 100644 nvim/lua/plugins/goimpl.lua delete mode 100644 nvim/lua/plugins/init.lua create mode 100644 nvim/lua/plugins/onedark.lua create mode 100644 nvim/lua/plugins/snippets.lua (limited to 'nvim/lua/plugins') diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index 923cb09..24c1c47 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -1,39 +1,69 @@ -local cmp = require'cmp' -cmp.setup{ - snippet = { - -- REQUIRED - you must specify a snippet engine - expand = function(args) - vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. - -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. - -- require('snippy').expand_snippet(args.body) -- For `snippy` users. - -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. - -- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+) - - -- For `mini.snippets` users: - -- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert - -- insert({ body = args.body }) -- Insert at cursor - -- cmp.resubscribe({ "TextChangedI", "TextChangedP" }) - -- require("cmp.config").set_onetime({ sources = {} }) - end, +return { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", + { + "L3MON4D3/LuaSnip", + lazy = true, + version = "v2.*", + build = "make install_jsregexp", + opts = { + history = true, + delete_check_events = "TextChanged", + }, + dependencies = { "rafamadriz/friendly-snippets" }, + config = function() + require("plugins.snippets") + end, + }, }, - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = cmp.mapping.preset.insert({ - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), - [''] = cmp.mapping.abort(), - [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }), - sources = cmp.config.sources({ - { name = 'nvim_lsp' }, - { name = 'vsnip' }, -- For vsnip users. - -- { name = 'luasnip' }, -- For luasnip users. - -- { name = 'ultisnips' }, -- For ultisnips users. - -- { name = 'snippy' }, -- For snippy users. - }, { - { name = 'buffer' }, - }) + config = function() + local cmp = require("cmp") + local source_mapping = { + buffer = "[Buffer]", + nvim_lsp = "[LSP]", + nvim_lua = "[Lua]", + path = "[Path]", + } + cmp.setup({ + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function(fallback) + if require("luasnip").expand_or_jumpable() then + require("luasnip").expand_or_jump() + else + fallback() + end + end, { "i", "s" }), + [""] = cmp.mapping(function(fallback) + if require("luasnip").jumpable(-1) then + require("luasnip").jump(-1) + else + fallback() + end + end, { "i", "s" }), + }), + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + formatting = { + format = function(entry, vim_item) + vim_item.menu = source_mapping[entry.source.name] or "[Unknown]" + return vim_item + end, + }, + sources = cmp.config.sources({ + { name = "nvim_lsp", priority = 1000 }, + { name = "luasnip", priority = 750 }, + { name = "path", priority = 500 }, + }, { + { name = "buffer" }, + }), + }) + end, } diff --git a/nvim/lua/plugins/columns.lua b/nvim/lua/plugins/columns.lua new file mode 100644 index 0000000..40806e2 --- /dev/null +++ b/nvim/lua/plugins/columns.lua @@ -0,0 +1,10 @@ +return { + "m4xshen/smartcolumn.nvim", + opts = { + colorcolumn = "80", + disabled_filetypes = { "help", "text" }, + custom_colorcolumn = {}, + scope = "file", + editorconfig = true, + }, +} diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua new file mode 100644 index 0000000..ea0fcf0 --- /dev/null +++ b/nvim/lua/plugins/conform.lua @@ -0,0 +1,34 @@ +return { + "stevearc/conform.nvim", + opts = { + formatters_by_ft = { + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + graphql = { "prettier" }, + lua = { "stylua" }, + python = { "isort", "black" }, + go = { "gofmt" }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 500, + }, + }, + keys = { + { + "mp", + function() + require("conform").format({ lsp_fallback = true, async = false, timeout_ms = 500 }) + end, + desc = "Format file or range (in visual mode)", + }, + }, +} diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua index 7c7f773..0d104d9 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -1,9 +1,153 @@ -require("dap-go").setup() -require("dap").adapters.go = { - type = "server", - port = "${port}", - executable = { - command = "dlv", - args = { "dap", "-l", "127.0.0.1:${port}" }, +return { + "leoluz/nvim-dap-go", + dependencies = { "mfussenegger/nvim-dap" }, + opts = true, + config = function() + local dap, dapui = require("dap"), require("dapui") + + dap.adapters.go = { + type = "server", + port = "${port}", + executable = { + command = "dlv", + args = { "dap", "-l", "127.0.0.1:${port}" }, + }, + } + dap.listeners.before.attach.dapui_config = function() + dapui.open() + end + dap.listeners.before.launch.dapui_config = function() + dapui.open() + end + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + vim.api.nvim_set_hl(0, "DapBreakpoint", { ctermbg = 0, fg = "#993939", bg = "#31353f" }) + vim.api.nvim_set_hl(0, "DapLogPoint", { ctermbg = 0, fg = "#61afef", bg = "#31353f" }) + vim.api.nvim_set_hl(0, "DapStopped", { ctermbg = 0, fg = "#98c379", bg = "#31353f" }) + + vim.fn.sign_define( + "DapBreakpoint", + { text = "🐞", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapBreakpointCondition", + { text = "ﳁ", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapBreakpointRejected", + { text = "", texthl = "DapBreakpoint", linehl = "DapBreakpoint", numhl = "DapBreakpoint" } + ) + vim.fn.sign_define( + "DapLogPoint", + { text = "", texthl = "DapLogPoint", linehl = "DapLogPoint", numhl = "DapLogPoint" } + ) + vim.fn.sign_define( + "DapStopped", + { text = "", texthl = "DapStopped", linehl = "DapStopped", numhl = "DapStopped" } + ) + end, + keys = { + { + "", + function() + require("dap").continue() + end, + silent = true, + }, + { + "", + function() + require("dap").step_over() + end, + silent = true, + }, + { + "", + function() + require("dap").step_into() + end, + silent = true, + }, + { + "", + function() + require("dap").step_out() + end, + silent = true, + }, + { + "dc", + function() + require("dap").continue() + end, + silent = true, + }, + { + "so", + function() + require("dap").step_over() + end, + silent = true, + }, + { + "si", + function() + require("dap").step_into() + end, + silent = true, + }, + { + "st", + function() + require("dap").step_out() + end, + silent = true, + }, + { + "b", + function() + require("dap").toggle_breakpoint() + end, + silent = true, + }, + { + "", + function() + require("dap").toggle_breakpoint() + end, + silent = true, + }, + { + "B", + function() + require("dap").set_breakpoint() + end, + silent = true, + }, + { + "lp", + function() + require("dap").set_breakpoint(nil, nil, vim.fn.input("Log point message: ")) + end, + silent = true, + }, + { + "dr", + function() + require("dap").repl.open() + end, + silent = true, + }, + { + "dl", + function() + require("dap").run_last() + end, + silent = true, + }, }, } diff --git a/nvim/lua/plugins/dapui.lua b/nvim/lua/plugins/dapui.lua new file mode 100644 index 0000000..f5d1532 --- /dev/null +++ b/nvim/lua/plugins/dapui.lua @@ -0,0 +1,75 @@ +return { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + }, + keys = { + { + "du", + function() + require("dapui").toggle() + end, + silent = true, + }, + { + "dh", + function() + require("dap.ui.widgets").hover() + end, + silent = true, + }, + { + "dp", + function() + require("dap.ui.widgets").preview() + end, + silent = true, + }, + { + "ds", + function() + local widgets = require("dap.ui.widgets") + widgets.centered_float(widgets.scopes) + end, + silent = true, + }, + }, + opts = { + icons = { + expanded = "▾", + collapsed = "▸", + }, + mappings = { + open = "o", + remove = "d", + edit = "e", + repl = "r", + toggle = "t", + }, + expand_lines = vim.fn.has("nvim-0.7"), + layouts = { + { + elements = { + "repl", + "breakpoints", + "scopes", + }, + size = 0.3, + position = "bottom", + }, + }, + floating = { + max_height = nil, + max_width = nil, + border = "single", + mappings = { + close = { "q", "" }, + }, + }, + windows = { indent = 1 }, + render = { + max_type_length = nil, + }, + }, +} diff --git a/nvim/lua/plugins/format.lua b/nvim/lua/plugins/format.lua deleted file mode 100644 index e226ab6..0000000 --- a/nvim/lua/plugins/format.lua +++ /dev/null @@ -1,28 +0,0 @@ -local conform = require("conform") - -conform.setup({ - formatters_by_ft = { - javascript = { "prettier" }, - typescript = { "prettier" }, - javascriptreact = { "prettier" }, - typescriptreact = { "prettier" }, - css = { "prettier" }, - html = { "prettier" }, - json = { "prettier" }, - yaml = { "prettier" }, - markdown = { "prettier" }, - graphql = { "prettier" }, - lua = { "stylua" }, - python = { "isort", "black" }, - go = { "gofmt" }, - }, - format_on_save = { - lsp_fallback = true, - async = false, - timeout_ms = 500, - }, -}) - -vim.keymap.set({ "n", "v" }, "mp", function() - conform.format({ lsp_fallback = true, async = false, timeout_ms = 500 }) -end, { desc = "Format file or range (in visual mode)" }) diff --git a/nvim/lua/plugins/go.lua b/nvim/lua/plugins/go.lua new file mode 100644 index 0000000..1078297 --- /dev/null +++ b/nvim/lua/plugins/go.lua @@ -0,0 +1,12 @@ +return { + "ray-x/go.nvim", + dependencies = { + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = true, + event = { "CmdlineEnter" }, + ft = { "go", "gomod" }, + build = ':lua require("go.install").update_all_sync()', +} diff --git a/nvim/lua/plugins/goimpl.lua b/nvim/lua/plugins/goimpl.lua new file mode 100644 index 0000000..0b906fa --- /dev/null +++ b/nvim/lua/plugins/goimpl.lua @@ -0,0 +1,21 @@ +return { + "edolphin-ydf/goimpl.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-lua/popup.nvim", + "nvim-telescope/telescope.nvim", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("telescope").load_extension("goimpl") + end, + keys = { + { + "im", + function() + require("telescope").extensions.goimpl.goimpl({}) + end, + desc = "Generate stub for interface on a type for golang", + }, + }, +} diff --git a/nvim/lua/plugins/init.lua b/nvim/lua/plugins/init.lua deleted file mode 100644 index 0c3e6a5..0000000 --- a/nvim/lua/plugins/init.lua +++ /dev/null @@ -1,99 +0,0 @@ -return require("packer").startup({ - function(use) - use("wbthomason/packer.nvim") - use("nvim-lua/plenary.nvim") - use("neovim/nvim-lspconfig") - use("navarasu/onedark.nvim") - use("Snyssfx/goerr-nvim") - use({ - "lukas-reineke/indent-blankline.nvim", - config = function() - require("ibl").setup() - end, - }) - use({ - "rcarriga/nvim-dap-ui", - requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, - }) - use({ - "leoluz/nvim-dap-go", - requires = { "mfussenegger/nvim-dap" }, - config = function() - require("plugins.dap") - end, - }) - use({ - "hrsh7th/nvim-cmp", - requires = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-vsnip", - "hrsh7th/vim-vsnip", - }, - config = function() - require("plugins.cmp") - end, - }) - use({ - "nvim-lualine/lualine.nvim", - config = function() - require("plugins.lualine") - end, - }) - use({ - "nvim-treesitter/nvim-treesitter", - run = ":TSUpdate", - config = function() - require("plugins.treesitter") - end, - }) - use({ "nvim-telescope/telescope-file-browser.nvim" }) - use({ - "nvim-telescope/telescope.nvim", - config = function() - require("plugins.telescope") - end, - requires = "nvim-lua/plenary.nvim", - }) - use({ - "nvim-tree/nvim-tree.lua", - requires = { - "nvim-tree/nvim-web-devicons", - }, - config = function() - require("plugins.tree") - end, - }) - use({ - "stevearc/conform.nvim", - config = function() - require("plugins.format") - end, - }) - use({ - "mfussenegger/nvim-dap", - config = function() - local dap = require("dap") - -- Общие конфигурации для Go - dap.configurations.go = { - { - type = "go", - name = "Debug", - request = "launch", - program = "${file}", - showLog = true, - console = "integratedTerminal", - }, - } - end, - }) - if packer_bootstrap then - require("packer").sync() - end - end, - config = { - -- The root has to be a directory named "pack" - package_root = vim.fn.stdpath("data") .. "/site/pack", - }, -}) diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua index 891b392..3be9d19 100644 --- a/nvim/lua/plugins/lualine.lua +++ b/nvim/lua/plugins/lualine.lua @@ -1,40 +1,43 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'auto', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = { - statusline = {}, - winbar = {}, +return { + "nvim-lualine/lualine.nvim", + opts = { + options = { + icons_enabled = true, + theme = "auto", + component_separators = { left = "", right = "" }, + section_separators = { left = "", right = "" }, + disabled_filetypes = { + statusline = {}, + winbar = {}, + }, + ignore_focus = {}, + always_divide_middle = true, + globalstatus = false, + refresh = { + statusline = 1000, + tabline = 1000, + winbar = 1000, + }, }, - ignore_focus = {}, - always_divide_middle = true, - globalstatus = false, - refresh = { - statusline = 1000, - tabline = 1000, - winbar = 1000, - } - }, - sections = { - lualine_a = {'mode'}, - lualine_b = {'branch', 'diff', 'diagnostics'}, - lualine_c = {'filename'}, - lualine_x = {'encoding', 'fileformat', 'filetype'}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = {'filename'}, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { "filename" }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = { "location" }, + lualine_y = {}, + lualine_z = {}, + }, + tabline = {}, + winbar = {}, + inactive_winbar = {}, + extensions = {}, }, - tabline = {}, - winbar = {}, - inactive_winbar = {}, - extensions = {} } diff --git a/nvim/lua/plugins/onedark.lua b/nvim/lua/plugins/onedark.lua new file mode 100644 index 0000000..f4c4aca --- /dev/null +++ b/nvim/lua/plugins/onedark.lua @@ -0,0 +1,33 @@ +return { + "navarasu/onedark.nvim", + opts = { + style = "darker", + transparent = false, -- Show/hide background + term_colors = true, -- Change terminal color as per the selected theme style + ending_tildes = true, -- Show the end-of-buffer tildes. By default they are hidden + cmp_itemkind_reverse = false, -- reverse item kind highlights in cmp menu + toggle_style_key = nil, -- keybind to toggle theme style. Leave it nil to disable it, or set it to a string, for example "ts" + toggle_style_list = { "dark", "darker", "cool", "deep", "warm", "warmer", "light" }, -- List of styles to toggle between + + code_style = { + comments = "italic", + keywords = "none", + functions = "none", + strings = "none", + variables = "none", + }, + + lualine = { + transparent = false, -- lualine center bar transparency + }, + + colors = {}, -- Override default colors + highlights = {}, -- Override highlight groups + + diagnostics = { + darker = true, -- darker colors for diagnostic + undercurl = true, -- use undercurl instead of underline for diagnostics + background = true, -- use background color for virtual text + }, + }, +} diff --git a/nvim/lua/plugins/snippets.lua b/nvim/lua/plugins/snippets.lua new file mode 100644 index 0000000..bf40e7c --- /dev/null +++ b/nvim/lua/plugins/snippets.lua @@ -0,0 +1,8 @@ +require("luasnip").config.setup({ + history = true, + update_events = "TextChanged,TextChangedI", +}) +require("luasnip.loaders.from_vscode").lazy_load() +require("luasnip.loaders.from_vscode").lazy_load({ + paths = { vim.fn.stdpath("config") .. "/snippets" }, +}) diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 9595d51..2348275 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,10 +1,19 @@ -require("telescope").setup({ - pickers = { - buffers = { - initial_mode = "normal", +return { + "nvim-telescope/telescope.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + pickers = { + buffers = { + initial_mode = "normal", + }, + }, + defaults = { + file_ignore_patterns = { "vendor", "node_modules" }, }, }, - defaults = { - file_ignore_patterns = { "vendor", "node_modules" }, + keys = { + { "ff", "Telescope find_files", noremap = true, silent = true, desc = "Find files" }, + { "fg", "Telescope live_grep", noremap = true, silent = true, desc = "Live grep" }, + { "fb", "Telescope buffers", noremap = true, silent = true, desc = "Find buffers" }, }, -}) +} diff --git a/nvim/lua/plugins/tree.lua b/nvim/lua/plugins/tree.lua index 320849b..4807024 100644 --- a/nvim/lua/plugins/tree.lua +++ b/nvim/lua/plugins/tree.lua @@ -1,27 +1,51 @@ -require("nvim-tree").setup({ - sort = { - sorter = "case_sensitive", +return { + "nvim-tree/nvim-tree.lua", + dependencies = { + "nvim-tree/nvim-web-devicons", }, - view = { - width = 30, - }, - git = { - enable = true, - }, - renderer = { - group_empty = true, - highlight_git = true, - icons = { - show = { - git = true, + opts = { + hijack_directories = { + enable = true, -- Перехватывать открытие директорий + auto_open = true, -- Автоматически открывать при старте + }, + sort = { + sorter = "case_sensitive", + }, + view = { + width = 30, + }, + git = { + enable = true, + }, + renderer = { + group_empty = true, + highlight_git = true, + icons = { + show = { + git = true, + }, }, }, + filters = { + dotfiles = false, + }, + update_focused_file = { + enable = true, + update_root = false, + }, }, - filters = { - dotfiles = false, - }, - update_focused_file = { - enable = true, - update_root = false, + keys = { + { + "", + function() + local api = require("nvim-tree.api") + local global_cwd = vim.fn.getcwd(-1, -1) + api.tree.change_root(global_cwd) + end, + noremap = true, + silent = true, + desc = "Change tree root to CWD", + }, + { "", ":NvimTreeToggle", noremap = true, silent = true, desc = "Toggle file tree" }, }, -}) +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 623e808..f6127d7 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,47 +1,66 @@ -require("nvim-treesitter.configs").setup({ - highlight = { enable = true }, - ensure_installed = { - "c", - "lua", - "python", - "bash", - "go", - "html", - "css", - "javascript", - "typescript", - "git_config", - "git_rebase", - "gitattributes", - "gitcommit", - "gitignore", - "gomod", - "gosum", - "gotmpl", - "gowork", - "hjson", - "ini", - "json", - "json5", - "jsonnet", - "latex", - "make", - "markdown", - "markdown_inline", - "nginx", - "proto", - "rust", - "templ", - "todotxt", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - "sql", - "ssh_config", +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + opts = { + highlight = { enable = true }, + ensure_installed = { + "c", + "lua", + "python", + "bash", + "go", + "html", + "css", + "javascript", + "typescript", + "git_config", + "git_rebase", + "gitattributes", + "gitcommit", + "gitignore", + "gomod", + "gosum", + "gotmpl", + "gowork", + "hjson", + "ini", + "json", + "json5", + "jsonnet", + "latex", + "make", + "markdown", + "markdown_inline", + "nginx", + "proto", + "rust", + "templ", + "todotxt", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + "sql", + "ssh_config", + }, + ignore_install = { "gdhsader", "phpdoc" }, + indent = { enable = true }, + auto_install = true, + sync_install = false, + textobjects = { select = { enable = true, lookahead = true } }, }, - ignore_install = { "gdhsader", "phpdoc" }, -}) + dependencies = { + { "nvim-treesitter/nvim-treesitter-textobjects" }, + { + "nvim-treesitter/nvim-treesitter-context", + opts = { + enable = true, + mode = "topline", + line_numbers = true, + }, + }, + }, +} -- cgit v1.2.3