From 8593923283209cc12089d77db2d849dfc8fad015 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:38:04 +0200 Subject: Changed disable_move to = false --- lua/plugins/dashboard.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/dashboard.lua b/lua/plugins/dashboard.lua index 7eb4814..dd50c65 100644 --- a/lua/plugins/dashboard.lua +++ b/lua/plugins/dashboard.lua @@ -18,7 +18,7 @@ db.setup({ [[ ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║]], [[ ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝]], }, - disable_move = true, + disable_move = false, shortcut = { { desc = " Plugins", group = "@property", action = "PackerStatus", key = "p" }, { -- cgit v1.2.3 From dfde5a2769e47062a1837650c998bd81ab616195 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:38:33 +0200 Subject: Add fidget.nvim setup --- lua/plugins/fidget.lua | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lua/plugins/fidget.lua diff --git a/lua/plugins/fidget.lua b/lua/plugins/fidget.lua new file mode 100644 index 0000000..0f56a6b --- /dev/null +++ b/lua/plugins/fidget.lua @@ -0,0 +1,33 @@ +require("fidget").setup({ + text = { + --spinner = "pipe", -- (Default) animation shown when tasks are ongoing + --spinner = "hamburger", -- animation shown when tasks are ongoing + --spinner = "dots_pulse", -- animation shown when tasks are ongoing + spinner = "dots", -- animation shown when tasks are ongoing + done = "✔", -- character shown when all tasks are complete + commenced = "Started", -- message shown when task starts + completed = "Completed", -- message shown when task completes + }, + fmt = { + task = function(task_name, message, percentage) + if task_name == "diagnostics" then + return false + end + return string.format( + "%s%s [%s]", + message, + percentage and string.format(" (%s%%)", percentage) or "", + task_name + ) + end, + }, + --sources = { -- Sources to configure + --["null-ls"] = { -- Name of source + --ignore = true, -- Ignore notifications from this source + --}, + --}, + debug = { + logging = false, -- whether to enable logging, for debugging + strict = false, -- whether to interpret LSP strictly + }, +}) -- cgit v1.2.3 From 65696862635b8348a5e7e030a0d6e83101db6eba Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:38:49 +0200 Subject: Clean config --- lua/plugins/lsp.lua | 61 ++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 88e31e1..a9b87cf 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -49,7 +49,6 @@ local on_attach = function(client, bufnr) keymap.set(mode, l, r, opts) end - local term_opts = { noremap = true, silent = false } -- Mappings map("n", "K", "lua vim.lsp.buf.hover()") map("n", "gd", "lua vim.lsp.buf.definition()") @@ -116,15 +115,32 @@ local on_attach = function(client, bufnr) buffer = bufnr, group = 'lsp_document_highlight', }) - vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { - group = 'lsp_document_highlight', - buffer = bufnr, - callback = vim.lsp.buf.document_highlight, - }) + --vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { + -- group = 'lsp_document_highlight', + -- buffer = bufnr, + -- callback = vim.lsp.buf.document_highlight, + --}) + --vim.api.nvim_create_autocmd("CursorHold", { + -- buffer = bufnr, + -- callback = function() + -- local term_opts = { + -- focusable = false, + -- --close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, + -- close_events = { "BufLeave" }, + -- border = 'rounded', + -- --source = 'always', + -- --prefix = ' ', + -- --scope = 'cursor', + -- } + -- vim.diagnostic.open_float(nil, term_opts) + -- end + --}) vim.api.nvim_create_autocmd('CursorMoved', { group = 'lsp_document_highlight', buffer = bufnr, callback = vim.lsp.buf.clear_references, + --callback = ":silent! lua vim.lsp.buf.clear_references()", + }) end @@ -135,7 +151,7 @@ local on_attach = function(client, bufnr) end --- Toggle diagnostics visibility + Toggle diagnostics visibility vim.g.diagnostics_visible = true function _G.toggle_diagnostics() if vim.g.diagnostics_visible then @@ -228,12 +244,15 @@ if mods.executable("bash-language-server") then lspconfig.bashls.setup({ on_attach = on_attach, capabilities = capabilities, + debounce_text_changes = 500, }) end if mods.executable("lua-language-server") then lspconfig.lua_ls.setup({ on_attach = on_attach, + capabilities = capabilities, + debounce_text_changes = 500, settings = { Lua = { runtime = { @@ -246,16 +265,11 @@ if mods.executable("lua-language-server") then }, workspace = { -- Make the server aware of Neovim runtime files, - library = { - fn.stdpath("data") .. "/site/pack/packer/opt/emmylua-nvim", - fn.stdpath("config"), - }, - maxPreload = 2000, + maxPreload = 2000, preloadFileSize = 50000, }, }, }, - capabilities = capabilities, }) end @@ -294,14 +308,31 @@ vim.diagnostic.config({ }) vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { - underline = true, + underline = false, virtual_text = false, - signs = true, + signs = false, update_in_insert = false, }) vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded" }) vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }) + +-- The following settings works with the bleeding edge neovim. +-- See https://github.com/neovim/neovim/pull/13998. +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = { + {"┌", "Normal"}, + {"─", "Normal"}, + {"┐", "Normal"}, + {"│", "Normal"}, + {"┘", "Normal"}, + {"─", "Normal"}, + {"└", "Normal"}, + {"│", "Normal"} + } +}) + -- this is for diagnositcs signs on the line number column -- use this to beautify the plain E W signs to more fun ones -- !important nerdfonts needs to be setup for this to work in your terminal -- cgit v1.2.3 From acd3c326acacb9cb0663fdd416b31021a7d8ec64 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:38:59 +0200 Subject: Clean config --- lua/plugins/null-ls.lua | 117 ++++++++++++++++++++++++++++-------------------- 1 file changed, 69 insertions(+), 48 deletions(-) diff --git a/lua/plugins/null-ls.lua b/lua/plugins/null-ls.lua index 41fba1a..ef97063 100644 --- a/lua/plugins/null-ls.lua +++ b/lua/plugins/null-ls.lua @@ -1,58 +1,79 @@ -local null_ls_status_ok, null_ls = pcall(require, "null-ls") -if not null_ls_status_ok then - return -end --[[null-ls.]] -- -- null-language-server i.e. a sort of language server which does not provide any services such as formatting and diagnostics you expect from a language server. Instead it will need to install corresponding external “sources” and then hook these sources into the neovim lsp client through null-ls. -- - -null_ls.setup({ - debug = true, +require("null-ls").setup({ + --debug = true, disabled_filetypes = { "PKGBUILD" }, - sources = { - require("null-ls").builtins.formatting.stylua, -- lua formatting - require("null-ls").builtins.formatting.prettier.with({ -- markdown, html/js formatting - filetypes = { "html", "css", "javascript", "javascriptreact", "markdown", "json", "yaml" }, - }), - require("null-ls").builtins.formatting.shfmt.with({ -- shell script formatting - filetypes = { ".bash", ".zsh", ".sh", "bash", "zsh", "sh" }, - --filetypes = { "bash", "zsh", "sh" }, - }), - require("null-ls").builtins.diagnostics.shellcheck, -- shell script diagnostics + timeout_ms = 5000, + async = true, + debounce = 150, + sources = { + --require("null-ls").builtins.formatting.shfmt, -- shell script formatting + require("null-ls").builtins.diagnostics.dotenv_linter, + --require("null-ls").builtins.diagnostics.editorconfig_checker, + require("null-ls").builtins.formatting.shfmt.with({ + filetypes = { "bash", "zsh", "sh" }, + extra_args = { "-i", "2", "-ci" }, + }), + require("null-ls").builtins.formatting.prettier, -- markdown formatting + --require("null-ls").builtins.diagnostics.shellcheck, -- shell script diagnostics + require("null-ls").builtins.diagnostics.shellcheck.with({ + diagnostic_config = { + -- see :help vim.diagnostic.config() + underline = true, + virtual_text = false, + signs = true, + update_in_insert = false, + severity_sort = true, + }, + diagnostics_format = "[#{c}] #{m} (#{s})", + -- this will run every time the source runs, + -- so you should prefer caching results if possible + }), +-- require("null-ls").builtins.formatting.stylua, -- lua formatting +-- require("null-ls").builtins.formatting.prettier.with({ -- markdown, html/js formatting +-- filetypes = { "html", "css", "javascript", "javascriptreact", "markdown", "json", "yaml" }, +-- }), +-- require("null-ls").builtins.formatting.black, +-- require("null-ls").builtins.formatting.prettierd, +-- require("null-ls").builtins.diagnostics.cspell.with { +-- filetypes = { "python", "rust", "typescript" }, +-- }, +-- --require("null-ls").builtins.diagnostics.luacheck, +-- --require("null-ls").builtins.diagnostics.eslint, +-- --require("null-ls").builtins.diagnostics.eslint_d, +-- require("null-ls").builtins.diagnostics.mdl, +-- require("null-ls").builtins.diagnostics.vint, +-- require("null-ls").builtins.completion.spell, +-- require("null-ls").builtins.formatting.clang_format, +-- require("null-ls").builtins.formatting.rustfmt, +-- require("null-ls").builtins.formatting.sql_formatter, +-- --require("null-ls").builtins.formatting.google_java_format, +-- require("null-ls").builtins.diagnostics.cppcheck, + require("null-ls").builtins.formatting.shellharden, +-- --require("null-ls").builtins.code_actions.eslint_d, require("null-ls").builtins.code_actions.shellcheck, -- shell script code actions - require("null-ls").builtins.diagnostics.zsh, -- shell script diagnostics - require("null-ls").builtins.formatting.shfmt, - require("null-ls").builtins.formatting.black, - require("null-ls").builtins.formatting.prettierd, - require("null-ls").builtins.diagnostics.cspell.with { - filetypes = { "python", "rust", "typescript" }, - }, - --require("null-ls").builtins.diagnostics.luacheck, - --require("null-ls").builtins.diagnostics.eslint, - --require("null-ls").builtins.diagnostics.eslint_d, - require("null-ls").builtins.diagnostics.mdl, - require("null-ls").builtins.diagnostics.vint, - --require("null-ls").builtins.code_actions.eslint_d, - require("null-ls").builtins.completion.spell, require("null-ls").builtins.formatting.clang_format, require("null-ls").builtins.formatting.rustfmt, + --require("null-ls").builtins.formatting.beautysh, require("null-ls").builtins.formatting.sql_formatter, - require("null-ls").builtins.formatting.stylua, - --require("null-ls").builtins.formatting.google_java_format, - require("null-ls").builtins.formatting.shellharden, - require("null-ls").builtins.diagnostics.cppcheck, - }, - on_attach = function(client, bufnr) - if client.server_capabilities.document_formatting then - local group = vim.api.nvim_create_augroup("NullLsFormatting", { clear = true }) - vim.api.nvim_create_autocmd("BufWritePre", { - callback = function() - vim.lsp.buf.formatting_sync(nil, 4000) - end, - buffer = bufnr, - group = group, - }) - end - end, + --require("null-ls").builtins.diagnostics.todo_comments, + --require("null-ls").builtins.diagnostics.zsh, + require("null-ls").builtins.hover.dictionary, + require("null-ls").builtins.hover.printenv, + }, + -- default_timeout = 5000, + -- diagnostics_format = '[#{c}] #{m} (#{s})', + -- fallback_severity = vim.diagnostic.severity.ERROR, + -- log = { + -- enable = true, + -- level = 'warn', + -- use_console = 'async', + -- }, + --on_attach = nil, + --on_init = nil, + --on_exit = nil, + --update_in_insert = false, + --update_in_leave = false, }) -- cgit v1.2.3 From c01d378d87cff207dd56a38f696b3e70fb6d1477 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:39:34 +0200 Subject: Installed plugin "jayp0521/mason-null-ls.nvim" --- lua/user/pack.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lua/user/pack.lua b/lua/user/pack.lua index c2c4aef..957fac8 100644 --- a/lua/user/pack.lua +++ b/lua/user/pack.lua @@ -72,9 +72,17 @@ return packer.startup(function(use) use("gabrielpoca/replacer.nvim") -- Linters/Formatters + use("jayp0521/mason-null-ls.nvim") + --use({"jayp0521/mason-null-ls.nvim", + -- config = function() + -- require('mason-null-ls.nvim').setup({ + -- automatic_setup = true, + -- }) + -- end + --}) use({ "jose-elias-alvarez/null-ls.nvim", -- Provides LSP: linters, formatters, diagnostics, code actions and etc... - requires = { "nvim-lua/plenary.nvim" }, + requires = { "jayp0521/mason-null-ls.nvim" }, }) -- Completion @@ -189,11 +197,7 @@ return packer.startup(function(use) use("karb94/neoscroll.nvim") -- Faster/smooth scrolling use("MunifTanjim/prettier.nvim") -- Prettier plugin for Neovim's built-in LSP client use("norcalli/nvim-colorizer.lua") -- - use({ "j-hui/fidget.nvim", -- UI to show nvim-lsp progress - config = function() - require("fidget").setup() - end - }) + use( "j-hui/fidget.nvim") -- UI to show nvim-lsp progress use { "simrat39/symbols-outline.nvim", -- config = function() require("symbols-outline").setup({ -- cgit v1.2.3 From ec59f36f7ecce8e0e8977812207acd229432e919 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:39:56 +0200 Subject: Add plugin to startup "fidget.nvim" --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 5b82295..c2dff0a 100644 --- a/init.lua +++ b/init.lua @@ -66,14 +66,15 @@ local modules = { "plugins.git", "plugins.gitsigns", "plugins.neoscroll", + "plugins.null-ls", "plugins.lsp", "plugins.autopairs", - "plugins.null-ls", "plugins.web-devicons", "plugins.navic", "plugins.zen-mode", "plugins.colorscheme", "plugins.dashboard", + "plugins.fidget", "plugins.heirline", "plugins.toggleterm", "plugins.trouble", -- cgit v1.2.3 From e9070134d79e9d2087b939554e3a31bd272c94d7 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:41:39 +0200 Subject: Add builtin diagnostics "todo_comments" --- lua/plugins/null-ls.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/null-ls.lua b/lua/plugins/null-ls.lua index ef97063..f50827a 100644 --- a/lua/plugins/null-ls.lua +++ b/lua/plugins/null-ls.lua @@ -58,7 +58,7 @@ require("null-ls").setup({ require("null-ls").builtins.formatting.rustfmt, --require("null-ls").builtins.formatting.beautysh, require("null-ls").builtins.formatting.sql_formatter, - --require("null-ls").builtins.diagnostics.todo_comments, + require("null-ls").builtins.diagnostics.todo_comments, --require("null-ls").builtins.diagnostics.zsh, require("null-ls").builtins.hover.dictionary, require("null-ls").builtins.hover.printenv, -- cgit v1.2.3 From fe82974e85098b87ba23b728a0fb6fb4fbad24f8 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 22 Feb 2023 11:46:06 +0200 Subject: Fixed syntax on line 154 where comment was not commented --- lua/plugins/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index a9b87cf..f00897f 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -151,7 +151,7 @@ local on_attach = function(client, bufnr) end - Toggle diagnostics visibility +-- Toggle diagnostics visibility vim.g.diagnostics_visible = true function _G.toggle_diagnostics() if vim.g.diagnostics_visible then -- cgit v1.2.3