Merge branch 'LazyVim:main' into gitui

This commit is contained in:
Rubin Bhandari 2024-05-12 20:50:07 +05:45 committed by GitHub
commit 65e62ce30a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 88 additions and 26 deletions

View file

@ -1,5 +1,34 @@
# 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)

View file

@ -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*

View file

@ -1,6 +1,6 @@
-- 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
local map = LazyVim.safe_keymap_set

View file

@ -41,12 +41,23 @@ return {
vim.cmd([[Neotree close]])
end,
init = function()
if vim.fn.argc(-1) == 1 then
local stat = vim.uv.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
end
end
-- FIX: use `autocmd` for lazy-loading neo-tree instead of directly requiring it,
-- because `cwd` is not set up properly.
vim.api.nvim_create_autocmd("BufEnter", {
group = vim.api.nvim_create_augroup("Neotree_start_directory", { clear = true }),
desc = "Start Neo-tree with directory",
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,
opts = {
sources = { "filesystem", "buffers", "git_status", "document_symbols" },

View file

@ -22,7 +22,7 @@ return {
{
"<Tab>",
function()
if vim.snippet.jumpable(1) then
if vim.snippet.active({ direction = 1 }) then
vim.schedule(function()
vim.snippet.jump(1)
end)
@ -47,7 +47,7 @@ return {
{
"<S-Tab>",
function()
if vim.snippet.jumpable(-1) then
if vim.snippet.active({ direction = -1 }) then
vim.schedule(function()
vim.snippet.jump(-1)
end)

View file

@ -2,9 +2,11 @@ if lazyvim_docs then
-- LSP Server to use for Python.
-- Set to "basedpyright" to use basedpyright instead of pyright.
vim.g.lazyvim_python_lsp = "pyright"
vim.g.lazyvim_python_ruff = "ruff_lsp"
end
local lsp = vim.g.lazyvim_python_lsp or "pyright"
local ruff = vim.g.lazyvim_python_ruff or "ruff_lsp"
return {
{
@ -28,7 +30,13 @@ return {
[lsp] = {
enabled = true,
},
ruff_lsp = {
enabled = ruff == "ruff_lsp",
},
ruff = {
enabled = ruff == "ruff",
},
[ruff] = {
keys = {
{
"<leader>co",
@ -47,9 +55,9 @@ return {
},
},
setup = {
ruff = function()
[ruff] = function()
LazyVim.lsp.on_attach(function(client, _)
if client.name == "ruff" then
if client.name == ruff then
-- Disable hover in favor of Pyright
client.server_capabilities.hoverProvider = false
end

View file

@ -60,7 +60,9 @@ return {
cargo = {
allFeatures = true,
loadOutDirsFromCheck = true,
runBuildScripts = true,
buildScripts = {
enable = true,
},
},
-- Add clippy lints for Rust.
checkOnSave = {

View file

@ -18,10 +18,8 @@ return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed or {}, {
"shfmt",
"shellcheck",
})
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "shellcheck" })
end,
},
-- add some stuff to treesitter
@ -37,15 +35,15 @@ return {
vim.filetype.add({
extension = { rasi = "rasi", rofi = "rasi", wofi = "rasi" },
filename = {
[".env"] = "dotenv",
[".env"] = "sh",
["vifmrc"] = "vim",
},
pattern = {
[".*/waybar/config"] = "jsonc",
[".*/mako/config"] = "dosini",
[".*/kitty/*.conf"] = "bash",
[".*/hypr/.*%.conf"] = "hyprlang",
["%.env%.[%w_.-]+"] = "dotenv",
[".*/kitty/.+%.conf"] = "bash",
[".*/hypr/.+%.conf"] = "hyprlang",
["%.env%.[%w_.-]+"] = "sh",
},
})

View file

@ -212,7 +212,14 @@ return {
end
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
if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then

View file

@ -346,9 +346,10 @@ return {
return false
end,
},
{
"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()
local logo = [[
Z

View file

@ -79,6 +79,7 @@ function M.pretty_path(opts)
directory_hl = "",
filename_hl = "Bold",
modified_sign = "",
length = 3,
}, opts or {})
return function(self)
@ -100,8 +101,10 @@ function M.pretty_path(opts)
local sep = package.config:sub(1, 1)
local parts = vim.split(path, "[\\/]")
if #parts > 3 then
parts = { parts[1], "", parts[#parts - 1], parts[#parts] }
if opts.length == 0 then
parts = parts
elseif #parts > opts.length then
parts = { parts[1], "", table.concat({ unpack(parts, #parts - opts.length + 2, #parts) }, sep) }
end
if opts.modified_hl and vim.bo.modified then

View file

@ -142,7 +142,10 @@ function M.setup()
LazyVim.root.info()
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 }),
callback = function(event)
M.cache[event.buf] = nil