diff --git a/after/lsp/lua_ls.lua b/after/lsp/lua_ls.lua index bbc0958..c36d3f4 100644 --- a/after/lsp/lua_ls.lua +++ b/after/lsp/lua_ls.lua @@ -1,12 +1,7 @@ local lsp = require("lsp") -local util = require("util") -local lua_library_paths = { - vim.env.VIMRUNTIME, -} -for _, plugin in ipairs(require("lazy").plugins()) do - table.insert(lua_library_paths, plugin.dir) -end +local lua_library_paths = require("plugin").get_paths() +table.insert(lua_library_paths, vim.env.VIMRUNTIME) ---@type vim.lsp.Config return { diff --git a/init.lua b/init.lua index 95480e0..6bba3ec 100644 --- a/init.lua +++ b/init.lua @@ -21,45 +21,33 @@ for _, file in ipairs(files) do end end -local ok, err = pcall(require, "bootstrap") -if not ok then - log.error("Error during bootstrap") - log.error(err:gsub("\t", " ")) - return -end - ----@type LazyConfig -local opts = { - install = { - colorscheme = { "onedark" }, +require("plugin").setup({ + "https://github.com/navarasu/onedark.nvim", + "https://github.com/nvim-lua/plenary.nvim", + "https://github.com/rcarriga/nvim-notify", + "https://github.com/debugloop/telescope-undo.nvim", + { + "https://github.com/nvim-telescope/telescope-fzf-native.nvim", + build = { "make" }, }, - ui = { - icons = { - cmd = "", - config = "", - event = "", - favorite = "", - ft = "", - init = "", - import = "", - keys = "", - lazy = "", - loaded = "", - not_loaded = "", - plugin = "", - runtime = "", - require = " ", - source = "", - start = "", - task = "", - list = { - "", - "", - "", - "", - }, - }, + "https://github.com/nvim-telescope/telescope.nvim", + { + "https://github.com/saghen/blink.cmp", + version = vim.version.range("^1"), }, -} - -require("lazy").setup("plugins", opts) + "https://github.com/neovim/nvim-lspconfig", + "https://github.com/mason-org/mason.nvim", + "https://github.com/owallb/mason-auto-install.nvim", + "https://github.com/mfussenegger/nvim-dap", + "https://github.com/igorlfs/nvim-dap-view", + "https://github.com/nvim-treesitter/nvim-treesitter", + "https://github.com/numToStr/Comment.nvim", + "https://github.com/j-hui/fidget.nvim", + "https://github.com/rbong/vim-flog", + "https://github.com/tpope/vim-fugitive", + "https://github.com/lewis6991/gitsigns.nvim", + "https://github.com/MagicDuck/grug-far.nvim", + "https://github.com/nvim-tree/nvim-tree.lua", + "https://github.com/stevearc/oil.nvim", + "https://github.com/hedyhli/outline.nvim", +}) diff --git a/lazy-lock.json b/lazy-lock.json deleted file mode 100644 index 0894a07..0000000 --- a/lazy-lock.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "aerial.nvim": { "branch": "master", "commit": "7a6a42791eb2b54a7115c7db4488981f93471770" }, - "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, - "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" }, - "grug-far.nvim": { "branch": "main", "commit": "275dbedc96e61a6b8d1dfb28ba51586ddd233dcf" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "mason-auto-install.nvim": { "branch": "main", "commit": "6c9175845c91a416d643ab86214466b8caf8d43b" }, - "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "51cf7c995ed1eb6642aecf19067ee634fa1b6ba2" }, - "nvim-dap": { "branch": "master", "commit": "e47878dcf1ccc30136b30d19ab19fe76946d61cd" }, - "nvim-dap-repl-highlights": { "branch": "master", "commit": "f31deba47fe3ee6ff8d2f13d9dbd06b2d1ae06b5" }, - "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-lspconfig": { "branch": "master", "commit": "66fd02ad1c7ea31616d3ca678fa04e6d0b360824" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, - "nvim-tree.lua": { "branch": "master", "commit": "037d89e60fb01a6c11a48a19540253b8c72a3c32" }, - "nvim-treesitter": { "branch": "main", "commit": "45a07f869b0cffba342276f2c77ba7c116d35db8" }, - "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, - "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, - "onedark.nvim": { "branch": "master", "commit": "213c23ae45a04797572242568d5d51937181792d" }, - "orgmode": { "branch": "master", "commit": "e448c72ebc3d7a10d00a865b41b25336122a2c67" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, - "telescope-undo.nvim": { "branch": "main", "commit": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5" }, - "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, - "undotree": { "branch": "master", "commit": "fc28931fbfba66ab75d9af23fe46ffbbb9de6e8c" }, - "vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" }, - "vim-flog": { "branch": "master", "commit": "665b16ac8915f746bc43c9572b4581a5e9047216" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" } -} diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua deleted file mode 100644 index 3761385..0000000 --- a/lua/bootstrap.lua +++ /dev/null @@ -1,37 +0,0 @@ -local version = vim.version() - -if version.major == 0 then - if version.minor < 11 then - error( - "Neovim version 0.11 or above is required with this configuration." - ) - end -end - -local util = require("util") - --- Install lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.uv.fs_stat(lazypath) then - util.assert_installed("git") - if not os.getenv("CC") then - util.assert_installed("cc") - end - util.assert_installed("make") - util.assert_any_installed({ "curl", "wget" }) - util.assert_installed("unzip") - util.assert_installed("tar") - util.assert_installed("gzip") - - local resp = vim.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }):wait() - - assert(resp.code == 0, "Failed to download lazy") -end -vim.opt.rtp:prepend(lazypath) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 2ee25a9..40d9b62 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -177,6 +177,10 @@ vim.keymap.set("n", "dl", vim.diagnostic.setloclist) vim.keymap.set("n", "grt", vim.lsp.buf.type_definition) vim.keymap.set("n", "gd", vim.lsp.buf.definition) +vim.keymap.set("n", "pp", function() + vim.pack.update(nil, { offline = true }) +end) + -- Default bindings that are good to know: -- insert mode: -- - indent, see :h i_CTRL-T diff --git a/lua/plugin.lua b/lua/plugin.lua new file mode 100644 index 0000000..887bd03 --- /dev/null +++ b/lua/plugin.lua @@ -0,0 +1,165 @@ +local log = require("log") + +---@class ow.Plugin.Spec +---@field [1] string +---@field name? string +---@field version? string | vim.VersionRange +---@field lazy? boolean +---@field build? string[] | fun(self: ow.Plugin): boolean + +---@class ow.Plugin : ow.Plugin.Spec +---@field path string + +---@type ow.Plugin[] +local plugins = {} + +---@param plugin ow.Plugin +local function load(plugin) + vim.cmd.packadd(plugin.name) + + local name = plugin.name:match("[^.]+"):lower() + local path = string.format( + "%s/lua/plugins/%s.lua", + vim.fn.stdpath("config"), + name + ) + + if vim.uv.fs_stat(path) then + local ok, err = pcall(dofile, path) + if not ok then + log.error("Failed to load %s: %s", name, err) + end + end +end + +---@param spec string | ow.Plugin.Spec +---@return vim.pack.Spec +local function to_pack_spec(spec) + if type(spec) == "string" then + return { src = spec } + end + + return { + src = spec[1], + name = spec.name, + version = spec.version, + data = { + lazy = spec.lazy, + build = spec.build, + }, + } +end + +---@param plugin ow.Plugin +---@return boolean success +local function run_build(plugin) + if type(plugin.build) == "function" then + return plugin.build(plugin) + elseif type(plugin.build) == "table" then + local ret = vim.system( + plugin.build --[[@as table]], + { cwd = plugin.path } + ):wait() + return ret.code == 0 and ret.signal == 0 + end + + log.error("invalid build parameter for %s", plugin.name) + return false +end + +---@class ow.Plugin.PackEvent.Data +---@field active boolean +---@field kind "install" | "update" | "delete" +---@field spec vim.pack.Spec +---@field path string + +---@class ow.Plugin.PackEvent : vim.api.keyset.create_autocmd.callback_args +---@field data ow.Plugin.PackEvent.Data + +---@param plugin ow.Plugin +---@param events ow.Plugin.PackEvent[] +---@return boolean success +local function handle_pack_events(plugin, events) + if not plugin.build then + return true + end + + for _, ev in ipairs(events) do + if ev.data.spec.name == plugin.name + and ev.event == "PackChanged" + and (ev.data.kind == "install" or ev.data.kind == "update") + then + vim.cmd.packadd(plugin.name) + return run_build(plugin) + end + end + + return true +end + +local M = {} + +function M.get_paths() + local paths = {} + + for _, plugin in ipairs(plugins) do + table.insert(paths, plugin.path) + end + + return paths +end + +---@param specs (string | ow.Plugin.Spec)[] +function M.setup(specs) + ---@type ow.Plugin.PackEvent[] + local events = {} + local id = vim.api.nvim_create_autocmd( + { "PackChangedPre", "PackChanged" }, + { + ---@param ev ow.Plugin.PackEvent + callback = function(ev) + table.insert(events, ev) + end + } + ) + vim.pack.add(vim.tbl_map(to_pack_spec, specs), { + load = function(data) + local d = data.spec.data or {} + ---@type ow.Plugin + local plugin = { + [1] = data.spec.src, + name = data.spec.name, + version = data.spec.version, + lazy = d.lazy or false, + build = d.build, + path = data.path, + } + table.insert(plugins, plugin) + end + }) + vim.api.nvim_del_autocmd(id) + + local lazy_plugins = {} + for _, plugin in ipairs(plugins) do + if not handle_pack_events(plugin, events) then + return + end + + if plugin.lazy then + table.insert(lazy_plugins, plugin) + else + load(plugin) + end + end + + vim.api.nvim_create_autocmd("UIEnter", { + once = true, + callback = vim.schedule_wrap(function() + for _, plugin in ipairs(lazy_plugins) do + load(plugin) + end + end) + }) +end + +return M diff --git a/lua/plugins/blink.lua b/lua/plugins/blink.lua index f30881e..45a65ca 100644 --- a/lua/plugins/blink.lua +++ b/lua/plugins/blink.lua @@ -1,96 +1,88 @@ ----@type LazyPluginSpec -return { - "saghen/blink.cmp", - -- use a release tag to download pre-built binaries - version = "1.*", - ---@module 'blink.cmp' - ---@type blink.cmp.Config - opts = { - completion = { - documentation = { - auto_show = true, - window = { - winhighlight = "", - }, - }, - ghost_text = { - enabled = true, - }, - list = { - selection = { - preselect = false, - auto_insert = false, - }, - }, - menu = { - border = "none", - draw = { - align_to = "simple_label", - columns = { - { "simple_label" }, - { "kind_icon", "label_description", gap = 1 }, - }, - components = { - simple_label = { - width = { fill = true, max = 60 }, - text = function(ctx) - return ctx.label - end, - highlight = function(ctx) - local highlights = { - { - 0, - #ctx.label, - group = ctx.deprecated - and "BlinkCmpLabelDeprecated" - or "BlinkCmpLabel", - }, - } - for _, idx in ipairs(ctx.label_matched_indices) do - table.insert(highlights, { - idx, - idx + 1, - group = "BlinkCmpLabelMatch", - }) - end - - return highlights - end, - }, - }, - }, - }, - }, - fuzzy = { - implementation = "prefer_rust_with_warning", - }, - signature = { - enabled = true, +require("blink.cmp").setup({ + completion = { + documentation = { + auto_show = true, window = { winhighlight = "", - show_documentation = false, }, }, - sources = { - default = { - "lsp", - "path", - }, - transform_items = function(_, items) - return vim.tbl_filter(function(item) - return item.kind - ~= require("blink.cmp.types").CompletionItemKind.Snippet - end, items) - end, + ghost_text = { + enabled = true, }, - keymap = { - preset = "none", - [""] = { "insert_next", "fallback" }, - [""] = { "insert_prev", "fallback" }, - [""] = { "accept", "fallback" }, - [""] = { "show_signature", "hide_signature", "fallback" }, - [""] = { "snippet_forward", "fallback" }, - [""] = { "snippet_backward", "fallback" }, + list = { + selection = { + preselect = false, + auto_insert = false, + }, + }, + menu = { + border = "none", + draw = { + align_to = "simple_label", + columns = { + { "simple_label" }, + { "kind_icon", "label_description", gap = 1 }, + }, + components = { + simple_label = { + width = { fill = true, max = 60 }, + text = function(ctx) + return ctx.label + end, + highlight = function(ctx) + local highlights = { + { + 0, + #ctx.label, + group = ctx.deprecated + and "BlinkCmpLabelDeprecated" + or "BlinkCmpLabel", + }, + } + for _, idx in ipairs(ctx.label_matched_indices) do + table.insert(highlights, { + idx, + idx + 1, + group = "BlinkCmpLabelMatch", + }) + end + + return highlights + end, + }, + }, + }, }, }, -} + fuzzy = { + implementation = "prefer_rust_with_warning", + }, + signature = { + enabled = true, + window = { + winhighlight = "", + show_documentation = false, + }, + }, + sources = { + default = { + "lsp", + "path", + }, + transform_items = function(_, items) + return vim.tbl_filter(function(item) + return item.kind + ~= require("blink.cmp.types").CompletionItemKind.Snippet + end, items) + end, + }, + keymap = { + preset = "none", + [""] = { "insert_next", "fallback" }, + [""] = { "insert_prev", "fallback" }, + [""] = { "accept", "fallback" }, + [""] = { "show_signature", "hide_signature", "fallback" }, + [""] = { "snippet_forward", "fallback" }, + [""] = { "snippet_backward", "fallback" }, + }, +}) diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 3c9b93b..d90b2a9 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -1,11 +1,5 @@ --- https://github.com/numToStr/Comment.nvim - ----@type LazyPluginSpec -return { - "numToStr/Comment.nvim", - event = "VeryLazy", - opts = { - --ignore empty lines - ignore = "^$", - }, -} +---@diagnostic disable-next-line: missing-fields +require("Comment").setup({ + --ignore empty lines + ignore = "^$", +}) diff --git a/lua/plugins/fidget.lua b/lua/plugins/fidget.lua index 122a900..4f1ab35 100644 --- a/lua/plugins/fidget.lua +++ b/lua/plugins/fidget.lua @@ -1,9 +1 @@ --- https://github.com/j-hui/fidget.nvim - ----@type LazyPluginSpec -return { - "j-hui/fidget.nvim", - tag = "legacy", - event = "LspAttach", - config = true, -} +require("fidget").setup() diff --git a/lua/plugins/flog.lua b/lua/plugins/flog.lua deleted file mode 100644 index 23d3f97..0000000 --- a/lua/plugins/flog.lua +++ /dev/null @@ -1,10 +0,0 @@ --- https://github.com/rbong/vim-flog - ----@type LazyPluginSpec -return { - "rbong/vim-flog", - ---@type LazyKeysSpec[] - keys = { - { "gl", vim.cmd.Flog, mode = "n" }, - }, -} diff --git a/lua/plugins/fugitive.lua b/lua/plugins/fugitive.lua deleted file mode 100644 index b2daa2a..0000000 --- a/lua/plugins/fugitive.lua +++ /dev/null @@ -1,99 +0,0 @@ --- https://github.com/tpope/vim-fugitive - -local function open_git_status() - local previous_win = vim.api.nvim_get_current_win() - vim.cmd("leftabove vertical G") - vim.api.nvim_win_set_width(0, 50) - vim.api.nvim_set_option_value("winfixwidth", true, { scope = "local" }) - vim.api.nvim_set_current_win(previous_win) -end - -local function get_git_status_win() - local current_tabpage = vim.api.nvim_get_current_tabpage() - for _, win in ipairs(vim.api.nvim_tabpage_list_wins(current_tabpage)) do - local buf = vim.api.nvim_win_get_buf(win) - local buftype = vim.api.nvim_get_option_value("buftype", { buf = buf }) - if - buftype == "nowrite" - and vim.api.nvim_buf_get_name(buf):match("^fugitive://.*%.git//$") - then - return win - end - end -end - -local function toggle_git_status() - local win = get_git_status_win() - if win then - vim.api.nvim_win_close(win, false) - return - end - - open_git_status() -end - ----@type LazyPluginSpec -return { - "tpope/vim-fugitive", - event = "VeryLazy", - ---@type LazyKeysSpec[] - keys = { - { - "gd", - vim.cmd.Gvdiffsplit, - mode = "n", - }, - { - "gD", - function() - vim.cmd.Gvdiffsplit("HEAD") - end, - mode = "n", - }, - { - "gh", - vim.cmd.Ghdiffsplit, - mode = "n", - }, - { - "gH", - function() - vim.cmd.Ghdiffsplit("HEAD") - end, - mode = "n", - }, - { - "gc", - function() - vim.cmd.G("commit") - end, - mode = "n", - }, - { - "ga", - function() - vim.cmd.G("commit --amend") - end, - mode = "n", - }, - { - "gp", - function() - vim.cmd.G("push") - end, - mode = "n", - }, - { - "gg", - toggle_git_status, - mode = "n", - }, - }, - config = function() - vim.api.nvim_create_autocmd("BufWritePost", { - callback = function() - vim.fn["fugitive#ReloadStatus"]() - end, - }) - end, -} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index a270c53..6564e44 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,65 +1,58 @@ --- https://github.com/lewis6991/gitsigns.nvim - ----@type LazyPluginSpec -return { - "lewis6991/gitsigns.nvim", - event = "VeryLazy", - opts = { - preview_config = { - border = "single", - }, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - vim.keymap.set( - "n", - "gv", - gs.select_hunk, - { buffer = bufnr } - ) - vim.keymap.set("n", "gs", gs.stage_hunk, { buffer = bufnr }) - vim.keymap.set("x", "gs", function() - gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) - end, { buffer = bufnr }) - vim.keymap.set( - { "n", "x" }, - "gu", - gs.undo_stage_hunk, - { buffer = bufnr } - ) - vim.keymap.set("n", "gr", gs.reset_hunk, { buffer = bufnr }) - vim.keymap.set( - "x", - "gr", - ":Gitsigns reset_hunk", - { buffer = bufnr } - ) - vim.keymap.set( - "n", - "g?", - gs.preview_hunk, - { buffer = bufnr } - ) - vim.keymap.set("n", "gb", function() - gs.blame_line({ full = true, ignore_whitespace = true }) - end, { buffer = bufnr }) - vim.keymap.set({ "n", "x" }, "]g", function() - gs.next_hunk({ - wrap = true, - navigation_message = true, - foldopen = true, - preview = true, - }) - end) - vim.keymap.set({ "n", "x" }, "[g", function() - gs.prev_hunk({ - wrap = true, - navigation_message = true, - foldopen = true, - preview = true, - }) - end) - end, - attach_to_untracked = true, - sign_priority = 100, +require("gitsigns").setup({ + preview_config = { + border = "single", }, -} + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + vim.keymap.set( + "n", + "gv", + gs.select_hunk, + { buffer = bufnr } + ) + vim.keymap.set("n", "gs", gs.stage_hunk, { buffer = bufnr }) + vim.keymap.set("x", "gs", function() + gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) + end, { buffer = bufnr }) + vim.keymap.set( + { "n", "x" }, + "gu", + gs.undo_stage_hunk, + { buffer = bufnr } + ) + vim.keymap.set("n", "gr", gs.reset_hunk, { buffer = bufnr }) + vim.keymap.set( + "x", + "gr", + ":Gitsigns reset_hunk", + { buffer = bufnr } + ) + vim.keymap.set( + "n", + "g?", + gs.preview_hunk, + { buffer = bufnr } + ) + vim.keymap.set("n", "gb", function() + gs.blame_line({ full = true, ignore_whitespace = true }) + end, { buffer = bufnr }) + vim.keymap.set({ "n", "x" }, "]g", function() + gs.next_hunk({ + wrap = true, + navigation_message = true, + foldopen = true, + preview = true, + }) + end) + vim.keymap.set({ "n", "x" }, "[g", function() + gs.prev_hunk({ + wrap = true, + navigation_message = true, + foldopen = true, + preview = true, + }) + end) + end, + attach_to_untracked = true, + sign_priority = 100, +}) diff --git a/lua/plugins/grug-far.lua b/lua/plugins/grug-far.lua index bf9cfe0..4851a24 100644 --- a/lua/plugins/grug-far.lua +++ b/lua/plugins/grug-far.lua @@ -1,5 +1 @@ ----@type LazyPluginSpec -return { - "MagicDuck/grug-far.nvim", - config = true, -} +require("grug-far").setup() diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua deleted file mode 100644 index fbe741f..0000000 --- a/lua/plugins/lspconfig.lua +++ /dev/null @@ -1,5 +0,0 @@ ----@type LazyPluginSpec -return { - "neovim/nvim-lspconfig", - config = require("lsp").setup, -} diff --git a/lua/plugins/mason-auto-install.lua b/lua/plugins/mason-auto-install.lua index d5e61d5..6a5313d 100644 --- a/lua/plugins/mason-auto-install.lua +++ b/lua/plugins/mason-auto-install.lua @@ -1,60 +1,52 @@ ----@type LazyPluginSpec -return { - "owallb/mason-auto-install.nvim", - dependencies = { - "neovim/nvim-lspconfig", - }, - ---@type MasonAutoInstall.Config - opts = { - packages = { - { - "bash-language-server", - dependencies = { "shellcheck", "shfmt" }, - }, - -- "clangd", - { - "cmake-language-server", - dependencies = { "golines" }, - }, - "gopls", - "hyprls", - { - "intelephense", - dependencies = { "phpcs" }, - }, - "jedi-language-server", - { - "lemminx", - dependencies = { "xmlformatter" }, - }, - "lua-language-server", - "mesonlsp", - "oxfmt", - "oxlint", - "ruff", - "pyright", - "pyrefly", - { - "prettier", - filetypes = { - "json", - "jsonc", - "markdown", - "html", - "css", - "scss", - "less", - "javascript", - "javascriptreact", - "typescript", - "typescriptreact", - }, - }, - "rust-analyzer", - "svelte-language-server", - "tailwindcss-language-server", - "tsgo", - "zls", +require("mason-auto-install").setup({ + packages = { + { + "bash-language-server", + dependencies = { "shellcheck", "shfmt" }, }, + -- "clangd", + { + "cmake-language-server", + dependencies = { "golines" }, + }, + "gopls", + "hyprls", + { + "intelephense", + dependencies = { "phpcs" }, + }, + "jedi-language-server", + { + "lemminx", + dependencies = { "xmlformatter" }, + }, + "lua-language-server", + "mesonlsp", + "oxfmt", + "oxlint", + "ruff", + "pyright", + "pyrefly", + { + "prettier", + filetypes = { + "json", + "jsonc", + "markdown", + "html", + "css", + "scss", + "less", + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + }, + }, + "rust-analyzer", + "svelte-language-server", + "tailwindcss-language-server", + "tsgo", + "zls", }, -} +}) diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua index 32f3542..ac26661 100644 --- a/lua/plugins/mason.lua +++ b/lua/plugins/mason.lua @@ -1,8 +1 @@ --- https://github.com/williamboman/mason.nvim - ----@type LazyPluginSpec -return { - "williamboman/mason.nvim", - event = "VeryLazy", - config = true, -} +require("mason").setup() diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua deleted file mode 100644 index 59b985f..0000000 --- a/lua/plugins/notify.lua +++ /dev/null @@ -1,17 +0,0 @@ --- https://github.com/rcarriga/nvim-notify - ----@type LazyPluginSpec -return { - "rcarriga/nvim-notify", - priority = 900, - lazy = false, - opts = { - render = "default", - stages = "static", - }, - config = function(_, opts) - ---@type notify - vim.notify = require("notify") - vim.notify.setup(opts) - end, -} diff --git a/lua/plugins/nvim-colorizer.lua b/lua/plugins/nvim-colorizer.lua deleted file mode 100644 index 1e22f0c..0000000 --- a/lua/plugins/nvim-colorizer.lua +++ /dev/null @@ -1,19 +0,0 @@ --- https://github.com/NvChad/nvim-colorizer.lua - ----@type LazyPluginSpec -return { - "NvChad/nvim-colorizer.lua", - enabled = false, - opts = { - user_default_options = { - names = false, - RGB = false, - RRGGBB = true, - RRGGBBAA = true, - AARRGGBB = true, - rgb_fn = true, - hsl_fn = true, - mode = "virtualtext", - }, - }, -} diff --git a/lua/plugins/nvim-dap-ui.lua b/lua/plugins/nvim-dap-ui.lua deleted file mode 100644 index 29c0478..0000000 --- a/lua/plugins/nvim-dap-ui.lua +++ /dev/null @@ -1,93 +0,0 @@ --- https://github.com/igorlfs/nvim-dap-view - ----@type LazyPluginSpec -return { - "rcarriga/nvim-dap-ui", - dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" }, - keys = { - { - "du", - function() - require("dapui").toggle() - end, - }, - { - "de", - function() - ---@diagnostic disable-next-line: missing-fields - require("dapui").eval(nil, { context = "hover", enter = true }) - end, - mode = { "x", "n" }, - }, - { - "dw", - function() - require("dapui").elements.watches.add(vim.fn.expand("")) - end, - }, - }, - opts = { - controls = { - element = "repl", - enabled = false, - }, - expand_lines = true, - floating = { - border = "single", - mappings = { - close = { "q", "" }, - }, - }, - force_buffers = true, - icons = { - collapsed = "+", - current_frame = "*", - expanded = "-", - }, - layouts = { - { - elements = { - { - id = "scopes", - size = 0.25, - }, - { - id = "breakpoints", - size = 0.25, - }, - { - id = "stacks", - size = 0.25, - }, - { - id = "watches", - size = 0.25, - }, - }, - position = "right", - size = 50, - }, - { - elements = { - { - id = "repl", - }, - }, - position = "bottom", - size = 15, - }, - }, - mappings = { - edit = "e", - expand = { "", "<2-LeftMouse>", "" }, - open = "o", - remove = "d", - repl = "r", - toggle = "t", - }, - render = { - indent = 1, - max_value_lines = 100, - }, - }, -} diff --git a/lua/plugins/nvim-dap-view.lua b/lua/plugins/nvim-dap-view.lua new file mode 100644 index 0000000..f1f60e3 --- /dev/null +++ b/lua/plugins/nvim-dap-view.lua @@ -0,0 +1,3 @@ +local dap_view = require("dap-view") +dap_view.setup() +vim.keymap.set("n", "du", dap_view.toggle) diff --git a/lua/plugins/nvim-dap.lua b/lua/plugins/nvim-dap.lua index 95ec0c3..a01efab 100644 --- a/lua/plugins/nvim-dap.lua +++ b/lua/plugins/nvim-dap.lua @@ -1,217 +1,152 @@ --- https://github.com/mfussenegger/nvim-dap -local hover = require("dap.hover") local log = require("log") +local dap = require("dap") ----@type LazyPluginSpec -return { - "mfussenegger/nvim-dap", - lazy = false, - keys = { - { - "db", - function() - require("dap").toggle_breakpoint() - end, - }, - { - "df", - function() - require("dap").focus_frame() - end, - }, - { - "", - function() - require("dap").up() - end, - }, - { - "", - function() - require("dap").down() - end, - }, - { - "dh", - hover, - mode = { "n", "x" }, - }, - { - "dr", - function() - require("dap").repl.toggle() - end, - mode = { "n", "x" }, - }, - { - "", - function() - require("dap").step_into() - end, - }, - { - "", - function() - require("dap").step_over() - end, - }, - { - "", - function() - require("dap").step_out() - end, - }, - { - "", - function() - require("dap").continue() - end, - }, - { - "", - function() - require("dap").terminate() - end, - }, - }, - config = function() - local dap = require("dap") +vim.api.nvim_set_hl(0, "DebugPC", { + bg = "NONE", + fg = "NONE", +}) - vim.api.nvim_set_hl(0, "DebugPC", { - bg = "NONE", - fg = "NONE", - }) +vim.api.nvim_create_user_command( + "Debug", + ---@param opts vim.api.keyset.create_user_command.command_args + function(opts) + local cfgs = dap.configurations[vim.bo.filetype] + if not cfgs then + log.error( + "No configurations available for filetype %s", + vim.bo.filetype + ) + return + end - vim.api.nvim_create_user_command( - "Debug", - ---@param opts vim.api.keyset.create_user_command.command_args - function(opts) - local cfgs = dap.configurations[vim.bo.filetype] - if not cfgs then - log.error( - "No configurations available for filetype %s", - vim.bo.filetype - ) - return - end + local function run_config(cfg) + local all_args = vim.fn.split(opts.args) + cfg.program = all_args[1] - local function run_config(cfg) - local all_args = vim.fn.split(opts.args) - cfg.program = all_args[1] + local args = {} + for i = 2, #all_args do + table.insert(args, all_args[i]) + end + cfg.args = args - local args = {} - for i = 2, #all_args do - table.insert(args, all_args[i]) - end - cfg.args = args + dap.run(cfg) + end - dap.run(cfg) - end + if #cfgs == 1 then + run_config(cfgs[1]) + return + end - if #cfgs == 1 then - run_config(cfgs[1]) - return - end + local names = {} + for _, c in ipairs(cfgs) do + table.insert(names, c.name) + end - local names = {} - for _, c in ipairs(cfgs) do - table.insert(names, c.name) - end - - vim.ui.select(names, { - prompt = "Select DAP configuration to use:", - }, function(choice, idx) - if choice and idx then - run_config(cfgs[idx]) - end - end) - end, - { - nargs = "+", - ---@param ArgLead string - ---@param CmdLine string - complete = function(ArgLead, CmdLine, CursorPos) - local _, spaces = CmdLine:sub(1, CursorPos):gsub("%s+", "") - - if spaces == 1 then - return vim.fn.getcompletion(ArgLead, "file") - end - end, - } - ) - - -- https://sourceware.org/gdb/current/onlinedocs/gdb#Debugger-Adapter-Protocol - dap.adapters.gdb = { - type = "executable", - command = "gdb", - args = { "--interpreter=dap" }, - } - - dap.adapters.lldb = { - type = "executable", - command = "lldb-dap", - } - - dap.adapters.python = { - type = "executable", - command = "python", - args = { "-m", "debugpy.adapter" }, - } - - dap.configurations.c = { - { - type = "gdb", - request = "launch", - name = "Launch", - program = function() - local path = vim.fn.input({ - prompt = "Path to executable: ", - default = vim.fn.getcwd() .. "/", - completion = "file", - }) - return (path and path ~= "") and path or dap.ABORT - end, - cwd = "${workspaceFolder}", - stopAtBeginningOfMainSubprogram = false, - }, - } - - -- dap.configurations.c = { - -- { - -- type = "lldb", - -- request = "launch", - -- name = "Launch", - -- program = function() - -- local path = vim.fn.input({ - -- prompt = "Path to executable: ", - -- default = vim.fn.getcwd() .. "/", - -- completion = "file", - -- }) - -- return (path and path ~= "") and path or dap.ABORT - -- end, - -- cwd = "${workspaceFolder}", - -- stopAtBeginningOfMainSubprogram = false, - -- console = "internalConsole", - -- }, - -- } - - dap.configurations.cpp = dap.configurations.c - - dap.configurations.python = { - { - type = "python", - request = "launch", - name = "Launch", - program = function() - local path = vim.fn.input({ - prompt = "Path to executable: ", - default = vim.fn.getcwd() .. "/", - completion = "file", - }) - return (path and path ~= "") and path or dap.ABORT - end, - cwd = "${workspaceFolder}", - }, - } + vim.ui.select(names, { + prompt = "Select DAP configuration to use:", + }, function(choice, idx) + if choice and idx then + run_config(cfgs[idx]) + end + end) end, + { + nargs = "+", + ---@param ArgLead string + ---@param CmdLine string + complete = function(ArgLead, CmdLine, CursorPos) + local _, spaces = CmdLine:sub(1, CursorPos):gsub("%s+", "") + + if spaces == 1 then + return vim.fn.getcompletion(ArgLead, "file") + end + end, + } +) + +-- https://sourceware.org/gdb/current/onlinedocs/gdb#Debugger-Adapter-Protocol +dap.adapters.gdb = { + type = "executable", + command = "gdb", + args = { "--interpreter=dap" }, } + +dap.adapters.lldb = { + type = "executable", + command = "lldb-dap", +} + +dap.adapters.python = { + type = "executable", + command = "python", + args = { "-m", "debugpy.adapter" }, +} + +dap.configurations.c = { + { + type = "gdb", + request = "launch", + name = "Launch", + program = function() + local path = vim.fn.input({ + prompt = "Path to executable: ", + default = vim.fn.getcwd() .. "/", + completion = "file", + }) + return (path and path ~= "") and path or dap.ABORT + end, + cwd = "${workspaceFolder}", + stopAtBeginningOfMainSubprogram = false, + }, +} + +-- dap.configurations.c = { +-- { +-- type = "lldb", +-- request = "launch", +-- name = "Launch", +-- program = function() +-- local path = vim.fn.input({ +-- prompt = "Path to executable: ", +-- default = vim.fn.getcwd() .. "/", +-- completion = "file", +-- }) +-- return (path and path ~= "") and path or dap.ABORT +-- end, +-- cwd = "${workspaceFolder}", +-- stopAtBeginningOfMainSubprogram = false, +-- console = "internalConsole", +-- }, +-- } + +dap.configurations.cpp = dap.configurations.c + +dap.configurations.python = { + { + type = "python", + request = "launch", + name = "Launch", + program = function() + local path = vim.fn.input({ + prompt = "Path to executable: ", + default = vim.fn.getcwd() .. "/", + completion = "file", + }) + return (path and path ~= "") and path or dap.ABORT + end, + cwd = "${workspaceFolder}", + }, +} + +vim.keymap.set("n", "db", dap.toggle_breakpoint) +vim.keymap.set("n", "df", dap.focus_frame) +vim.keymap.set("n", "", dap.up) +vim.keymap.set("n", "", dap.down) +vim.keymap.set({ "n", "x" }, "dh", require("dap.hover")) +vim.keymap.set({ "n", "x" }, "dr", dap.repl.toggle) +vim.keymap.set("n", "", dap.step_into) +vim.keymap.set("n", "", dap.step_over) +vim.keymap.set("n", "", dap.step_out) +vim.keymap.set("n", "", dap.continue) +vim.keymap.set("n", "", dap.terminate) + diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua new file mode 100644 index 0000000..ffed4b4 --- /dev/null +++ b/lua/plugins/nvim-lspconfig.lua @@ -0,0 +1 @@ +require("lsp").setup() diff --git a/lua/plugins/nvim-notify.lua b/lua/plugins/nvim-notify.lua new file mode 100644 index 0000000..4e42f46 --- /dev/null +++ b/lua/plugins/nvim-notify.lua @@ -0,0 +1,6 @@ +vim.notify = require("notify") +---@diagnostic disable-next-line: missing-fields +vim.notify.setup({ + render = "default", + stages = "static", +}) diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua index c449c34..f572b87 100644 --- a/lua/plugins/nvim-tree.lua +++ b/lua/plugins/nvim-tree.lua @@ -34,241 +34,217 @@ local function disable_highlights() }) end ----@type LazyPluginSpec -return { - "nvim-tree/nvim-tree.lua", - dependencies = { - "tpope/vim-fugitive", - "nvim-tree/nvim-web-devicons", - }, - event = "VimEnter", - keys = { - { - "tt", - function() - require("nvim-tree.api").tree.toggle({ - find_file = true, - focus = false, - }) - end, - }, - { - "ga", - function() - require("nvim-tree.api").tree.open() - end, - }, - }, - config = function() - ---@class nvim_tree.api.decorator.UserDecorator - local UserDecorator = require("nvim-tree.api").decorator.UserDecorator +vim.keymap.set("n", "tt", function() + require("nvim-tree.api").tree.toggle({ find_file = true, focus = false, }) +end) - ---@class GitIgnoreDecorator: nvim_tree.api.decorator.UserDecorator - local GitIgnoreDecorator = UserDecorator:extend() +---@class nvim_tree.api.decorator.UserDecorator +local UserDecorator = require("nvim-tree.api").decorator.UserDecorator - function GitIgnoreDecorator:new() - self.enabled = true - self.highlight_range = "name" - self.icon_placement = "none" - self.file_hl = "NvimTreeGitFileIgnoredHL" - self.folder_hl = "NvimTreeGitFolderIgnoredHL" +---@class GitIgnoreDecorator: nvim_tree.api.decorator.UserDecorator +local GitIgnoreDecorator = UserDecorator:extend() + +function GitIgnoreDecorator:new() + self.enabled = true + self.highlight_range = "name" + self.icon_placement = "none" + self.file_hl = "NvimTreeGitFileIgnoredHL" + self.folder_hl = "NvimTreeGitFolderIgnoredHL" +end + +---@param node Node +---@return string? highlight_group +function GitIgnoreDecorator:highlight_group(node) + local status = node.git_status + if not status then + return + end + + if status.file == "!!" then + return self.file_hl + elseif status.dir and status.dir.direct == "!!" then + return self.folder_hl + end +end + +local signs = require("lsp").diagnostic_signs +require("nvim-tree").setup({ + on_attach = function(bufnr) + local function opts(desc) + return { + desc = "nvim-tree: " .. desc, + buffer = bufnr, + noremap = true, + silent = true, + nowait = true, + } end - ---@param node Node - ---@return string? highlight_group - function GitIgnoreDecorator:highlight_group(node) - local status = node.git_status - if not status then - return - end + local api = require("nvim-tree.api") + api.config.mappings.default_on_attach(bufnr) - if status.file == "!!" then - return self.file_hl - elseif status.dir and status.dir.direct == "!!" then - return self.folder_hl - end - end + vim.keymap.del("n", "D", { buffer = bufnr }) + vim.keymap.del("n", "bt", { buffer = bufnr }) - local signs = require("lsp").diagnostic_signs - require("nvim-tree").setup({ - on_attach = function(bufnr) - local function opts(desc) - return { - desc = "nvim-tree: " .. desc, - buffer = bufnr, - noremap = true, - silent = true, - nowait = true, - } - end - - local api = require("nvim-tree.api") - api.config.mappings.default_on_attach(bufnr) - - vim.keymap.del("n", "D", { buffer = bufnr }) - vim.keymap.del("n", "bt", { buffer = bufnr }) - - vim.keymap.set("n", "d", api.fs.trash, opts("Trash")) - vim.keymap.set( - "n", - "bd", - api.marks.bulk.trash, - opts("Trash Bookmarked") - ) - vim.keymap.set("n", "", api.node.open.edit, opts("Open")) - vim.keymap.set( - "n", - "", - api.node.navigate.parent_close, - opts("Close Directory") - ) - end, - hijack_cursor = true, - hijack_netrw = false, - view = { - width = 50, - preserve_window_proportions = true, - }, - renderer = { - full_name = true, - root_folder_label = function(path) - local label = vim.fn.fnamemodify(path, ":~") - local git_head = vim.fn.FugitiveHead() - if git_head ~= "" then - label = label .. ("  %s"):format(git_head) - end - return label - end, - special_files = {}, - decorators = { - "Git", - GitIgnoreDecorator, - "Open", - "Modified", - "Bookmark", - "Diagnostics", - "Copied", - "Cut", - }, - highlight_modified = "icon", - highlight_bookmarks = "name", - highlight_clipboard = "all", - indent_markers = { - enable = true, - icons = { - corner = "│", - none = "│", - }, - }, - icons = { - git_placement = "after", - diagnostics_placement = "signcolumn", - bookmarks_placement = "after", - symlink_arrow = " -> ", - show = { - file = true, - folder = true, - folder_arrow = false, - bookmarks = false, - }, - web_devicons = { - file = { - color = false, - }, - }, - glyphs = { - modified = "*", - git = { - unstaged = "M", - staged = "M", - unmerged = "!", - renamed = "R", - untracked = "?", - deleted = "D", - ignored = " ", - }, - }, - }, - }, - update_focused_file = { - enable = true, - }, - diagnostics = { - enable = true, - show_on_dirs = true, - icons = { - hint = signs.text[vim.diagnostic.severity.HINT], - info = signs.text[vim.diagnostic.severity.INFO], - warning = signs.text[vim.diagnostic.severity.WARN], - error = signs.text[vim.diagnostic.severity.ERROR], - }, - }, - modified = { - enable = true, - }, - filters = { - git_ignored = false, - custom = { "^\\.git$" }, - }, - live_filter = { - prefix = "Filter: ", - always_show_folders = false, - }, - filesystem_watchers = { - enable = true, - }, - actions = { - use_system_clipboard = false, - change_dir = { - enable = false, - }, - expand_all = { - exclude = { ".venv", "build" }, - }, - open_file = { - window_picker = { - enable = false, - }, - }, - }, - notify = { - threshold = vim.log.levels.WARN, - absolute_path = false, - }, - help = { - sort_by = "desc", - }, - sync_root_with_cwd = true, - git = { - show_on_open_dirs = false, - }, - }) - - override_highlights() - disable_highlights() - - vim.api.nvim_create_autocmd("QuitPre", { - callback = function() - local tree_wins = {} - local floating_wins = {} - local wins = vim.api.nvim_list_wins() - for _, w in ipairs(wins) do - local bufname = - vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) - if bufname:match("NvimTree_") ~= nil then - table.insert(tree_wins, w) - end - if vim.api.nvim_win_get_config(w).relative ~= "" then - table.insert(floating_wins, w) - end - end - if 1 == #wins - #floating_wins - #tree_wins then - -- Should quit, so we close all invalid windows. - for _, w in ipairs(tree_wins) do - vim.api.nvim_win_close(w, true) - end - end - end, - }) + vim.keymap.set("n", "d", api.fs.trash, opts("Trash")) + vim.keymap.set( + "n", + "bd", + api.marks.bulk.trash, + opts("Trash Bookmarked") + ) + vim.keymap.set("n", "", api.node.open.edit, opts("Open")) + vim.keymap.set( + "n", + "", + api.node.navigate.parent_close, + opts("Close Directory") + ) end, -} + hijack_cursor = true, + hijack_netrw = false, + view = { + width = 50, + preserve_window_proportions = true, + }, + renderer = { + full_name = true, + root_folder_label = function(path) + local label = vim.fn.fnamemodify(path, ":~") + local git_head = vim.fn.FugitiveHead() + if git_head ~= "" then + label = label .. ("  %s"):format(git_head) + end + return label + end, + special_files = {}, + decorators = { + "Git", + GitIgnoreDecorator, + "Open", + "Modified", + "Bookmark", + "Diagnostics", + "Copied", + "Cut", + }, + highlight_modified = "icon", + highlight_bookmarks = "name", + highlight_clipboard = "all", + indent_markers = { + enable = true, + icons = { + corner = "│", + none = "│", + }, + }, + icons = { + git_placement = "after", + diagnostics_placement = "signcolumn", + bookmarks_placement = "after", + symlink_arrow = " -> ", + show = { + file = true, + folder = true, + folder_arrow = false, + bookmarks = false, + }, + web_devicons = { + file = { + color = false, + }, + }, + glyphs = { + modified = "*", + git = { + unstaged = "M", + staged = "M", + unmerged = "!", + renamed = "R", + untracked = "?", + deleted = "D", + ignored = " ", + }, + }, + }, + }, + update_focused_file = { + enable = true, + }, + diagnostics = { + enable = true, + show_on_dirs = true, + icons = { + hint = signs.text[vim.diagnostic.severity.HINT], + info = signs.text[vim.diagnostic.severity.INFO], + warning = signs.text[vim.diagnostic.severity.WARN], + error = signs.text[vim.diagnostic.severity.ERROR], + }, + }, + modified = { + enable = true, + }, + filters = { + git_ignored = false, + custom = { "^\\.git$" }, + }, + live_filter = { + prefix = "Filter: ", + always_show_folders = false, + }, + filesystem_watchers = { + enable = true, + }, + actions = { + use_system_clipboard = false, + change_dir = { + enable = false, + }, + expand_all = { + exclude = { ".venv", "build" }, + }, + open_file = { + window_picker = { + enable = false, + }, + }, + }, + notify = { + threshold = vim.log.levels.WARN, + absolute_path = false, + }, + help = { + sort_by = "desc", + }, + sync_root_with_cwd = true, + git = { + show_on_open_dirs = false, + }, +}) + +override_highlights() +disable_highlights() + +vim.api.nvim_create_autocmd("QuitPre", { + callback = function() + local tree_wins = {} + local floating_wins = {} + local wins = vim.api.nvim_list_wins() + for _, w in ipairs(wins) do + local bufname = + vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w)) + if bufname:match("NvimTree_") ~= nil then + table.insert(tree_wins, w) + end + if vim.api.nvim_win_get_config(w).relative ~= "" then + table.insert(floating_wins, w) + end + end + if 1 == #wins - #floating_wins - #tree_wins then + -- Should quit, so we close all invalid windows. + for _, w in ipairs(tree_wins) do + vim.api.nvim_win_close(w, true) + end + end + end, +}) diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index 94165e8..9f39a00 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -1,7 +1,6 @@ --- https://github.com/nvim-treesitter/nvim-treesitter +local log = require("log") local languages = { - "dap_repl", "bash", "zsh", "python", @@ -23,54 +22,46 @@ local languages = { "markdown", "go", "svelte", - { "scss", extra_ft = { "css" } }, + "scss", "tsx", "typescript", "yaml", } ----@type LazyPluginSpec -return { - "nvim-treesitter/nvim-treesitter", - lazy = false, - build = function() - local ts = require("nvim-treesitter") - ts.install(languages):await(ts.update) - end, - dependencies = { - { - "LiadOz/nvim-dap-repl-highlights", - config = true, - }, - }, - config = function() - local ts = require("nvim-treesitter") - ts.install(languages):await(function() - local filetypes = {} - for i, value in ipairs(languages) do - local lang = value - if type(value) == "table" then - lang = value[1] - for _, ft in ipairs(value.extra_ft) do - vim.treesitter.language.register(lang, ft) - end - filetypes[i] = lang - end - for _, ft in ipairs(vim.treesitter.language.get_filetypes(lang)) do - if not vim.list_contains(filetypes, ft) then - table.insert(filetypes, ft) - end +local ts = require("nvim-treesitter") +ts.setup({ + install_dir = string.format("%s/nvim-treesitter", vim.fn.stdpath("data")) +}) +ts.install(languages):await(function(err) + if err then + log.error("Error: %s", err) + return + end + + ---@diagnostic disable-next-line: redefined-local + ts.update():await(function(err) + if err then + log.error("Error: %s", err) + return + end + + local filetypes = {} + for _, lang in ipairs(languages) do + for _, ft in ipairs(vim.treesitter.language.get_filetypes(lang)) do + if not vim.list_contains(filetypes, ft) then + table.insert(filetypes, ft) end end + end - vim.api.nvim_create_autocmd("FileType", { - pattern = filetypes, - callback = function() - vim.treesitter.start() - vim.wo.foldmethod = "expr" - vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" - end, - }) - end) - end, -} + vim.api.nvim_create_autocmd("FileType", { + pattern = filetypes, + callback = function() + vim.treesitter.start() + vim.wo.foldmethod = "expr" + vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" + end, + }) + end + ) +end) diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index 05becfb..008a549 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -1,45 +1,33 @@ ----@type LazyPluginSpec -return { - "stevearc/oil.nvim", - keys = { - { - "fe", - function() - vim.cmd.Oil("--float") - end, - mode = "n", - }, +require("oil").setup({ + default_file_explorer = true, + columns = { + -- "icon", + "permissions", + "size", + "mtime", }, - ---@type oil.SetupOpts - opts = { - default_file_explorer = true, - columns = { - -- "icon", - "permissions", - "size", - "mtime", - }, - delete_to_trash = true, - float = { - max_width = 80, - max_height = 20, - }, - skip_confirm_for_simple_edits = true, - watch_for_changes = false, - keymaps = { - [""] = "actions.close", - ["q"] = "actions.close", - [""] = false, - [""] = "actions.parent", - [""] = "actions.select", - [""] = "actions.refresh", - }, - view_options = { - show_hidden = true, - natural_order = false, - }, - win_options = { - colorcolumn = "", - }, + delete_to_trash = true, + float = { + max_width = 80, + max_height = 20, }, -} + skip_confirm_for_simple_edits = true, + watch_for_changes = false, + keymaps = { + [""] = "actions.close", + ["q"] = "actions.close", + [""] = false, + [""] = "actions.parent", + [""] = "actions.select", + [""] = "actions.refresh", + }, + view_options = { + show_hidden = true, + natural_order = false, + }, + win_options = { + colorcolumn = "", + }, +}) + +vim.keymap.set("n", "fe", function() vim.cmd.Oil("--float") end) diff --git a/lua/plugins/onedark.lua b/lua/plugins/onedark.lua index 657c99b..216112c 100644 --- a/lua/plugins/onedark.lua +++ b/lua/plugins/onedark.lua @@ -1,33 +1,26 @@ ----@type LazyPluginSpec -return { - "navarasu/onedark.nvim", - priority = 1000, - config = function() - require("onedark").setup({ style = "darker" }) +require("onedark").setup({ style = "darker" }) - local c = require("onedark.colors") - local highlights = { - ["@string.special.url"] = { fg = "NONE", fmt = "NONE" }, - ["@lsp.type.macro.gotmpl"] = { fg = "NONE", fmt = "NONE" }, - Cursor = { fg = c.bg, bg = c.fg, fmt = "NONE" }, - FloatTitle = { fg = c.orange, bg = c.bg_d }, - NormalFloat = { bg = c.bg_d }, - FloatBorder = { bg = c.bg_d }, - TabLine = { fg = c.grey, bg = c.bg1 }, - TabLineSel = { fg = c.fg, bg = c.bg2 }, - TabLineFill = { bg = c.bg1 }, - EndOfBuffer = { fg = "NONE", bg = "NONE" }, - NvimTreeIndentMarker = { fg = c.bg3 }, - TelescopeNormal = { bg = c.bg_d }, - TelescopeTitle = { fg = c.orange, bg = c.bg_d }, - TelescopePromptBorder = { fg = c.grey, bg = c.bg_d }, - TelescopeResultsBorder = { fg = c.grey, bg = c.bg_d }, - TelescopePreviewBorder = { fg = c.grey, bg = c.bg_d }, - DiffAdd = { bg = "#1a2f22" }, - DiffChange = { bg = "#15304a" }, - DiffDelete = { bg = "#311c1e" }, - } - require("onedark").set_options("highlights", highlights) - require("onedark").load() - end, +local c = require("onedark.colors") +local highlights = { + ["@string.special.url"] = { fg = "NONE", fmt = "NONE" }, + ["@lsp.type.macro.gotmpl"] = { fg = "NONE", fmt = "NONE" }, + Cursor = { fg = c.bg, bg = c.fg, fmt = "NONE" }, + FloatTitle = { fg = c.orange, bg = c.bg_d }, + NormalFloat = { bg = c.bg_d }, + FloatBorder = { bg = c.bg_d }, + TabLine = { fg = c.grey, bg = c.bg1 }, + TabLineSel = { fg = c.fg, bg = c.bg2 }, + TabLineFill = { bg = c.bg1 }, + EndOfBuffer = { fg = "NONE", bg = "NONE" }, + NvimTreeIndentMarker = { fg = c.bg3 }, + TelescopeNormal = { bg = c.bg_d }, + TelescopeTitle = { fg = c.orange, bg = c.bg_d }, + TelescopePromptBorder = { fg = c.grey, bg = c.bg_d }, + TelescopeResultsBorder = { fg = c.grey, bg = c.bg_d }, + TelescopePreviewBorder = { fg = c.grey, bg = c.bg_d }, + DiffAdd = { bg = "#1a2f22" }, + DiffChange = { bg = "#15304a" }, + DiffDelete = { bg = "#311c1e" }, } +require("onedark").set_options("highlights", highlights) +require("onedark").load() diff --git a/lua/plugins/outline.lua b/lua/plugins/outline.lua index 31128ad..50c16e2 100644 --- a/lua/plugins/outline.lua +++ b/lua/plugins/outline.lua @@ -1,16 +1,9 @@ ----@type LazyPluginSpec -return { - "hedyhli/outline.nvim", - lazy = true, - cmd = { "Outline", "OutlineOpen" }, - keys = { -- Example mapping to toggle outline - { "o", "Outline", desc = "Toggle outline" }, +require("outline").setup({ + outline_window = { + relative_width = false, + split_command = "aboveleft 40vsp", + focus_on_open = false, }, - opts = { - outline_window = { - relative_width = false, - split_command = "aboveleft 40vsp", - focus_on_open = false, - }, - }, -} +}) + +vim.keymap.set("n", "o", "Outline") diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 594d6c5..673ce4a 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -1,194 +1,181 @@ --- https://github.com/nvim-telescope/telescope.nvim +local telescope = require("telescope") +local builtin = require("telescope.builtin") +local actions = require("telescope.actions") +local utils = require("telescope.utils") ----@type LazyPluginSpec -return { - "nvim-telescope/telescope.nvim", - event = "VeryLazy", - dependencies = { - "nvim-lua/plenary.nvim", - "debugloop/telescope-undo.nvim", - "rcarriga/nvim-notify", - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", +telescope.setup({ + defaults = { + mappings = { + n = { + q = actions.close, + [""] = actions.close, + [""] = actions.select_default, + [""] = actions.results_scrolling_up, + [""] = actions.results_scrolling_down, + }, + }, + file_ignore_patterns = { + "^%.git/", + }, + layout_config = { + height = 30, + width = 80, + scroll_speed = 3, }, }, - config = function() - local telescope = require("telescope") - local builtin = require("telescope.builtin") - local actions = require("telescope.actions") - local utils = require("telescope.utils") - - telescope.setup({ - defaults = { - mappings = { - n = { - q = actions.close, - [""] = actions.close, - [""] = actions.select_default, - [""] = actions.results_scrolling_up, - [""] = actions.results_scrolling_down, - }, + extensions = { + undo = { + mappings = { + i = { + [""] = require("telescope-undo.actions").yank_deletions, + [""] = false, + [""] = false, + [""] = require("telescope-undo.actions").yank_additions, }, - file_ignore_patterns = { - "^%.git/", - }, - layout_config = { - height = 30, - width = 80, - scroll_speed = 3, + n = { + ["u"] = false, }, }, - extensions = { - undo = { - mappings = { - i = { - [""] = require("telescope-undo.actions").yank_deletions, - [""] = false, - [""] = false, - [""] = require("telescope-undo.actions").yank_additions, - }, - n = { - ["u"] = false, - }, - }, + }, + }, + pickers = { + oldfiles = { + initial_mode = "normal", + }, + buffers = { + initial_mode = "normal", + mappings = { + n = { + [""] = actions.delete_buffer, }, }, - pickers = { - oldfiles = { - initial_mode = "normal", - }, - buffers = { - initial_mode = "normal", - mappings = { - n = { - [""] = actions.delete_buffer, - }, - }, - }, - live_grep = { - layout_config = { - width = 160, - preview_width = 80, - }, - }, - highlights = { - layout_config = { - width = 160, - preview_width = 80, - }, - }, - diagnostics = { - initial_mode = "normal", - layout_config = { - width = 160, - preview_width = 80, - }, - }, - lsp_definitions = { - initial_mode = "normal", - layout_config = { - width = 160, - preview_width = 80, - }, - }, - lsp_type_definitions = { - initial_mode = "normal", - }, - lsp_implementations = { - initial_mode = "normal", - }, - lsp_references = { - initial_mode = "normal", - layout_config = { - width = 160, - preview_width = 80, - }, - }, - git_status = { - initial_mode = "normal", - }, + }, + live_grep = { + layout_config = { + width = 160, + preview_width = 80, }, - }) + }, + highlights = { + layout_config = { + width = 160, + preview_width = 80, + }, + }, + diagnostics = { + initial_mode = "normal", + layout_config = { + width = 160, + preview_width = 80, + }, + }, + lsp_definitions = { + initial_mode = "normal", + layout_config = { + width = 160, + preview_width = 80, + }, + }, + lsp_type_definitions = { + initial_mode = "normal", + }, + lsp_implementations = { + initial_mode = "normal", + }, + lsp_references = { + initial_mode = "normal", + layout_config = { + width = 160, + preview_width = 80, + }, + }, + git_status = { + initial_mode = "normal", + }, + }, +}) - vim.keymap.set("n", "ff", function() - builtin.find_files({ - hidden = true, - no_ignore = true, - no_ignore_parent = true, - previewer = false, - }) - end) - vim.keymap.set("n", "fr", function() - builtin.oldfiles({ - only_cwd = true, - hidden = true, - previewer = false, - }) - end) - vim.keymap.set("n", "fg", function() - builtin.live_grep({ - additional_args = function(_) - return { - "--hidden", - "--iglob=!.venv", - "--iglob=!vendor", - "--iglob=!.git", - } - end, - previewer = true, - }) - end) - vim.keymap.set("n", "fG", function() - builtin.live_grep({ - additional_args = function(_) - return { - "--hidden", - "--iglob=!.venv", - "--iglob=!vendor", - "--iglob=!.git", - } - end, - cwd = utils.buffer_dir(), - previewer = true, - }) - end) - vim.keymap.set("n", "fb", function() - builtin.buffers({ previewer = false, sort_mru = true }) - end) - vim.keymap.set("n", "fd", function() - builtin.diagnostics({ - bufnr = 0, - }) - end) +vim.keymap.set("n", "ff", function() + builtin.find_files({ + hidden = true, + no_ignore = true, + no_ignore_parent = true, + previewer = false, + }) +end) - vim.keymap.set("n", "dl", builtin.diagnostics) - vim.keymap.set("n", "grt", builtin.lsp_type_definitions) - vim.keymap.set("n", "gd", builtin.lsp_definitions) - vim.keymap.set("n", "gri", builtin.lsp_implementations) - vim.keymap.set("n", "grr", builtin.lsp_references) +vim.keymap.set("n", "fr", function() + builtin.oldfiles({ + only_cwd = true, + hidden = true, + previewer = false, + }) +end) - telescope.load_extension("fzf") - telescope.load_extension("notify") - vim.keymap.set("n", "fn", function() - telescope.extensions.notify.notify({ - initial_mode = "normal", - layout_config = { - width = 160, - preview_width = 80, - }, - }) - end) +vim.keymap.set("n", "fg", function() + builtin.live_grep({ + additional_args = function(_) + return { + "--hidden", + "--iglob=!.venv", + "--iglob=!vendor", + "--iglob=!.git", + } + end, + previewer = true, + }) +end) - telescope.load_extension("undo") - vim.keymap.set("n", "fu", function() - telescope.extensions.undo.undo({ - initial_mode = "normal", - layout_config = { - width = 160, - preview_width = 80, - }, - }) - end) - end, -} +vim.keymap.set("n", "fG", function() + builtin.live_grep({ + additional_args = function(_) + return { + "--hidden", + "--iglob=!.venv", + "--iglob=!vendor", + "--iglob=!.git", + } + end, + cwd = utils.buffer_dir(), + previewer = true, + }) +end) + +vim.keymap.set("n", "fb", function() + builtin.buffers({ previewer = false, sort_mru = true }) +end) + +vim.keymap.set("n", "fd", function() + builtin.diagnostics({ + bufnr = 0, + }) +end) + +vim.keymap.set("n", "dl", builtin.diagnostics) +vim.keymap.set("n", "grt", builtin.lsp_type_definitions) +vim.keymap.set("n", "gd", builtin.lsp_definitions) +vim.keymap.set("n", "gri", builtin.lsp_implementations) +vim.keymap.set("n", "grr", builtin.lsp_references) + +telescope.load_extension("fzf") +telescope.load_extension("notify") +vim.keymap.set("n", "fn", function() + telescope.extensions.notify.notify({ + initial_mode = "normal", + layout_config = { + width = 160, + preview_width = 80, + }, + }) +end) + +telescope.load_extension("undo") +vim.keymap.set("n", "fu", function() + telescope.extensions.undo.undo({ + initial_mode = "normal", + layout_config = { + width = 160, + preview_width = 80, + }, + }) +end) diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua index 8bad085..f6af4e6 100644 --- a/lua/plugins/undotree.lua +++ b/lua/plugins/undotree.lua @@ -1,20 +1,5 @@ -local function undo_tree_tab() - vim.cmd.tabnew() - vim.cmd.bprevious() - vim.cmd.UndotreeToggle() - vim.cmd.UndotreeFocus() -end +vim.cmd.packadd("nvim.undotree") ----@type LazyPluginSpec -return { - "mbbill/undotree", - keys = { - { "uu", undo_tree_tab, mode = "n" }, - }, - init = function(_) - vim.g.undotree_WindowLayout = 2 - vim.g.undotree_DiffCommand = "diff -u" - vim.g.undotree_SplitWidth = 50 - vim.g.undotree_DiffpanelHeight = 20 - end, -} +vim.keymap.set("n", "uu", function() + require("undotree").open({ command = "leftabove40vnew" }) +end) diff --git a/lua/plugins/vim-flog.lua b/lua/plugins/vim-flog.lua new file mode 100644 index 0000000..ee643db --- /dev/null +++ b/lua/plugins/vim-flog.lua @@ -0,0 +1 @@ +vim.keymap.set("n", "gl", vim.cmd.Flog) diff --git a/lua/plugins/vim-fugitive.lua b/lua/plugins/vim-fugitive.lua new file mode 100644 index 0000000..759c5b1 --- /dev/null +++ b/lua/plugins/vim-fugitive.lua @@ -0,0 +1,46 @@ +local function open_git_status() + local previous_win = vim.api.nvim_get_current_win() + vim.cmd("leftabove vertical G") + vim.api.nvim_win_set_width(0, 50) + vim.api.nvim_set_option_value("winfixwidth", true, { scope = "local" }) + vim.api.nvim_set_current_win(previous_win) +end + +local function get_git_status_win() + local current_tabpage = vim.api.nvim_get_current_tabpage() + for _, win in ipairs(vim.api.nvim_tabpage_list_wins(current_tabpage)) do + local buf = vim.api.nvim_win_get_buf(win) + local buftype = vim.api.nvim_get_option_value("buftype", { buf = buf }) + if + buftype == "nowrite" + and vim.api.nvim_buf_get_name(buf):match("^fugitive://.*%.git//$") + then + return win + end + end +end + +local function toggle_git_status() + local win = get_git_status_win() + if win then + vim.api.nvim_win_close(win, false) + return + end + + open_git_status() +end + +vim.keymap.set("n", "gd", vim.cmd.Gvdiffsplit) +vim.keymap.set("n", "gD", function() vim.cmd.Gvdiffsplit("HEAD") end) +vim.keymap.set("n", "gh", vim.cmd.Ghdiffsplit) +vim.keymap.set("n", "gH", function() vim.cmd.Ghdiffsplit("HEAD") end) +vim.keymap.set("n", "gc", function() vim.cmd.G("commit") end) +vim.keymap.set("n", "ga", function() vim.cmd.G("commit --amend") end) +vim.keymap.set("n", "gp", function() vim.cmd.G("push") end) +vim.keymap.set("n", "gg", toggle_git_status) + +vim.api.nvim_create_autocmd("BufWritePost", { + callback = function() + vim.fn["fugitive#ReloadStatus"]() + end, +}) diff --git a/lua/util.lua b/lua/util.lua index b2dcc1b..8a1fffc 100644 --- a/lua/util.lua +++ b/lua/util.lua @@ -4,84 +4,6 @@ local Util = {} Util.os_name = vim.uv.os_uname().sysname ---- Check that an executable is available ---- @param exe string Array to look for ---- @return boolean -function Util.is_executable(exe) - return vim.fn.executable(exe) == 1 -end - ---- Check that at least one executable is available ---- @param exes table Array of exes ---- @return boolean -function Util.any_installed(exes) - for _, e in ipairs(exes) do - if Util.is_executable(e) then - return true - end - end - - return false -end - ---- Asserts that an executable is available ---- Raises error if missing. ---- @param exe string Array to look for -function Util.assert_installed(exe) - assert(Util.is_executable(exe), "Missing executable '" .. exe .. "'.") -end - ---- Asserts that at least one executable is available ---- Raises error if missing. ---- @param exes table Array of exes -function Util.assert_any_installed(exes) - assert( - Util.any_installed(exes), - "At least one of the following is required:\n" - .. table.concat(exes, ", ") - ) -end - ---- Asserts that a python module is installed ----@param mod string The python module to check -function Util.python3_module_is_installed(mod) - if not Util.is_executable("python3") then - return false - end - - local resp = vim.system({ "python3", "-c", "import " .. mod }):wait() - return resp.code == 0 -end - ---- Asserts that a python module is installed ----@param mod string The python module to check -function Util.assert_python3_module_installed(mod) - if not Util.python3_module_is_installed(mod) then - error("Python3 module " .. mod .. " not installed") - end -end - ---- Attempts to load a module and logs errors on failure. ----@param module string The module to attempt to load. ----@return any module The loaded module if successful, otherwise nil. -function Util.try_require(module) - local has_module, resp = pcall(require, module) - - if has_module then - return resp - end - - log.error("Failed to load module %s:\n%s", module, resp) -end - ---- Checks if it is possible to require a module ----@param module string ----@return boolean -function Util.has_module(module) - local has_module, _ = pcall(require, module) - return has_module -end - ---@alias OutputStream ---| '"stdout"' ---| '"stderr"' diff --git a/nvim-pack-lock.json b/nvim-pack-lock.json new file mode 100644 index 0000000..ecebd8c --- /dev/null +++ b/nvim-pack-lock.json @@ -0,0 +1,97 @@ +{ + "plugins": { + "Comment.nvim": { + "rev": "e30b7f2008e52442154b66f7c519bfd2f1e32acb", + "src": "https://github.com/numToStr/Comment.nvim" + }, + "blink.cmp": { + "rev": "78336bc89ee5365633bcf754d93df01678b5c08f", + "src": "https://github.com/saghen/blink.cmp", + "version": "1.0.0 - 2.0.0" + }, + "fidget.nvim": { + "rev": "889e2e96edef4e144965571d46f7a77bcc4d0ddf", + "src": "https://github.com/j-hui/fidget.nvim" + }, + "gitsigns.nvim": { + "rev": "0d797daee85366bc242580e352a4f62d67557b84", + "src": "https://github.com/lewis6991/gitsigns.nvim" + }, + "grug-far.nvim": { + "rev": "37d0eafc6a2dcf8641aa19fc2a8db5e391b7f16b", + "src": "https://github.com/MagicDuck/grug-far.nvim" + }, + "mason-auto-install.nvim": { + "rev": "fd76cea6bbac98726c0c763deea3c449adf50daf", + "src": "https://github.com/owallb/mason-auto-install.nvim" + }, + "mason.nvim": { + "rev": "b03fb0f20bc1d43daf558cda981a2be22e73ac42", + "src": "https://github.com/mason-org/mason.nvim" + }, + "nvim-dap": { + "rev": "45a69eba683a2c448dd9ecfc4de89511f0646b5f", + "src": "https://github.com/mfussenegger/nvim-dap" + }, + "nvim-dap-repl-highlights": { + "rev": "f31deba47fe3ee6ff8d2f13d9dbd06b2d1ae06b5", + "src": "https://github.com/LiadOz/nvim-dap-repl-highlights" + }, + "nvim-dap-view": { + "rev": "e57ac4051aa56293e89991ab93bc148de35321ca", + "src": "https://github.com/igorlfs/nvim-dap-view" + }, + "nvim-lspconfig": { + "rev": "bedca8b426b2fee0ccac596d167d71bbe971253f", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-notify": { + "rev": "8701bece920b38ea289b457f902e2ad184131a5d", + "src": "https://github.com/rcarriga/nvim-notify" + }, + "nvim-tree.lua": { + "rev": "509962f21ab7289d8dcd28568af539be39a8c01e", + "src": "https://github.com/nvim-tree/nvim-tree.lua" + }, + "nvim-treesitter": { + "rev": "4916d6592ede8c07973490d9322f187e07dfefac", + "src": "https://github.com/nvim-treesitter/nvim-treesitter" + }, + "oil.nvim": { + "rev": "0fcc83805ad11cf714a949c98c605ed717e0b83e", + "src": "https://github.com/stevearc/oil.nvim" + }, + "onedark.nvim": { + "rev": "213c23ae45a04797572242568d5d51937181792d", + "src": "https://github.com/navarasu/onedark.nvim" + }, + "outline.nvim": { + "rev": "c293eb56db880a0539bf9d85b4a27816960b863e", + "src": "https://github.com/hedyhli/outline.nvim" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "telescope-fzf-native.nvim": { + "rev": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c", + "src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + "telescope-undo.nvim": { + "rev": "928d0c2dc9606e01e2cc547196f48d2eaecf58e5", + "src": "https://github.com/debugloop/telescope-undo.nvim" + }, + "telescope.nvim": { + "rev": "7ef4d6dccb78ee71e552bbd866176762ad328afa", + "src": "https://github.com/nvim-telescope/telescope.nvim" + }, + "vim-flog": { + "rev": "665b16ac8915f746bc43c9572b4581a5e9047216", + "src": "https://github.com/rbong/vim-flog" + }, + "vim-fugitive": { + "rev": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0", + "src": "https://github.com/tpope/vim-fugitive" + } + } +} diff --git a/queries/gotmpl/injections.scm b/queries/gotmpl/injections.scm deleted file mode 100644 index 16d5736..0000000 --- a/queries/gotmpl/injections.scm +++ /dev/null @@ -1,3 +0,0 @@ -((text) @injection.content - (#set! injection.language "html") - (#set! injection.combined))