diff --git a/aerc/aerc.conf b/aerc/aerc.conf index be9a323..d0b6530 100644 --- a/aerc/aerc.conf +++ b/aerc/aerc.conf @@ -23,9 +23,6 @@ column-date = {{.Date.Local}} column-name = {{index (.To | names) 0}} column-subject = {{.ThreadPrefix}}{{.Subject}} -[ui:account=gs] -sidebar-width=30 - [viewer] pager=less -R alternatives=text/plain,text/html diff --git a/nvim/ftplugin/java.lua b/nvim/ftplugin/java.lua index 6243d58..8f05e69 100644 --- a/nvim/ftplugin/java.lua +++ b/nvim/ftplugin/java.lua @@ -4,16 +4,19 @@ vim.opt.colorcolumn = "120" vim.opt.textwidth = 120 require('jdtls').start_or_attach({ - cmd = {'jdtls'}, + cmd = { + 'jdtls', + '-parameters' + }, on_attach = function(client, bufnr) require('jdtls').setup_dap({hotcodereplace = 'auto'}) require('jdtls.dap').setup_dap_main_class_configs() end, - root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), + root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'gradle.properties'}, { upward = true })[1]), init_options = { bundles = { - vim.fn.expand("$MASON/share/java-debug-adapter/com.microsoft.java.debug.core.jar"), - vim.fn.expand("$MASON/share/java-debug-adapter/com.microsoft.java.debug.plugin.jar"), + vim.fn.expand("/usr/share/java-debug/com.microsoft.java.debug.core.jar"), + vim.fn.expand("/usr/share/java-debug/com.microsoft.java.debug.plugin.jar"), }, }, java = { @@ -51,6 +54,17 @@ require('jdtls').start_or_attach({ url = "/home/oliver/Dokumente/Gallery Systems/Products/GS Eclipse Formatter Java.xml" }, }, + codeGeneration = { + --generateComments = true, + insertionLocation = 'lastMember', + hashCodeEquals = { + useInstanceof = true, + useJava7Objects = true, + }, + }, + telemetry = { + enabled = false, + }, }, }, }) diff --git a/nvim/init.vim b/nvim/init.vim index 31bb1cf..4e10895 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -37,6 +37,7 @@ set hidden " Custom shortcuts map gb :bn map gB :bp +map g# :b# " Close the completion preview window (docstring) automatically autocmd CompleteDone * pclose diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index 7ebe22c..886e80f 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -1,5 +1,7 @@ return { "hrsh7th/nvim-cmp", + lazy = true, + ft = { "java", "go", "python", "html" }, event = "InsertEnter", dependencies = { "hrsh7th/cmp-buffer", diff --git a/nvim/lua/plugins/dap-go.lua b/nvim/lua/plugins/dap-go.lua index c0c9b71..33adaa6 100644 --- a/nvim/lua/plugins/dap-go.lua +++ b/nvim/lua/plugins/dap-go.lua @@ -1,8 +1,10 @@ return { "leoluz/nvim-dap-go", dependencies = { - "mfussenegger/nvim-dap", + "https://codeberg.org/mfussenegger/nvim-dap", }, + lazy = true, + ft = { "go" }, config = function() require('dap-go').setup() end, diff --git a/nvim/lua/plugins/dap-python.lua b/nvim/lua/plugins/dap-python.lua index 7ad395e..92bbe8c 100644 --- a/nvim/lua/plugins/dap-python.lua +++ b/nvim/lua/plugins/dap-python.lua @@ -1,8 +1,10 @@ return { - "mfussenegger/nvim-dap-python", + "https://codeberg.org/mfussenegger/nvim-dap-python", dependencies = { - "mfussenegger/nvim-dap", + "https://codeberg.org/mfussenegger/nvim-dap", }, + lazy = true, + ft = { "python" }, config = function() require('dap-python').setup() end, diff --git a/nvim/lua/plugins/dap-ui.lua b/nvim/lua/plugins/dap-ui.lua index 6121c12..9a9a2c4 100644 --- a/nvim/lua/plugins/dap-ui.lua +++ b/nvim/lua/plugins/dap-ui.lua @@ -7,6 +7,8 @@ return { opts = {}, }, }, + lazy = true, + ft = { "java", "go", "python" }, keys = { { "du", function() require("dapui").toggle({ }) end, desc = "Dap UI" }, { "de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} }, diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua index c8aa8f4..6642065 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -1,5 +1,7 @@ return { - "mfussenegger/nvim-dap", + "https://codeberg.org/mfussenegger/nvim-dap", + lazy = true, + ft = { "java", "go", "python" }, dependencies = { "rcarriga/nvim-dap-ui", { diff --git a/nvim/lua/plugins/jdtls.lua b/nvim/lua/plugins/jdtls.lua index 4d2bcbb..3b5f99d 100644 --- a/nvim/lua/plugins/jdtls.lua +++ b/nvim/lua/plugins/jdtls.lua @@ -1,8 +1,7 @@ return { - "mfussenegger/nvim-jdtls", - dependencies = { - "williamboman/mason.nvim" - }, + "https://codeberg.org/mfussenegger/nvim-jdtls", + lazy = true, + ft = { "java" }, config = function() local dap = require('dap') dap.configurations.java = {{ diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index cd69348..53cdab8 100644 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -26,9 +26,6 @@ return { }, }, config = function() - local nvim_lsp = require("lspconfig") - - local protocol = require("vim.lsp.protocol") local on_attach = function(client, bufnr) -- Format on save @@ -42,5 +39,91 @@ return { }) end end + + -- Typos + vim.lsp.config("typos_lsp", { + settings = { + filetypes = { + 'java', + 'go' + }, + }, + init_options = { + diagnosticSeverity = "Hint", + } + }) + + -- Gradle + --vim.lsp.enable('gradle_ls') + + -- HTML + vim.lsp.enable('html') + + -- CSS + vim.lsp.enable('cssls') + + -- JSON + vim.lsp.enable('jsonls') + + -- Python + vim.lsp.enable('pylsp') + + -- Go + vim.lsp.config("gopls", { + settings = { + gopls = { + gofumpt = true, + staticcheck = true, + analyses = { + unusedparams = true, + unusedresult = true, + unusedwrite = true, + unusedvariable = true, + useany = true, + fieldalignment = false, + nilness = true, + shadow = true, + }, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + codelenses = { + gc_details = true, + generate = true, + regenerate_cgo = true, + tidy = true, + upgrade_dependency = true, + vendor = true, + }, + }, + }, + }) + -- Organize imports and format code on save + vim.api.nvim_create_autocmd({"BufWritePre"}, { + pattern = "*.go", + callback = function() + local params = vim.lsp.util.make_range_params() + params.context = {only = {"source.organizeImports"}} + local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params) + for cid, res in pairs(result or {}) do + for _, r in pairs(res.result or {}) do + if r.edit then + local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16" + vim.lsp.util.apply_workspace_edit(r.edit, enc) + end + end + end + vim.lsp.buf.format({async = false}) + end + }) + + -- PHP + vim.lsp.enable('phpactor') end, } diff --git a/nvim/lua/plugins/mason.lua b/nvim/lua/plugins/mason.lua deleted file mode 100644 index 6debd75..0000000 --- a/nvim/lua/plugins/mason.lua +++ /dev/null @@ -1,147 +0,0 @@ -return { - "williamboman/mason.nvim", - enabled = true, - dependencies = { - "williamboman/mason-lspconfig.nvim", - }, - opts = { - ensure_installed = { - "jdtls", - "java-debug-adapter", - "sonarlint-language-server", - "gradle-language-server", - "html-lsp", - "json-lsp", - "typos-lsp" - }, - }, - config = function() - require("mason").setup() - require("mason-lspconfig").setup() - - lspconfig = require "lspconfig" - - -- Gradle - lspconfig.gradle_ls.setup{} - - -- HTML - lspconfig.html.setup{ - settings = { - html = { - format = { - tabSize = 4, - insertSpaces = true, - indentEmptyLines = false, - indentInnerHtml = true, - wrapLineLength = 120, - wrapAttributes = 'preserve', - wrapAttributesIndentSize = 4, - preserveNewLines = true, - maxPreserveNewLines = 1, - indentScripts = "keep", - extraLiners = "", - }, - }, - } - } - - -- JSON - lspconfig.jsonls.setup{} - - -- Go - lspconfig.gopls.setup{ - settings = { - gopls = { - gofumpt = true, - staticcheck = true, - analyses = { - unusedparams = true, - unusedresult = true, - unusedwrite = true, - unusedvariable = true, - useany = true, - fieldalignment = false, - nilness = true, - shadow = true, - }, - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - codelenses = { - gc_details = true, - generate = true, - regenerate_cgo = true, - tidy = true, - upgrade_dependency = true, - vendor = true, - }, - }, - }, - } - -- Organize imports and format code on save - vim.api.nvim_create_autocmd({"BufWritePre"}, { - pattern = "*.go", - callback = function() - local params = vim.lsp.util.make_range_params() - params.context = {only = {"source.organizeImports"}} - local result = vim.lsp.buf_request_sync(0, "textDocument/codeAction", params) - for cid, res in pairs(result or {}) do - for _, r in pairs(res.result or {}) do - if r.edit then - local enc = (vim.lsp.get_client_by_id(cid) or {}).offset_encoding or "utf-16" - vim.lsp.util.apply_workspace_edit(r.edit, enc) - end - end - end - vim.lsp.buf.format({async = false}) - end - }) - - -- Python - lspconfig.pylsp.setup{ - settings = { - pylsp = { - plugins = { - autopep8 = { - enabled = false, - }, - yapf = { - enabled = true, - }, - pylint = { - enabled = false, - }, - pyflakes = { - enabled = true, - }, - pycodestyle = { - enabled = true, - ignore = { - 'E402', - 'W503', - }, - }, - }, - }, - }, - } - - lspconfig.typos_lsp.setup({ - settings = { - filetypes = { - 'java', - 'go' - }, - }, - init_options = { - diagnosticSeverity = "Info", - } - }) - end, -} diff --git a/nvim/lua/plugins/neo-tree.lua b/nvim/lua/plugins/neo-tree.lua index 6c3aac9..db38ff2 100644 --- a/nvim/lua/plugins/neo-tree.lua +++ b/nvim/lua/plugins/neo-tree.lua @@ -6,6 +6,10 @@ return { "nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim", }, + keys = { + { "tt", "Neotree toggle", desc = "NeoTree toggle" }, + { "tr", "Neotree reveal", desc = "NeoTree reveal" }, + }, config = function() require("neo-tree").setup({ window = { diff --git a/nvim/lua/plugins/sonarlint.lua b/nvim/lua/plugins/sonarlint.lua index dd5cc2f..386d372 100644 --- a/nvim/lua/plugins/sonarlint.lua +++ b/nvim/lua/plugins/sonarlint.lua @@ -2,21 +2,19 @@ return { { url = "https://gitlab.com/schrieveslaach/sonarlint.nvim", lazy = true, - ft = {"java", "go", "html", "python"}, - dependencies = { - "williamboman/mason.nvim" - }, + ft = {"java", "go", "html", "python", "php"}, config = function() require('sonarlint').setup({ server = { cmd = { - 'sonarlint-language-server', + 'sonarlint-ls', '-stdio', '-analyzers', - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarjava.jar"), - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonargo.jar"), - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarhtml.jar"), - vim.fn.expand("$MASON/share/sonarlint-analyzers/sonarpython.jar"), + "/usr/share/java/sonarlint-ls/analyzers/sonarjava.jar", + "/usr/share/java/sonarlint-ls/analyzers/sonargo.jar", + "/usr/share/java/sonarlint-ls/analyzers/sonarhtml.jar", + "/usr/share/java/sonarlint-ls/analyzers/sonarpython.jar", + "/usr/share/java/sonarlint-ls/analyzers/sonarphp.jar", }, settings = { sonarlint = { @@ -36,9 +34,9 @@ return { 'go', 'html', 'python', + "php" }, }) end } } - diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 043cc72..3675166 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,25 +1,26 @@ return { 'nvim-telescope/telescope.nvim', branch = '0.1.x', - dependencies = { 'nvim-lua/plenary.nvim', "nvim-telescope/telescope-ui-select.nvim" }, + lazy = false, + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-telescope/telescope-ui-select.nvim', + }, keys = { { "", "Telescope" }, { "", "Telescope buffers", desc = "Find luffers" }, { "", "Telescope git_files", desc = "Find files" }, { "", "Telescope lsp_document_symbols", desc = "Find symbols" }, + { "", "lua require('telescope.builtin').diagnostics({severity_limit='WARN'})", desc = "Show errors and warnings" }, }, config = function() local t = require("telescope") - t.load_extension("ui-select") t.setup({ defaults = { preview = false, - layout_config = { - vertical = { - width = 0.5, - }, - }, }, }) + + t.load_extension("ui-select") end } diff --git a/nvim/lua/plugins/todo-comments.lua b/nvim/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..8e8d8ee --- /dev/null +++ b/nvim/lua/plugins/todo-comments.lua @@ -0,0 +1,8 @@ +return { + "folke/todo-comments.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + }, +} diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 5188588..81e10a4 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -31,7 +31,7 @@ return { "lua", "vim", "gitignore", - "rust", + "go", }, incremental_selection = { enable = true, diff --git a/nvim/lua/plugins/trouble.lua b/nvim/lua/plugins/trouble.lua index e8069b1..562539c 100644 --- a/nvim/lua/plugins/trouble.lua +++ b/nvim/lua/plugins/trouble.lua @@ -53,6 +53,16 @@ return { "Trouble diagnostics filter.buf=0 filter.severity=vim.diagnostic.severity.HINT", desc = "Info Diagnostics (Trouble)", }, + { + "xt", + "Trouble todo", + desc = "TODOs (Trouble)", + }, + { + "xT", + "Trouble todo filter.buf=0", + desc = "TODOs (Trouble)", + }, { "cs", "Trouble symbols toggle focus=false",