mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'LazyVim:main' into gitui
This commit is contained in:
commit
65e62ce30a
12 changed files with 88 additions and 26 deletions
29
CHANGELOG.md
29
CHANGELOG.md
|
|
@ -1,5 +1,34 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [10.24.0](https://github.com/LazyVim/LazyVim/compare/v10.23.0...v10.24.0) (2024-05-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **mason-lspconfig:** allow `opts.ensure_installed` to be taken into account ([#3134](https://github.com/LazyVim/LazyVim/issues/3134)) ([8968c9e](https://github.com/LazyVim/LazyVim/commit/8968c9e9ea76f3a7616d9e249a3c9307a75fffad))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **neo-tree:** correctly set up `cwd` ([#3097](https://github.com/LazyVim/LazyVim/issues/3097)) ([30ce84f](https://github.com/LazyVim/LazyVim/commit/30ce84f7a7fb4e88b47ddf2f569b2ea9b7d56717))
|
||||||
|
* **ui:** don't lazy-load dashboard-nvim ([#3107](https://github.com/LazyVim/LazyVim/issues/3107)) ([30c9e47](https://github.com/LazyVim/LazyVim/commit/30c9e4718a127f7d5a32f11c4d8dbba6b01f9858))
|
||||||
|
|
||||||
|
## [10.23.0](https://github.com/LazyVim/LazyVim/compare/v10.22.0...v10.23.0) (2024-05-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **lualine:** make path trimming configurable by user ([#3062](https://github.com/LazyVim/LazyVim/issues/3062)) ([b8475f5](https://github.com/LazyVim/LazyVim/commit/b8475f51949acf195729a1c4d057a06208a9add9))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **dot:** can't match kitty conf file ([#3042](https://github.com/LazyVim/LazyVim/issues/3042)) ([5fb4cf0](https://github.com/LazyVim/LazyVim/commit/5fb4cf0d365b65cb9b7afa8be047973b5fc1747a))
|
||||||
|
* **dot:** install when list is empty ([#3052](https://github.com/LazyVim/LazyVim/issues/3052)) ([3086bf0](https://github.com/LazyVim/LazyVim/commit/3086bf03e96bfc0048e5b27f8d65a9170bca3f67))
|
||||||
|
* **extras:** Rust-Analyzer cargo option ([#3061](https://github.com/LazyVim/LazyVim/issues/3061)) ([a96348d](https://github.com/LazyVim/LazyVim/commit/a96348d7b076819f7580ea0c0ce467630bfc7cc5))
|
||||||
|
* **native_snippets:** Fix native_snippets for `vim.snippet api` changes ([#3083](https://github.com/LazyVim/LazyVim/issues/3083)) ([6004e8d](https://github.com/LazyVim/LazyVim/commit/6004e8d4f60549bd2c5d6f3187a28d72b21e3261))
|
||||||
|
* **python:** make both `ruff` and `ruff_lsp` available to user ([#3060](https://github.com/LazyVim/LazyVim/issues/3060)) ([34183a2](https://github.com/LazyVim/LazyVim/commit/34183a2759828001b08679659f7d5170d7ec367e))
|
||||||
|
|
||||||
## [10.22.0](https://github.com/LazyVim/LazyVim/compare/v10.21.1...v10.22.0) (2024-04-22)
|
## [10.22.0](https://github.com/LazyVim/LazyVim/compare/v10.21.1...v10.22.0) (2024-04-22)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 22
|
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 May 12
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
-- This file is automatically loaded by lazyvim.config.init
|
-- This file is automatically loaded by lazyvim.config.init
|
||||||
|
|
||||||
-- DO NOT USE THIS IN YOU OWN CONFIG!!
|
-- DO NOT USE `LazyVim.safe_keymap_set` IN YOUR OWN CONFIG!!
|
||||||
-- use `vim.keymap.set` instead
|
-- use `vim.keymap.set` instead
|
||||||
local map = LazyVim.safe_keymap_set
|
local map = LazyVim.safe_keymap_set
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,12 +41,23 @@ return {
|
||||||
vim.cmd([[Neotree close]])
|
vim.cmd([[Neotree close]])
|
||||||
end,
|
end,
|
||||||
init = function()
|
init = function()
|
||||||
if vim.fn.argc(-1) == 1 then
|
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
|
||||||
local stat = vim.uv.fs_stat(vim.fn.argv(0))
|
-- because `cwd` is not set up properly.
|
||||||
if stat and stat.type == "directory" then
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
require("neo-tree")
|
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
|
||||||
end
|
desc = "Start Neo-tree with directory",
|
||||||
end
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
if package.loaded["neo-tree"] then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
local stats = vim.uv.fs_stat(vim.fn.argv(0))
|
||||||
|
if stats and stats.type == "directory" then
|
||||||
|
require("neo-tree")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
opts = {
|
opts = {
|
||||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ return {
|
||||||
{
|
{
|
||||||
"<Tab>",
|
"<Tab>",
|
||||||
function()
|
function()
|
||||||
if vim.snippet.jumpable(1) then
|
if vim.snippet.active({ direction = 1 }) then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.snippet.jump(1)
|
vim.snippet.jump(1)
|
||||||
end)
|
end)
|
||||||
|
|
@ -47,7 +47,7 @@ return {
|
||||||
{
|
{
|
||||||
"<S-Tab>",
|
"<S-Tab>",
|
||||||
function()
|
function()
|
||||||
if vim.snippet.jumpable(-1) then
|
if vim.snippet.active({ direction = -1 }) then
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
vim.snippet.jump(-1)
|
vim.snippet.jump(-1)
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ if lazyvim_docs then
|
||||||
-- LSP Server to use for Python.
|
-- LSP Server to use for Python.
|
||||||
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
||||||
vim.g.lazyvim_python_lsp = "pyright"
|
vim.g.lazyvim_python_lsp = "pyright"
|
||||||
|
vim.g.lazyvim_python_ruff = "ruff_lsp"
|
||||||
end
|
end
|
||||||
|
|
||||||
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
local lsp = vim.g.lazyvim_python_lsp or "pyright"
|
||||||
|
local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
|
|
@ -28,7 +30,13 @@ return {
|
||||||
[lsp] = {
|
[lsp] = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
},
|
},
|
||||||
|
ruff_lsp = {
|
||||||
|
enabled = ruff == "ruff_lsp",
|
||||||
|
},
|
||||||
ruff = {
|
ruff = {
|
||||||
|
enabled = ruff == "ruff",
|
||||||
|
},
|
||||||
|
[ruff] = {
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>co",
|
"<leader>co",
|
||||||
|
|
@ -47,9 +55,9 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = {
|
setup = {
|
||||||
ruff = function()
|
[ruff] = function()
|
||||||
LazyVim.lsp.on_attach(function(client, _)
|
LazyVim.lsp.on_attach(function(client, _)
|
||||||
if client.name == "ruff" then
|
if client.name == ruff then
|
||||||
-- Disable hover in favor of Pyright
|
-- Disable hover in favor of Pyright
|
||||||
client.server_capabilities.hoverProvider = false
|
client.server_capabilities.hoverProvider = false
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,9 @@ return {
|
||||||
cargo = {
|
cargo = {
|
||||||
allFeatures = true,
|
allFeatures = true,
|
||||||
loadOutDirsFromCheck = true,
|
loadOutDirsFromCheck = true,
|
||||||
runBuildScripts = true,
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- Add clippy lints for Rust.
|
-- Add clippy lints for Rust.
|
||||||
checkOnSave = {
|
checkOnSave = {
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,8 @@ return {
|
||||||
{
|
{
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
vim.list_extend(opts.ensure_installed or {}, {
|
opts.ensure_installed = opts.ensure_installed or {}
|
||||||
"shfmt",
|
vim.list_extend(opts.ensure_installed, { "shellcheck" })
|
||||||
"shellcheck",
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- add some stuff to treesitter
|
-- add some stuff to treesitter
|
||||||
|
|
@ -37,15 +35,15 @@ return {
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" },
|
extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" },
|
||||||
filename = {
|
filename = {
|
||||||
[".env"] = "dotenv",
|
[".env"] = "sh",
|
||||||
["vifmrc"] = "vim",
|
["vifmrc"] = "vim",
|
||||||
},
|
},
|
||||||
pattern = {
|
pattern = {
|
||||||
[".*/waybar/config"] = "jsonc",
|
[".*/waybar/config"] = "jsonc",
|
||||||
[".*/mako/config"] = "dosini",
|
[".*/mako/config"] = "dosini",
|
||||||
[".*/kitty/*.conf"] = "bash",
|
[".*/kitty/.+%.conf"] = "bash",
|
||||||
[".*/hypr/.*%.conf"] = "hyprlang",
|
[".*/hypr/.+%.conf"] = "hyprlang",
|
||||||
["%.env%.[%w_.-]+"] = "dotenv",
|
["%.env%.[%w_.-]+"] = "sh",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,14 @@ return {
|
||||||
end
|
end
|
||||||
|
|
||||||
if have_mason then
|
if have_mason then
|
||||||
mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } })
|
mlsp.setup({
|
||||||
|
ensure_installed = vim.tbl_deep_extend(
|
||||||
|
"force",
|
||||||
|
ensure_installed,
|
||||||
|
LazyVim.opts("mason-lspconfig.nvim").ensure_installed or {}
|
||||||
|
),
|
||||||
|
handlers = { setup },
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then
|
if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then
|
||||||
|
|
|
||||||
|
|
@ -346,9 +346,10 @@ return {
|
||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"nvimdev/dashboard-nvim",
|
"nvimdev/dashboard-nvim",
|
||||||
event = "VimEnter",
|
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
|
||||||
opts = function()
|
opts = function()
|
||||||
local logo = [[
|
local logo = [[
|
||||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ function M.pretty_path(opts)
|
||||||
directory_hl = "",
|
directory_hl = "",
|
||||||
filename_hl = "Bold",
|
filename_hl = "Bold",
|
||||||
modified_sign = "",
|
modified_sign = "",
|
||||||
|
length = 3,
|
||||||
}, opts or {})
|
}, opts or {})
|
||||||
|
|
||||||
return function(self)
|
return function(self)
|
||||||
|
|
@ -100,8 +101,10 @@ function M.pretty_path(opts)
|
||||||
local sep = package.config:sub(1, 1)
|
local sep = package.config:sub(1, 1)
|
||||||
local parts = vim.split(path, "[\\/]")
|
local parts = vim.split(path, "[\\/]")
|
||||||
|
|
||||||
if #parts > 3 then
|
if opts.length == 0 then
|
||||||
parts = { parts[1], "…", parts[#parts - 1], parts[#parts] }
|
parts = parts
|
||||||
|
elseif #parts > opts.length then
|
||||||
|
parts = { parts[1], "…", table.concat({ unpack(parts, #parts - opts.length + 2, #parts) }, sep) }
|
||||||
end
|
end
|
||||||
|
|
||||||
if opts.modified_hl and vim.bo.modified then
|
if opts.modified_hl and vim.bo.modified then
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,10 @@ function M.setup()
|
||||||
LazyVim.root.info()
|
LazyVim.root.info()
|
||||||
end, { desc = "LazyVim roots for the current buffer" })
|
end, { desc = "LazyVim roots for the current buffer" })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged" }, {
|
-- FIX: doesn't properly clear cache in neo-tree `set_root` (which should happen presumably on `DirChanged`),
|
||||||
|
-- probably because the event is triggered in the neo-tree buffer, therefore add `BufEnter`
|
||||||
|
-- Maybe this is too frequent on `BufEnter` and something else should be done instead??
|
||||||
|
vim.api.nvim_create_autocmd({ "LspAttach", "BufWritePost", "DirChanged", "BufEnter" }, {
|
||||||
group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }),
|
group = vim.api.nvim_create_augroup("lazyvim_root_cache", { clear = true }),
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
M.cache[event.buf] = nil
|
M.cache[event.buf] = nil
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue