mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into feature/pick-file-from-cword
This commit is contained in:
commit
2a526fc40c
26 changed files with 137 additions and 31 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
".": "12.39.0"
|
".": "12.43.0"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
54
CHANGELOG.md
54
CHANGELOG.md
|
|
@ -1,5 +1,59 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [12.43.0](https://github.com/LazyVim/LazyVim/compare/v12.42.0...v12.43.0) (2024-10-23)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **catppuccin:** bufferline integration. Closes [#4583](https://github.com/LazyVim/LazyVim/issues/4583). Closes [#4581](https://github.com/LazyVim/LazyVim/issues/4581) ([917c685](https://github.com/LazyVim/LazyVim/commit/917c685c1fb3774375ea2236e5e7aaa3d951fdda))
|
||||||
|
* **extras:** expose `prios` to users for customization ([#4587](https://github.com/LazyVim/LazyVim/issues/4587)) ([e46cb62](https://github.com/LazyVim/LazyVim/commit/e46cb62a17e1f4b7f163f4e0fdd13593c4af3abd))
|
||||||
|
* **keymaps:** allow `v:count1` when moving lines ([#4618](https://github.com/LazyVim/LazyVim/issues/4618)) ([b4eb4e1](https://github.com/LazyVim/LazyVim/commit/b4eb4e1f4a4024229fe40782fdb12683c1c69634))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **folds:** enable folds when treesitter available. Fixes [#4563](https://github.com/LazyVim/LazyVim/issues/4563) ([fe7003d](https://github.com/LazyVim/LazyVim/commit/fe7003de506ef7022a6c5f623476630d7bc30944))
|
||||||
|
|
||||||
|
## [12.42.0](https://github.com/LazyVim/LazyVim/compare/v12.41.0...v12.42.0) (2024-10-04)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **root:** provide `vim.g.root_lsp_ignore` to ignore LSP servers ([#4332](https://github.com/LazyVim/LazyVim/issues/4332)) ([90a9231](https://github.com/LazyVim/LazyVim/commit/90a92312aed79d4ee9d231f9eb3f8cd4debc46d1))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **gitsigns:** change name of filetype blame ([#4243](https://github.com/LazyVim/LazyVim/issues/4243)) ([3e257fd](https://github.com/LazyVim/LazyVim/commit/3e257fdb8874d7112446dc3ca1caf9c3263d8194))
|
||||||
|
* **neotest:** properly initialize adapter with call table. Fixes [#4538](https://github.com/LazyVim/LazyVim/issues/4538) ([327e829](https://github.com/LazyVim/LazyVim/commit/327e829c156864975785914038fe4515dadcba87))
|
||||||
|
|
||||||
|
## [12.41.0](https://github.com/LazyVim/LazyVim/compare/v12.40.0...v12.41.0) (2024-10-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **rust:** update rustaceanvim ([#4477](https://github.com/LazyVim/LazyVim/issues/4477)) ([04515b1](https://github.com/LazyVim/LazyVim/commit/04515b139973173e90604f700d70f4e6d714da1f))
|
||||||
|
* **toggle:** add more `M.wk` fields for better user customization ([#4521](https://github.com/LazyVim/LazyVim/issues/4521)) ([57c0c0b](https://github.com/LazyVim/LazyVim/commit/57c0c0bc9f86467d90c0c10aac680bdba8e56469))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **extras:** migrate away from deprecated `get_target_window()` in mini-files ([#4479](https://github.com/LazyVim/LazyVim/issues/4479)) ([b110550](https://github.com/LazyVim/LazyVim/commit/b110550393957a3434db1f4f0dc5804a9d31820f))
|
||||||
|
|
||||||
|
## [12.40.0](https://github.com/LazyVim/LazyVim/compare/v12.39.0...v12.40.0) (2024-10-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **lang:** add ts_ls to lsp config ([#4406](https://github.com/LazyVim/LazyVim/issues/4406)) ([34f0e56](https://github.com/LazyVim/LazyVim/commit/34f0e568d4e853cc2b4f0d628749cb66cd1b9aaf))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **extras:** rename `lspconfig.server_configurations` to `lspconfig.configs` ([#4518](https://github.com/LazyVim/LazyVim/issues/4518)) ([7432574](https://github.com/LazyVim/LazyVim/commit/74325743e7ff9d9efe9172ba96ec063c65ee219c))
|
||||||
|
* **lsp:** backward compat with lspconfig refactor. Fixes [#4525](https://github.com/LazyVim/LazyVim/issues/4525). See [#4518](https://github.com/LazyVim/LazyVim/issues/4518) ([6e40252](https://github.com/LazyVim/LazyVim/commit/6e4025229d4628a7278cf7c09f942af6dfea05dd))
|
||||||
|
* **render-markdown:** remove redundant `opts.file_types` ([#4506](https://github.com/LazyVim/LazyVim/issues/4506)) ([9b17672](https://github.com/LazyVim/LazyVim/commit/9b1767205cffd958ee9c74ceca299bd6c128b5f8))
|
||||||
|
|
||||||
## [12.39.0](https://github.com/LazyVim/LazyVim/compare/v12.38.2...v12.39.0) (2024-09-18)
|
## [12.39.0](https://github.com/LazyVim/LazyVim/compare/v12.38.2...v12.39.0) (2024-09-18)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim Last change: 2024 September 18
|
*LazyVim.txt* For Neovim Last change: 2024 October 24
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
|
||||||
|
|
@ -68,15 +68,20 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
"neotest-summary",
|
"neotest-summary",
|
||||||
"neotest-output-panel",
|
"neotest-output-panel",
|
||||||
"dbout",
|
"dbout",
|
||||||
"gitsigns.blame",
|
"gitsigns-blame",
|
||||||
},
|
},
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
vim.bo[event.buf].buflisted = false
|
vim.bo[event.buf].buflisted = false
|
||||||
vim.keymap.set("n", "q", "<cmd>close<cr>", {
|
vim.schedule(function()
|
||||||
buffer = event.buf,
|
vim.keymap.set("n", "q", function()
|
||||||
silent = true,
|
vim.cmd("close")
|
||||||
desc = "Quit buffer",
|
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })
|
||||||
})
|
end, {
|
||||||
|
buffer = event.buf,
|
||||||
|
silent = true,
|
||||||
|
desc = "Quit buffer",
|
||||||
|
})
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
||||||
---@class LazyVimConfig: LazyVimOptions
|
---@class LazyVimConfig: LazyVimOptions
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
M.version = "12.39.0" -- x-release-please-version
|
M.version = "12.43.0" -- x-release-please-version
|
||||||
LazyVim.config = M
|
LazyVim.config = M
|
||||||
|
|
||||||
---@class LazyVimOptions
|
---@class LazyVimOptions
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,12 @@ map("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease Window Wi
|
||||||
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
|
map("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase Window Width" })
|
||||||
|
|
||||||
-- Move Lines
|
-- Move Lines
|
||||||
map("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move Down" })
|
map("n", "<A-j>", "<cmd>execute 'move .+' . v:count1<cr>==", { desc = "Move Down" })
|
||||||
map("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move Up" })
|
map("n", "<A-k>", "<cmd>execute 'move .-' . (v:count1 + 1)<cr>==", { desc = "Move Up" })
|
||||||
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
|
map("i", "<A-j>", "<esc><cmd>m .+1<cr>==gi", { desc = "Move Down" })
|
||||||
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
|
map("i", "<A-k>", "<esc><cmd>m .-2<cr>==gi", { desc = "Move Up" })
|
||||||
map("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move Down" })
|
map("v", "<A-j>", ":<C-u>execute \"'<,'>move '>+\" . v:count1<cr>gv=gv", { desc = "Move Down" })
|
||||||
map("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move Up" })
|
map("v", "<A-k>", ":<C-u>execute \"'<,'>move '<-\" . (v:count1 + 1)<cr>gv=gv", { desc = "Move Up" })
|
||||||
|
|
||||||
-- buffers
|
-- buffers
|
||||||
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
map("n", "<S-h>", "<cmd>bprevious<cr>", { desc = "Prev Buffer" })
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,10 @@ vim.g.lazyvim_statuscolumn = {
|
||||||
-- * powershell
|
-- * powershell
|
||||||
-- LazyVim.terminal.setup("pwsh")
|
-- LazyVim.terminal.setup("pwsh")
|
||||||
|
|
||||||
|
-- Set LSP servers to be ignored when used with `util.root.detectors.lsp`
|
||||||
|
-- for detecting the LSP root
|
||||||
|
vim.g.root_lsp_ignore = { "copilot" }
|
||||||
|
|
||||||
-- Hide deprecation warnings
|
-- Hide deprecation warnings
|
||||||
vim.g.deprecation_warnings = false
|
vim.g.deprecation_warnings = false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ return {
|
||||||
-- snippets
|
-- snippets
|
||||||
{
|
{
|
||||||
"nvim-cmp",
|
"nvim-cmp",
|
||||||
|
optional = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"garymjr/nvim-snippets",
|
"garymjr/nvim-snippets",
|
||||||
|
|
@ -209,6 +210,7 @@ return {
|
||||||
-- Add lazydev source to cmp
|
-- Add lazydev source to cmp
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
|
table.insert(opts.sources, { name = "lazydev", group_index = 0 })
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
|
|
@ -50,5 +50,16 @@ return {
|
||||||
which_key = true,
|
which_key = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
specs = {
|
||||||
|
{
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
if (vim.g.colors_name or ""):find("catppuccin") then
|
||||||
|
opts.highlights = require("catppuccin.groups.integrations.bufferline").get()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ return {
|
||||||
-- Tabnine cmp source
|
-- Tabnine cmp source
|
||||||
{
|
{
|
||||||
"nvim-cmp",
|
"nvim-cmp",
|
||||||
|
optional = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"tzachar/cmp-tabnine",
|
"tzachar/cmp-tabnine",
|
||||||
|
|
|
||||||
|
|
@ -69,11 +69,6 @@ return {
|
||||||
vscode.json_decode = function(str)
|
vscode.json_decode = function(str)
|
||||||
return vim.json.decode(json.json_strip_comments(str))
|
return vim.json.decode(json.json_strip_comments(str))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Extends dap.configurations with entries read from .vscode/launch.json
|
|
||||||
if vim.fn.filereadable(".vscode/launch.json") then
|
|
||||||
vscode.load_launchjs()
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ return {
|
||||||
local map_split = function(buf_id, lhs, direction, close_on_file)
|
local map_split = function(buf_id, lhs, direction, close_on_file)
|
||||||
local rhs = function()
|
local rhs = function()
|
||||||
local new_target_window
|
local new_target_window
|
||||||
local cur_target_window = require("mini.files").get_target_window()
|
local cur_target_window = require("mini.files").get_explorer_state().target_window
|
||||||
if cur_target_window ~= nil then
|
if cur_target_window ~= nil then
|
||||||
vim.api.nvim_win_call(cur_target_window, function()
|
vim.api.nvim_win_call(cur_target_window, function()
|
||||||
vim.cmd("belowright " .. direction .. " split")
|
vim.cmd("belowright " .. direction .. " split")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
-- This is the same as in lspconfig.server_configurations.jdtls, but avoids
|
-- This is the same as in lspconfig.configs.jdtls, but avoids
|
||||||
-- needing to require that when this module loads.
|
-- needing to require that when this module loads.
|
||||||
local java_filetypes = { "java" }
|
local java_filetypes = { "java" }
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ return {
|
||||||
return {
|
return {
|
||||||
-- How to find the root dir for a given filename. The default comes from
|
-- How to find the root dir for a given filename. The default comes from
|
||||||
-- lspconfig which provides a function specifically for java projects.
|
-- lspconfig which provides a function specifically for java projects.
|
||||||
root_dir = require("lspconfig.server_configurations.jdtls").default_config.root_dir,
|
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
|
||||||
|
|
||||||
-- How to find the project name for a given root dir.
|
-- How to find the project name for a given root dir.
|
||||||
project_name = function(root_dir)
|
project_name = function(root_dir)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ return {
|
||||||
--
|
--
|
||||||
-- false to disable, otherwise should be a table of options to pass to `leanls`
|
-- false to disable, otherwise should be a table of options to pass to `leanls`
|
||||||
--
|
--
|
||||||
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#leanls for details.
|
-- See https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#leanls for details.
|
||||||
-- In particular ensure you have followed instructions setting up a callback
|
-- In particular ensure you have followed instructions setting up a callback
|
||||||
-- for `LspAttach` which sets your key bindings!
|
-- for `LspAttach` which sets your key bindings!
|
||||||
lsp = {
|
lsp = {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,6 @@ return {
|
||||||
{
|
{
|
||||||
"MeanderingProgrammer/render-markdown.nvim",
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
file_types = { "markdown", "norg", "rmd", "org" },
|
|
||||||
code = {
|
code = {
|
||||||
sign = false,
|
sign = false,
|
||||||
width = "block",
|
width = "block",
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
opts.auto_brackets = opts.auto_brackets or {}
|
opts.auto_brackets = opts.auto_brackets or {}
|
||||||
table.insert(opts.auto_brackets, "python")
|
table.insert(opts.auto_brackets, "python")
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ return {
|
||||||
-- Extend auto completion
|
-- Extend auto completion
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
optional = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
"Saecki/crates.nvim",
|
"Saecki/crates.nvim",
|
||||||
|
|
@ -42,7 +43,7 @@ return {
|
||||||
|
|
||||||
{
|
{
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = "^4", -- Recommended
|
version = vim.fn.has("nvim-0.10.0") == 0 and "^4" or false,
|
||||||
ft = { "rust" },
|
ft = { "rust" },
|
||||||
opts = {
|
opts = {
|
||||||
server = {
|
server = {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ return {
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
tailwindcss = function(_, opts)
|
tailwindcss = function(_, opts)
|
||||||
local tw = require("lspconfig.server_configurations.tailwindcss")
|
local tw = LazyVim.lsp.get_raw_config("tailwindcss")
|
||||||
opts.filetypes = opts.filetypes or {}
|
opts.filetypes = opts.filetypes or {}
|
||||||
|
|
||||||
-- Add default filetypes
|
-- Add default filetypes
|
||||||
|
|
@ -59,6 +59,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
optional = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} },
|
{ "roobert/tailwindcss-colorizer-cmp.nvim", opts = {} },
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ return {
|
||||||
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<localLeader>l", "", desc = "+vimtext" },
|
{ "<localLeader>l", "", desc = "+vimtex" },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,14 @@ return {
|
||||||
opts = {
|
opts = {
|
||||||
-- make sure mason installs the server
|
-- make sure mason installs the server
|
||||||
servers = {
|
servers = {
|
||||||
|
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
||||||
|
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
||||||
tsserver = {
|
tsserver = {
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
|
ts_ls = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
vtsls = {
|
vtsls = {
|
||||||
-- explicitly add default filetypes, so that we can extend
|
-- explicitly add default filetypes, so that we can extend
|
||||||
-- them in related extras
|
-- them in related extras
|
||||||
|
|
@ -114,10 +119,16 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
|
--- @deprecated -- tsserver renamed to ts_ls but not yet released, so keep this for now
|
||||||
|
--- the proper approach is to check the nvim-lspconfig release version when it's released to determine the server name dynamically
|
||||||
tsserver = function()
|
tsserver = function()
|
||||||
-- disable tsserver
|
-- disable tsserver
|
||||||
return true
|
return true
|
||||||
end,
|
end,
|
||||||
|
ts_ls = function()
|
||||||
|
-- disable tsserver
|
||||||
|
return true
|
||||||
|
end,
|
||||||
vtsls = function(_, opts)
|
vtsls = function(_, opts)
|
||||||
LazyVim.lsp.on_attach(function(client, buffer)
|
LazyVim.lsp.on_attach(function(client, buffer)
|
||||||
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ return {
|
||||||
adapter.adapter(config)
|
adapter.adapter(config)
|
||||||
adapter = adapter.adapter
|
adapter = adapter.adapter
|
||||||
elseif meta and meta.__call then
|
elseif meta and meta.__call then
|
||||||
adapter(config)
|
adapter = adapter(config)
|
||||||
else
|
else
|
||||||
error("Adapter " .. name .. " does not support setup")
|
error("Adapter " .. name .. " does not support setup")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@ local prios = {
|
||||||
["lazyvim.plugins.extras.editor.outline"] = 100,
|
["lazyvim.plugins.extras.editor.outline"] = 100,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if vim.g.xtras_prios then
|
||||||
|
prios = vim.tbl_deep_extend("force", prios, vim.g.xtras_prios or {})
|
||||||
|
end
|
||||||
|
|
||||||
---@type string[]
|
---@type string[]
|
||||||
local extras = LazyVim.dedup(LazyVim.config.json.data.extras)
|
local extras = LazyVim.dedup(LazyVim.config.json.data.extras)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -181,6 +181,15 @@ function M.get_config(server)
|
||||||
return rawget(configs, server)
|
return rawget(configs, server)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@return {default_config:lspconfig.Config}
|
||||||
|
function M.get_raw_config(server)
|
||||||
|
local ok, ret = pcall(require, "lspconfig.configs." .. server)
|
||||||
|
if ok then
|
||||||
|
return ret
|
||||||
|
end
|
||||||
|
return require("lspconfig.server_configurations." .. server)
|
||||||
|
end
|
||||||
|
|
||||||
function M.is_enabled(server)
|
function M.is_enabled(server)
|
||||||
local c = M.get_config(server)
|
local c = M.get_config(server)
|
||||||
return c and c.enabled ~= false
|
return c and c.enabled ~= false
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,11 @@ function M.detectors.lsp(buf)
|
||||||
return {}
|
return {}
|
||||||
end
|
end
|
||||||
local roots = {} ---@type string[]
|
local roots = {} ---@type string[]
|
||||||
for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do
|
local clients = LazyVim.lsp.get_clients({ bufnr = buf })
|
||||||
|
clients = vim.tbl_filter(function(client)
|
||||||
|
return not vim.tbl_contains(vim.g.root_lsp_ignore or {}, client.name)
|
||||||
|
end, clients)
|
||||||
|
for _, client in pairs(clients) do
|
||||||
local workspace = client.config.workspace_folders
|
local workspace = client.config.workspace_folders
|
||||||
for _, ws in pairs(workspace or {}) do
|
for _, ws in pairs(workspace or {}) do
|
||||||
roots[#roots + 1] = vim.uri_to_fname(ws.uri)
|
roots[#roots + 1] = vim.uri_to_fname(ws.uri)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ local M = {}
|
||||||
|
|
||||||
---@class lazyvim.Toggle
|
---@class lazyvim.Toggle
|
||||||
---@field name string
|
---@field name string
|
||||||
|
---@field icon? string
|
||||||
|
---@field color_enabled? string
|
||||||
|
---@field color_disabled? string
|
||||||
---@field get fun():boolean
|
---@field get fun():boolean
|
||||||
---@field set fun(state:boolean)
|
---@field set fun(state:boolean)
|
||||||
|
|
||||||
|
|
@ -50,7 +53,8 @@ function M.wk(lhs, toggle)
|
||||||
{
|
{
|
||||||
lhs,
|
lhs,
|
||||||
icon = function()
|
icon = function()
|
||||||
return safe_get() and { icon = " ", color = "green" } or { icon = " ", color = "yellow" }
|
return safe_get() and { icon = toggle.icon or " ", color = toggle.color_enabled or "green" }
|
||||||
|
or { icon = toggle.icon or " ", color = toggle.color_disabled or "yellow" }
|
||||||
end,
|
end,
|
||||||
desc = function()
|
desc = function()
|
||||||
return (safe_get() and "Disable " or "Enable ") .. toggle.name
|
return (safe_get() and "Disable " or "Enable ") .. toggle.name
|
||||||
|
|
|
||||||
|
|
@ -197,8 +197,8 @@ function M.foldexpr()
|
||||||
return "0"
|
return "0"
|
||||||
end
|
end
|
||||||
|
|
||||||
-- don't use treesitter folds for non-file buffers
|
-- don't use treesitter folds for terminal
|
||||||
if vim.bo[buf].buftype ~= "" then
|
if vim.bo[buf].buftype == "terminal" then
|
||||||
return "0"
|
return "0"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue