diff --git a/aerc/aerc.conf b/aerc/aerc.conf index d0b6530..be9a323 100644 --- a/aerc/aerc.conf +++ b/aerc/aerc.conf @@ -23,6 +23,9 @@ 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 8f05e69..6243d58 100644 --- a/nvim/ftplugin/java.lua +++ b/nvim/ftplugin/java.lua @@ -4,19 +4,16 @@ vim.opt.colorcolumn = "120" vim.opt.textwidth = 120 require('jdtls').start_or_attach({ - cmd = { - 'jdtls', - '-parameters' - }, + cmd = {'jdtls'}, 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', 'gradle.properties'}, { upward = true })[1]), + root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]), init_options = { bundles = { - 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"), + 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"), }, }, java = { @@ -54,17 +51,6 @@ 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 4e10895..31bb1cf 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -37,7 +37,6 @@ 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 886e80f..7ebe22c 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -1,7 +1,5 @@ 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 33adaa6..c0c9b71 100644 --- a/nvim/lua/plugins/dap-go.lua +++ b/nvim/lua/plugins/dap-go.lua @@ -1,10 +1,8 @@ return { "leoluz/nvim-dap-go", dependencies = { - "https://codeberg.org/mfussenegger/nvim-dap", + "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 92bbe8c..7ad395e 100644 --- a/nvim/lua/plugins/dap-python.lua +++ b/nvim/lua/plugins/dap-python.lua @@ -1,10 +1,8 @@ return { - "https://codeberg.org/mfussenegger/nvim-dap-python", + "mfussenegger/nvim-dap-python", dependencies = { - "https://codeberg.org/mfussenegger/nvim-dap", + "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 9a9a2c4..6121c12 100644 --- a/nvim/lua/plugins/dap-ui.lua +++ b/nvim/lua/plugins/dap-ui.lua @@ -7,8 +7,6 @@ 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 6642065..c8aa8f4 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -1,7 +1,5 @@ return { - "https://codeberg.org/mfussenegger/nvim-dap", - lazy = true, - ft = { "java", "go", "python" }, + "mfussenegger/nvim-dap", dependencies = { "rcarriga/nvim-dap-ui", { diff --git a/nvim/lua/plugins/jdtls.lua b/nvim/lua/plugins/jdtls.lua index 3b5f99d..4d2bcbb 100644 --- a/nvim/lua/plugins/jdtls.lua +++ b/nvim/lua/plugins/jdtls.lua @@ -1,7 +1,8 @@ return { - "https://codeberg.org/mfussenegger/nvim-jdtls", - lazy = true, - ft = { "java" }, + "mfussenegger/nvim-jdtls", + dependencies = { + "williamboman/mason.nvim" + }, config = function() local dap = require('dap') dap.configurations.java = {{ diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua index 53cdab8..cd69348 100644 --- a/nvim/lua/plugins/lspconfig.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -26,6 +26,9 @@ return { }, }, config = function() + local nvim_lsp = require("lspconfig") + + local protocol = require("vim.lsp.protocol") local on_attach = function(client, bufnr) -- Format on save @@ -39,91 +42,5 @@ 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 new file mode 100644 index 0000000..6debd75 --- /dev/null +++ b/nvim/lua/plugins/mason.lua @@ -0,0 +1,147 @@ +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 db38ff2..6c3aac9 100644 --- a/nvim/lua/plugins/neo-tree.lua +++ b/nvim/lua/plugins/neo-tree.lua @@ -6,10 +6,6 @@ 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 386d372..dd5cc2f 100644 --- a/nvim/lua/plugins/sonarlint.lua +++ b/nvim/lua/plugins/sonarlint.lua @@ -2,19 +2,21 @@ return { { url = "https://gitlab.com/schrieveslaach/sonarlint.nvim", lazy = true, - ft = {"java", "go", "html", "python", "php"}, + ft = {"java", "go", "html", "python"}, + dependencies = { + "williamboman/mason.nvim" + }, config = function() require('sonarlint').setup({ server = { cmd = { - 'sonarlint-ls', + 'sonarlint-language-server', '-stdio', '-analyzers', - "/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", + 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"), }, settings = { sonarlint = { @@ -34,9 +36,9 @@ return { 'go', 'html', 'python', - "php" }, }) end } } + diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 3675166..043cc72 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,26 +1,25 @@ return { 'nvim-telescope/telescope.nvim', branch = '0.1.x', - lazy = false, - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope-ui-select.nvim', - }, + 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 deleted file mode 100644 index 8e8d8ee..0000000 --- a/nvim/lua/plugins/todo-comments.lua +++ /dev/null @@ -1,8 +0,0 @@ -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 81e10a4..5188588 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -31,7 +31,7 @@ return { "lua", "vim", "gitignore", - "go", + "rust", }, incremental_selection = { enable = true, diff --git a/nvim/lua/plugins/trouble.lua b/nvim/lua/plugins/trouble.lua index 562539c..e8069b1 100644 --- a/nvim/lua/plugins/trouble.lua +++ b/nvim/lua/plugins/trouble.lua @@ -53,16 +53,6 @@ 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",