diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index cf27f96c..19ea6b25 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 July 25 +*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 August 29 ============================================================================== Table of Contents *LazyVim-table-of-contents* diff --git a/lua/lazyvim/config/autocmds.lua b/lua/lazyvim/config/autocmds.lua index ec1b98df..c8a513f5 100644 --- a/lua/lazyvim/config/autocmds.lua +++ b/lua/lazyvim/config/autocmds.lua @@ -22,7 +22,9 @@ vim.api.nvim_create_autocmd("TextYankPost", { vim.api.nvim_create_autocmd({ "VimResized" }, { group = augroup("resize_splits"), callback = function() + local current_tab = vim.fn.tabpagenr() vim.cmd("tabdo wincmd =") + vim.cmd("tabnext " .. current_tab) end, }) diff --git a/lua/lazyvim/config/keymaps.lua b/lua/lazyvim/config/keymaps.lua index c86e6944..54107199 100644 --- a/lua/lazyvim/config/keymaps.lua +++ b/lua/lazyvim/config/keymaps.lua @@ -66,8 +66,6 @@ map( { desc = "Redraw / clear hlsearch / diff update" } ) -map({ "n", "x" }, "gw", "*N", { desc = "Search word under cursor" }) - -- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n map("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) map("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" }) @@ -82,7 +80,7 @@ map("i", ".", ".u") map("i", ";", ";u") -- save file -map({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) +map({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) --keywordprg map("n", "K", "norm! K", { desc = "Keywordprg" }) diff --git a/lua/lazyvim/plugins/extras/lang/clangd.lua b/lua/lazyvim/plugins/extras/lang/clangd.lua index d9ce751c..08017700 100644 --- a/lua/lazyvim/plugins/extras/lang/clangd.lua +++ b/lua/lazyvim/plugins/extras/lang/clangd.lua @@ -15,29 +15,27 @@ return { lazy = true, config = function() end, opts = { - extensions = { - inlay_hints = { - inline = false, + inlay_hints = { + inline = false, + }, + ast = { + --These require codicons (https://github.com/microsoft/vscode-codicons) + role_icons = { + type = "", + declaration = "", + expression = "", + specifier = "", + statement = "", + ["template argument"] = "", }, - ast = { - --These require codicons (https://github.com/microsoft/vscode-codicons) - role_icons = { - type = "", - declaration = "", - expression = "", - specifier = "", - statement = "", - ["template argument"] = "", - }, - kind_icons = { - Compound = "", - Recovery = "", - TranslationUnit = "", - PackExpansion = "", - TemplateTypeParm = "", - TemplateTemplateParm = "", - TemplateParamObject = "", - }, + kind_icons = { + Compound = "", + Recovery = "", + TranslationUnit = "", + PackExpansion = "", + TemplateTypeParm = "", + TemplateTemplateParm = "", + TemplateParamObject = "", }, }, }, @@ -56,7 +54,6 @@ return { root_dir = function(fname) return require("lspconfig.util").root_pattern( "Makefile", - "CMakeLists.txt", "configure.ac", "configure.in", "config.h.in", @@ -90,7 +87,7 @@ return { clangd = function(_, opts) local clangd_ext_opts = require("lazyvim.util").opts("clangd_extensions.nvim") require("clangd_extensions").setup(vim.tbl_deep_extend("force", clangd_ext_opts or {}, { server = opts })) - return true + return false end, }, }, diff --git a/lua/lazyvim/plugins/extras/lang/python.lua b/lua/lazyvim/plugins/extras/lang/python.lua index 746435cc..e64decd1 100644 --- a/lua/lazyvim/plugins/extras/lang/python.lua +++ b/lua/lazyvim/plugins/extras/lang/python.lua @@ -14,16 +14,16 @@ return { pyright = {}, ruff_lsp = {}, }, - }, - setup = { - ruff_lsp = function() - require("lazyvim.util").on_attach(function(client, _) - if client.name == "ruff_lsp" then - -- Disable hover in favor of Pyright - client.server_capabilities.hoverProvider = false - end - end) - end, + setup = { + ruff_lsp = function() + require("lazyvim.util").on_attach(function(client, _) + if client.name == "ruff_lsp" then + -- Disable hover in favor of Pyright + client.server_capabilities.hoverProvider = false + end + end) + end, + }, }, }, { @@ -61,7 +61,14 @@ return { { "linux-cultist/venv-selector.nvim", cmd = "VenvSelect", - opts = {}, + opts = { + name = { + "venv", + ".venv", + "env", + ".env", + }, + }, keys = { { "cv", ":VenvSelect", desc = "Select VirtualEnv" } }, }, } diff --git a/lua/lazyvim/plugins/extras/lang/yaml.lua b/lua/lazyvim/plugins/extras/lang/yaml.lua index b097cdf6..ca808bbf 100644 --- a/lua/lazyvim/plugins/extras/lang/yaml.lua +++ b/lua/lazyvim/plugins/extras/lang/yaml.lua @@ -21,6 +21,15 @@ return { -- make sure mason installs the server servers = { yamlls = { + -- Have to add this for yamlls to understand that we support line folding + capabilities = { + textDocument = { + foldingRange = { + dynamicRegistration = false, + lineFoldingOnly = true, + }, + }, + }, -- lazy-load schemastore when needed on_new_config = function(new_config) new_config.settings.yaml.schemas = new_config.settings.yaml.schemas or {} @@ -33,11 +42,13 @@ return { format = { enable = true, }, - validate = { enable = true }, + validate = true, schemaStore = { -- Must disable built-in schemaStore support to use -- schemas from SchemaStore.nvim plugin enable = false, + -- Avoid TypeError: Cannot read properties of undefined (reading 'length') + url = "", }, }, }, diff --git a/lua/lazyvim/plugins/lsp/init.lua b/lua/lazyvim/plugins/lsp/init.lua index 4870183d..c1d3478b 100644 --- a/lua/lazyvim/plugins/lsp/init.lua +++ b/lua/lazyvim/plugins/lsp/init.lua @@ -166,7 +166,7 @@ return { require("lspconfig")[server].setup(server_opts) end - -- get all the servers that are available thourgh mason-lspconfig + -- get all the servers that are available through mason-lspconfig local have_mason, mlsp = pcall(require, "mason-lspconfig") local all_mslp_servers = {} if have_mason then diff --git a/lua/lazyvim/plugins/treesitter.lua b/lua/lazyvim/plugins/treesitter.lua index d2f5b775..b84d01a7 100644 --- a/lua/lazyvim/plugins/treesitter.lua +++ b/lua/lazyvim/plugins/treesitter.lua @@ -34,6 +34,7 @@ return { "c", "html", "javascript", + "jsdoc", "json", "lua", "luadoc",