diff --git a/apps/packages.txt b/apps/packages.txt index 9a58dee..daffd7f 100644 --- a/apps/packages.txt +++ b/apps/packages.txt @@ -39,6 +39,8 @@ ttf-liberation noto-fonts noto-fonts-cjk noto-fonts-emoji +ttf-roboto +ttf-roboto-mono # Japanese fcitx5 diff --git a/cli/node/config/npm/npmrc b/cli/node/config/npm/npmrc index 3691078..a1c4191 100644 --- a/cli/node/config/npm/npmrc +++ b/cli/node/config/npm/npmrc @@ -1,5 +1,4 @@ prefix=${XDG_DATA_HOME}/npm cache=${XDG_CACHE_HOME}/npm -tmp=${XDG_RUNTIME_DIR}/npm init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js diff --git a/dwm/dwm b/dwm/dwm index c32d53a..1996a3b 160000 --- a/dwm/dwm +++ b/dwm/dwm @@ -1 +1 @@ -Subproject commit c32d53ad767e5baa45a1c24d013a1d2e1f9522a6 +Subproject commit 1996a3be2ae808f3e9fb83c7dd163e84a246e646 diff --git a/nvim/nvim/config/nvim.ln/.gitignore b/nvim/nvim/config/nvim.ln/.gitignore index d7ad043..f171717 100644 --- a/nvim/nvim/config/nvim.ln/.gitignore +++ b/nvim/nvim/config/nvim.ln/.gitignore @@ -1 +1,2 @@ plugin/ +spell/*.spl diff --git a/nvim/nvim/config/nvim.ln/lua/colorscheme.lua b/nvim/nvim/config/nvim.ln/lua/colorscheme.lua index 169f5ae..39eceeb 100644 --- a/nvim/nvim/config/nvim.ln/lua/colorscheme.lua +++ b/nvim/nvim/config/nvim.ln/lua/colorscheme.lua @@ -9,3 +9,7 @@ catch /^Vim\%((\a\+)\)\=:E185/ set background=dark endtry ]] + +vim.cmd [[ + hi link LspComment Comment +]] diff --git a/nvim/nvim/config/nvim.ln/lua/lsp/handlers.lua b/nvim/nvim/config/nvim.ln/lua/lsp/handlers.lua index dd4780f..5981d0f 100644 --- a/nvim/nvim/config/nvim.ln/lua/lsp/handlers.lua +++ b/nvim/nvim/config/nvim.ln/lua/lsp/handlers.lua @@ -22,6 +22,19 @@ M.setup = function() vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = "rounded", }) + + local ok, inlay = pcall(require, "lsp-inlayhints") + if ok then + inlay.setup() + end + + local shok, sh = pcall(require, "nvim-semantic-tokens") + if shok then + sh.setup { + preset = "default", + highlighters = { require 'nvim-semantic-tokens.table-highlighter' } + } + end end local function lsp_highlight_document(client) @@ -49,7 +62,7 @@ wk.register({ }) function _LSP_FORMAT_FILTER(client) - local clients = vim.lsp.get_active_clients({bufnr = 0}) + local clients = vim.lsp.get_active_clients({ bufnr = 0 }) for _, c in pairs(clients) do if c.name == "null-ls" and c.server_capabilities.documentFormattingProvider then return client.name == "null-ls" @@ -92,11 +105,20 @@ local lsp_codelens = function() -- vim.cmd [[ autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.codelens.refresh() ]] end +local lsp_semhighlight = function(client) + local caps = client.server_capabilities + if caps.semanticTokensProvider and caps.semanticTokensProvider.full then + vim.cmd [[autocmd BufEnter,CursorHold,InsertLeave lua vim.lsp.buf.semantic_tokens_full()]] + end +end + M.on_attach = function(client, bufnr) lsp_keymaps(bufnr) lsp_highlight_document(client) lsp_codelens() + lsp_semhighlight(client) + require("lsp-inlayhints").on_attach(bufnr, client) require "nvim-navic".attach(client, bufnr) end diff --git a/nvim/nvim/config/nvim.ln/lua/lsp/lsp-install.lua b/nvim/nvim/config/nvim.ln/lua/lsp/lsp-install.lua index 6f94072..39f1d2f 100644 --- a/nvim/nvim/config/nvim.ln/lua/lsp/lsp-install.lua +++ b/nvim/nvim/config/nvim.ln/lua/lsp/lsp-install.lua @@ -29,6 +29,8 @@ lsp_installer.setup({ } }) +local servers = {} + lspconfig.omnisharp.setup({ handlers = { ["textDocument/definition"] = require('omnisharp_extended').handler, @@ -41,11 +43,13 @@ lspconfig.omnisharp.setup({ ["OMNISHARP_msbuild:EnablePackageAutoRestore"] = true, }, }) +table.insert(servers, "omnisharp") lspconfig.jsonls.setup({ settings = { json = { schemas = require('schemastore').json.schemas(), + validate = { enable = true }, }, }, }) @@ -66,6 +70,7 @@ lspconfig.sumneko_lua.setup({ }, }, }) +table.insert(servers, "sumneko_lua") lspconfig.robotframework_ls.setup({ settings = { @@ -77,6 +82,7 @@ lspconfig.robotframework_ls.setup({ }, } }) +table.insert(servers, "robotframework_ls") lspconfig.ltex.setup({ settings = { @@ -87,7 +93,47 @@ lspconfig.ltex.setup({ }, }, }) +table.insert(servers, "ltex") + +lspconfig.tsserver.setup({ + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + } + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + } + } + } +}) +table.insert(servers, "tsserver") + +local function contains(table, val) + for i = 1, #table do + if table[i] == val then + return true + end + end + return false +end for _, server in ipairs(lsp_installer.get_installed_servers()) do - lspconfig[server.name].setup({}) + if not contains(servers, server.name) then + lspconfig[server.name].setup({}) + end end diff --git a/nvim/nvim/config/nvim.ln/lua/plugins.lua b/nvim/nvim/config/nvim.ln/lua/plugins.lua index 6ae9179..5f4f69a 100644 --- a/nvim/nvim/config/nvim.ln/lua/plugins.lua +++ b/nvim/nvim/config/nvim.ln/lua/plugins.lua @@ -100,6 +100,8 @@ return packer.startup(function(use) use({ 'scalameta/nvim-metals', requires = { "nvim-lua/plenary.nvim" } }) use "b0o/schemastore.nvim" use "jose-elias-alvarez/null-ls.nvim" + use "lvimuser/lsp-inlayhints.nvim" + use "theHamsta/nvim-semantic-tokens" use { "hrsh7th/cmp-nvim-lsp", @@ -137,7 +139,16 @@ return packer.startup(function(use) -- use "nvim-telescope/telescope-dap.nvim" - use { "rcarriga/vim-ultest", requires = { "vim-test/vim-test" }, run = ":UpdateRemotePlugins" } + use { + "nvim-neotest/neotest", + requires = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "antoinemadec/FixCursorHold.nvim" + } + } + use { "nvim-neotest/neotest-python" } + use { "nvim-neotest/neotest-vim-test", requires = { "vim-test/vim-test" } } use { "lukas-reineke/virt-column.nvim", config = function() require("virt-column").setup() end } diff --git a/nvim/nvim/config/nvim.ln/lua/tests.lua b/nvim/nvim/config/nvim.ln/lua/tests.lua index 499eac6..8fe4e4a 100644 --- a/nvim/nvim/config/nvim.ln/lua/tests.lua +++ b/nvim/nvim/config/nvim.ln/lua/tests.lua @@ -1,38 +1,58 @@ +local ok, neotest = pcall(require, "neotest") +if not ok then + return +end + + +neotest.setup({ + adapters = { + require("neotest-python")({ + dap = { justMyCode = false }, + }), + require("neotest-vim-test")({ + ignore_file_types = { "python" }, + }), + }, + icons = { + failed = "", + passed = "", + running = "", + skipped = "ﰸ", + unknown = "" + }, + strategies = { + integrated = { + height = 180, + width = 180, + } + }, +}) + vim.g["test#csharp#runner"] = 'dotnettest' -vim.g["ultest_pass_sign"] = "" -vim.g["ultest_fail_sign"] = "" -vim.g["ultest_running_sign"] = "" -vim.g["ultest_not_run_sign"] = "" - -vim.g["ultest_output_max_width"] = 180 -vim.g["ultest_output_min_width"] = 180 - -vim.g["ultest_use_pty"] = 1 - -vim.cmd [[ - augroup test_output - autocmd! - autocmd FileType UltestSummary setl nolist - augroup end -]] +--[[ vim.cmd [[ ]] +--[[ augroup test_output ]] +--[[ autocmd! ]] +--[[ autocmd FileType UltestSummary setl nolist ]] +--[[ augroup end ]] +--[[ ] ] ]] local wk = require("which-key") wk.register({ u = { name = "Unit Tests", - r = { "(ultest-run-nearest)", "Run nearest" }, - o = { "(ultest-output-show)", "Show test output" }, - j = { "(ultest-output-jump)", "Jump to test output" }, - a = { "(ultest-attach)", "Attach to the nearest running test" }, - s = { "(ultest-stop-nearest)", "Stop the nearest test" }, - t = { "UltestSummary!", "Toggle the test window" }, + r = { 'lua require("neotest").run.run()', "Run nearest" }, + d = { 'lua require("neotest").run.run({strategy = "dap"})', "Debug nearest" }, + o = { 'lua require("neotest").output.open({ enter = true })', "Show test output" }, + a = { 'lua require("neotest").run.attach()', "Attach to the nearest running test" }, + s = { 'lua require("neotest").run.stop()', "Stop the nearest test" }, + t = { 'lua require("neotest").summary.toggle()', "Toggle the test window" }, }, }, { prefix = "", }) wk.register({ - ["[u"] = { "(ultest-prev-fail)", "Prev failing test" }, - ["]u"] = { "(ultest-next-fail)", "Next failing test" }, + ["[u"] = { 'lua require("neotest").jump.prev({ status = "failed" })', "Prev failing test" }, + ["]u"] = { 'lua require("neotest").jump.next({ status = "failed" })', "Next failing test" }, }) diff --git a/nvim/nvim/config/nvim.ln/spell/en.utf-8.add.spl b/nvim/nvim/config/nvim.ln/spell/en.utf-8.add.spl deleted file mode 100644 index 12a8895..0000000 Binary files a/nvim/nvim/config/nvim.ln/spell/en.utf-8.add.spl and /dev/null differ