diff --git a/common/.config/nvim/lua/plugins/code-completion.lua b/common/.config/nvim/lua/plugins/code-completion.lua index 5ddabd0..fcca8dd 100644 --- a/common/.config/nvim/lua/plugins/code-completion.lua +++ b/common/.config/nvim/lua/plugins/code-completion.lua @@ -57,6 +57,27 @@ return { nerd_font_variant = "mono", }, + completion = { + accept = { + -- experimental auto-brackets support + auto_brackets = { + enabled = true, + }, + }, + menu = { + draw = { + treesitter = { "lsp" }, + }, + }, + documentation = { + auto_show = true, + auto_show_delay_ms = 200, + }, + ghost_text = { + enabled = vim.g.ai_cmp, + }, + }, + signature = { enabled = true }, -- This comes from the luasnip extra, if you don't add it, won't be able to @@ -85,6 +106,7 @@ return { "luasnip", "path", "codeium", + "markdown", }, cmdline = {}, @@ -114,6 +136,10 @@ return { module = "blink.compat.source", score_offset = 1200, }, + markdown = { + name = "RenderMarkdown", + module = "render-markdown.integ.blink", + }, }, }, }, diff --git a/common/.config/nvim/lua/plugins/code-db.lua b/common/.config/nvim/lua/plugins/code-db.lua index 8d5ffc5..1f0144a 100644 --- a/common/.config/nvim/lua/plugins/code-db.lua +++ b/common/.config/nvim/lua/plugins/code-db.lua @@ -12,8 +12,20 @@ return { { "kristijanhusak/vim-dadbod-completion" }, }, config = function() - vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui" - vim.g.db_ui_use_nerd_fonts = 1 + local data_path = vim.fn.stdpath("data") + + vim.g.db_ui_auto_execute_table_helpers = 1 + vim.g.db_ui_save_location = data_path .. "/db_ui" + vim.g.db_ui_show_database_icon = true + vim.g.db_ui_tmp_query_location = data_path .. "/db_ui/tmp" + vim.g.db_ui_use_nerd_fonts = true + vim.g.db_ui_use_nvim_notify = true + + -- NOTE: The default behavior of auto-execution of queries on save is disabled + -- this is useful when you have a big query that you don't want to run every time + -- you save the file running those queries can crash neovim to run use the + -- default keymap: S + vim.g.db_ui_execute_on_save = false vim.api.nvim_create_autocmd("FileType", { pattern = { @@ -35,9 +47,16 @@ return { end, keys = { { "qq", desc = "DB: UI" }, - { "qq", "DBUIToggle", desc = "DB: UI Toggle" }, + { "qq", "DBUIToggle", desc = "DB: UI Toggle" }, { "qa", "DBUIAddConnection", desc = "DB: Add Connection" }, - { "qf", "DBUIFindBuffer", desc = "DB: Find Connection" }, + { "qf", "DBUIFindBuffer", desc = "DB: Find Connection" }, }, }, + + { + "kristijanhusak/vim-dadbod-ui", + cmd = { "DBUI", "DBUIToggle", "DBUIAddConnection", "DBUIFindBuffer" }, + dependencies = "vim-dadbod", + init = function() end, + }, } diff --git a/common/.config/nvim/lua/plugins/code-formatting.lua b/common/.config/nvim/lua/plugins/code-formatting.lua index 1c9c679..088e7c4 100644 --- a/common/.config/nvim/lua/plugins/code-formatting.lua +++ b/common/.config/nvim/lua/plugins/code-formatting.lua @@ -6,6 +6,7 @@ return { event = { "BufWritePre" }, opts = { formatters_by_ft = { + cs = { "csharpier" }, javascript = { "prettierd", "prettier", stop_after_first = true }, typescript = { "prettierd", "prettier", stop_after_first = true }, javascriptreact = { "prettierd", "prettier", stop_after_first = true }, @@ -59,6 +60,10 @@ return { "-gitignore_excludes", }, }, + csharpier = { + command = "dotnet-csharpier", + args = { "--write-stdout" }, + }, }, }, }, diff --git a/common/.config/nvim/lua/plugins/code-generic.lua b/common/.config/nvim/lua/plugins/code-generic.lua index 3f297d0..da9cc0c 100644 --- a/common/.config/nvim/lua/plugins/code-generic.lua +++ b/common/.config/nvim/lua/plugins/code-generic.lua @@ -486,7 +486,7 @@ return { "bash", "html", "css", - "json", + "json5", "yaml", }, diff --git a/common/.config/nvim/lua/plugins/code-lsp.lua b/common/.config/nvim/lua/plugins/code-lsp.lua index 0255596..abb22e0 100644 --- a/common/.config/nvim/lua/plugins/code-lsp.lua +++ b/common/.config/nvim/lua/plugins/code-lsp.lua @@ -119,7 +119,21 @@ return { filetypes = { "html", "twig", "hbs" }, }, cssls = {}, - jsonls = {}, + jsonls = { + -- lazy-load schemastore when needed + on_new_config = function(new_config) + new_config.settings.json.schemas = new_config.settings.json.schemas or {} + vim.list_extend(new_config.settings.json.schemas, require("schemastore").json.schemas()) + end, + settings = { + json = { + format = { + enable = true, + }, + validate = { enable = true }, + }, + }, + }, bashls = { filetypes = { "sh", "bash", "zsh" } }, pylsp = {}, @@ -136,11 +150,16 @@ return { }, omnisharp = { cmd = { "omnisharp" }, - enable_editorconfig_support = true, - enable_ms_build_load_projects_on_demand = false, + handlers = { + ["textDocument/definition"] = function(...) + return require("omnisharp_extended").handler(...) + end, + }, enable_roslyn_analyzers = true, organize_imports_on_format = true, enable_import_completion = true, + enable_editorconfig_support = true, + enable_ms_build_load_projects_on_demand = false, analyze_open_documents_only = false, settings = { dotnet = { @@ -164,6 +183,8 @@ return { ts_ls = { settings = { typescript = { + updateImportOnFileMove = { enabled = "always" }, + suggest = { completeFunctionCalls = true }, inlayHints = { includeInlayParameterNameHints = "all", includeInlayParameterNameHintsWhenArgumentMatchesName = false, @@ -231,6 +252,8 @@ return { "css-lsp", "dockerfile-language-server", "python-lsp-server", + "csharpier", + "netcoredbg", }) require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) diff --git a/common/.config/nvim/lua/plugins/dotnet.lua b/common/.config/nvim/lua/plugins/dotnet.lua index 8d798a0..450faa1 100644 --- a/common/.config/nvim/lua/plugins/dotnet.lua +++ b/common/.config/nvim/lua/plugins/dotnet.lua @@ -1,3 +1,3 @@ return { - -- { "OmniSharp/omnisharp-vim" }, + { "Hoffs/omnisharp-extended-lsp.nvim", lazy = true }, } diff --git a/common/.config/nvim/lua/plugins/ui.lua b/common/.config/nvim/lua/plugins/ui.lua index b246263..642511d 100644 --- a/common/.config/nvim/lua/plugins/ui.lua +++ b/common/.config/nvim/lua/plugins/ui.lua @@ -19,6 +19,50 @@ return { { "machakann/vim-highlightedyank" }, + -- Render Markdown on Neovim + { + "MeanderingProgrammer/render-markdown.nvim", + opts = { + code = { + sign = false, + width = "block", + border = "thick", + position = "right", + language_name = false, + right_pad = 1, + }, + heading = { + sign = false, + icons = {}, + }, + pipe_table = { + preset = "round", + }, + indent = { + enabled = true, + skip_heading = true, + }, + }, + ft = { "markdown", "norg", "rmd", "org" }, + config = function(_, opts) + require("render-markdown").setup(opts) + Snacks.toggle({ + name = "Render Markdown", + get = function() + return require("render-markdown.state").enabled + end, + set = function(enabled) + local m = require("render-markdown") + if enabled then + m.enable() + else + m.disable() + end + end, + }):map("cM") + end, + }, + -- colorscheme { "projekt0n/github-nvim-theme",