From 3ea53a113ffc7d4ba60efb29e7b0e313dcec306a Mon Sep 17 00:00:00 2001 From: Christian Nieves Date: Wed, 25 Dec 2024 20:12:14 -0700 Subject: [PATCH] idk --- vim/.vim/lua/plugins/base.lua | 3 +- vim/.vim/lua/plugins/bevy.lua | 17 ++++ vim/.vim/lua/plugins/conform.lua | 116 +++++++++++++-------------- vim/.vim/lua/plugins/diagnostics.lua | 11 ++- vim/.vim/lua/plugins/rust.lua | 3 + 5 files changed, 87 insertions(+), 63 deletions(-) create mode 100644 vim/.vim/lua/plugins/bevy.lua diff --git a/vim/.vim/lua/plugins/base.lua b/vim/.vim/lua/plugins/base.lua index 181ff37..d269272 100644 --- a/vim/.vim/lua/plugins/base.lua +++ b/vim/.vim/lua/plugins/base.lua @@ -25,6 +25,7 @@ return { { "MagicDuck/grug-far.nvim", config = function() + vim.g.maplocalleader = "," require("grug-far").setup({ -- search and replace engines configuration engines = { @@ -32,7 +33,7 @@ return { ripgrep = { -- ripgrep executable to use, can be a different path if you need to configure path = "rg", - extraArgs = "--.", + -- extraArgs = "-.", }, }, }) diff --git a/vim/.vim/lua/plugins/bevy.lua b/vim/.vim/lua/plugins/bevy.lua new file mode 100644 index 0000000..7fe86ec --- /dev/null +++ b/vim/.vim/lua/plugins/bevy.lua @@ -0,0 +1,17 @@ +return { + "lommix/bevy_inspector.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + "nvim-lua/plenary.nvim", + }, + config = function() + require("bevy_inspector").setup({}) + end, + cmd = { "BevyInspect", "BevyInspectNamed", "BevyInspectQuery" }, + -- stylua: ignore + keys = { + { "bia", ":BevyInspect", desc = "Lists all entities" }, + { "bin", ":BevyInspectNamed", desc = "List all named entities" }, + { "biq", ":BevyInspectQuery", desc = "Query a single component, continues to list all matching entities", }, + }, +} diff --git a/vim/.vim/lua/plugins/conform.lua b/vim/.vim/lua/plugins/conform.lua index 8e7504a..b466835 100644 --- a/vim/.vim/lua/plugins/conform.lua +++ b/vim/.vim/lua/plugins/conform.lua @@ -2,76 +2,76 @@ local use_google = require("utils").use_google vim.g.disable_autoformat = false vim.api.nvim_create_user_command("FormatDisable", function(args) - if args.bang then - -- FormatDisable! will disable formatting just for this buffer - vim.b.disable_autoformat = true - else - vim.g.disable_autoformat = true - end + if args.bang then + -- FormatDisable! will disable formatting just for this buffer + vim.b.disable_autoformat = true + else + vim.g.disable_autoformat = true + end end, { - desc = "Disable autoformat-on-save", - bang = true, + desc = "Disable autoformat-on-save", + bang = true, }) vim.api.nvim_create_user_command("FormatEnable", function() - vim.b.disable_autoformat = false - vim.g.disable_autoformat = false + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false end, { - desc = "Re-enable autoformat-on-save", + desc = "Re-enable autoformat-on-save", }) vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*", - callback = function(args) - if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then - return - end - require("conform").format({ bufnr = args.buf }) - end, + pattern = "*", + callback = function(args) + if vim.g.disable_autoformat or vim.b[args.buf].disable_autoformat then + return + end + require("conform").format({ bufnr = args.buf }) + end, }) return { - { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo", "FormatDisable", "FormatEnable" }, - keys = { + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo", "FormatDisable", "FormatEnable" }, + keys = { -- stylua: ignore { "fmt", function() require("conform").format({ async = true, lsp_fallback = true }) end, mode = "", desc = "Format buffer", }, - }, - -- This will provide type hinting with LuaLS - ---@module "conform" - ---@type conform.setupOpts - opts = { - log_level = vim.log.levels.DEBUG, - formatters_by_ft = { + }, + -- This will provide type hinting with LuaLS + ---@module "conform" + ---@type conform.setupOpts + opts = { + log_level = vim.log.levels.DEBUG, + formatters_by_ft = { - rust = { "rustfmt", lsp_format = "fallback" }, - -- Conform will run multiple formatters sequentially - -- go = { "goimports", "gofmt" }, - -- Use a sub-list to run only the first available formatter - -- javascript = { { "prettierd", "prettier" } }, - lua = { "stylua" }, - -- Conform will run multiple formatters sequentially - python = { "isort", "black" }, - -- Use a sub-list to run only the first available formatter - javascript = { { "prettierd", "prettier" } }, - gdscript = { "gdformat" }, - dashboard = {}, - -- Use the "*" filetype to run formatters on all filetypes. - ["*"] = { "codespell" }, - -- Use the "_" filetype to run formatters on filetypes that don't - -- have other formatters configured. - ["_"] = { "trim_whitespace" }, - }, - format_on_save = function(bufnr) - -- Disable with a global or buffer-local variable - end, - formatters = { - gdformat = { - prepend_args = { "-l", "100" }, - }, - }, - }, - }, + rust = { "rustfmt", lsp_format = "fallback" }, + -- Conform will run multiple formatters sequentially + -- go = { "goimports", "gofmt" }, + -- Use a sub-list to run only the first available formatter + -- javascript = { { "prettierd", "prettier" } }, + lua = { "stylua" }, + -- Conform will run multiple formatters sequentially + python = { "isort", "black" }, + -- Use a sub-list to run only the first available formatter + javascript = { { "prettierd", "prettier" } }, + gdscript = { "gdformat" }, + dashboard = {}, + -- Use the "*" filetype to run formatters on all filetypes. + -- ["*"] = { "codespell" }, + -- Use the "_" filetype to run formatters on filetypes that don't + -- have other formatters configured. + ["_"] = { "trim_whitespace" }, + }, + format_on_save = function(bufnr) + -- Disable with a global or buffer-local variable + end, + formatters = { + gdformat = { + prepend_args = { "-l", "100" }, + }, + }, + }, + }, } diff --git a/vim/.vim/lua/plugins/diagnostics.lua b/vim/.vim/lua/plugins/diagnostics.lua index 581453a..8e0344e 100644 --- a/vim/.vim/lua/plugins/diagnostics.lua +++ b/vim/.vim/lua/plugins/diagnostics.lua @@ -11,12 +11,15 @@ return { use_diagnostic_signs = true, -- enabling this will use the signs defined in your lsp client }) end, + -- stylua: ignore keys = { - { "xt", ":Telescope diagnostics" }, + { "xt", ":Telescope diagnostics" }, { "gr", ":Telescope lsp_references" }, - { "xd", ":Trouble" }, - { "[g", "lua vim.diagnostic.goto_prev()" }, - { "]g", "lua vim.diagnostic.goto_next()" }, + { "xd", ":Trouble diagnostics toggle " }, + { "xbd", ":Trouble diagnostics toggle filter.buf=0" }, + { "xe", ":Trouble diagnostics toggle filter.severity=vim.diagnostic.severity.ERROR" }, + { "[g", ":lua vim.diagnostic.goto_prev()" }, + { "]g", ":lua vim.diagnostic.goto_next()" }, }, }, { diff --git a/vim/.vim/lua/plugins/rust.lua b/vim/.vim/lua/plugins/rust.lua index 05ed6a7..87c6d93 100644 --- a/vim/.vim/lua/plugins/rust.lua +++ b/vim/.vim/lua/plugins/rust.lua @@ -3,6 +3,9 @@ return { "mrcjkb/rustaceanvim", version = "^5", -- Recommended lazy = false, -- This plugin is already lazy + keys = { + -- { "" }, + }, }, { "saecki/crates.nvim",