Merge branch 'main' into lean

This commit is contained in:
Ben Puryear 2024-07-18 18:43:04 -07:00 committed by GitHub
commit ec8002c5c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 115 additions and 54 deletions

View file

@ -1,3 +1,3 @@
{
".": "12.30.0"
".": "12.32.0"
}

View file

@ -1,5 +1,34 @@
# Changelog
## [12.32.0](https://github.com/LazyVim/LazyVim/compare/v12.31.0...v12.32.0) (2024-07-18)
### Features
* **edgy:** added support for grug-far.nvim ([b1a4740](https://github.com/LazyVim/LazyVim/commit/b1a47405b9fa5eb9f5222876e81be73206b80792))
* **terminal:** clear search highlight when opening a terminal ([#4090](https://github.com/LazyVim/LazyVim/issues/4090)) ([b5290fd](https://github.com/LazyVim/LazyVim/commit/b5290fd92935d2e96fa2249cfd09bdd853972869))
* **toggle:** move toggle notifs to toggle function ([c1b76ee](https://github.com/LazyVim/LazyVim/commit/c1b76ee235a2cccff6370ecfca57bdacd5fe6258))
### Bug Fixes
* **autcmds:** desc for close_with_q ([d6561fd](https://github.com/LazyVim/LazyVim/commit/d6561fd27c17806ca972cbfc18573ca81d13e346))
* **ui:** another typo ([b8bdebe](https://github.com/LazyVim/LazyVim/commit/b8bdebe5be7eba91db23e43575fc1226075f6a56))
* **ui:** typo ([4ac249b](https://github.com/LazyVim/LazyVim/commit/4ac249beaae3462d606128ca21db79cb85a8c65b))
## [12.31.0](https://github.com/LazyVim/LazyVim/compare/v12.30.0...v12.31.0) (2024-07-17)
### Features
* **keymaps:** proxy leader-w to ctrl-w ([bab5440](https://github.com/LazyVim/LazyVim/commit/bab54406dc312947e4e03bb728498503c09231ca))
* **R:** added new which-key group for new install feature ([#4078](https://github.com/LazyVim/LazyVim/issues/4078)) ([5339aca](https://github.com/LazyVim/LazyVim/commit/5339acacec0996968d64fdbaf9fe8187bfea1b47))
* **toggle:** make toggles callable. Fixes [#4081](https://github.com/LazyVim/LazyVim/issues/4081) ([150523b](https://github.com/LazyVim/LazyVim/commit/150523b77b6e848c4135a97a5fd8f6f79a6f4443))
* **treesitter-context:** which-key toggle ([#4059](https://github.com/LazyVim/LazyVim/issues/4059)) ([ab01350](https://github.com/LazyVim/LazyVim/commit/ab0135093bc18ccf82325bc8ee14c25230a71786))
* **which-key:** dynamic buffer mappings under leader-b ([8d9f2ad](https://github.com/LazyVim/LazyVim/commit/8d9f2ad97ee0d495135380975438ab8a8ae62b14))
* **which-key:** dynamic window mappings under leader-w ([66bba78](https://github.com/LazyVim/LazyVim/commit/66bba787b83afdd85b5ee95aa589fbe9fbb95535))
* **which-key:** leader-w-space starts hydra mode for window mappings ([865bf15](https://github.com/LazyVim/LazyVim/commit/865bf15f1cf4d4f6a3eda6d7509f94a59752fb36))
## [12.30.0](https://github.com/LazyVim/LazyVim/compare/v12.29.2...v12.30.0) (2024-07-15)

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim Last change: 2024 July 16
*LazyVim.txt* For Neovim Last change: 2024 July 18
==============================================================================
Table of Contents *LazyVim-table-of-contents*

View file

@ -71,7 +71,11 @@ vim.api.nvim_create_autocmd("FileType", {
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
vim.keymap.set("n", "q", "<cmd>close<cr>", {
buffer = event.buf,
silent = true,
desc = "Quit buffer",
})
end,
})

View file

@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
---@class LazyVimConfig: LazyVimOptions
local M = {}
M.version = "12.30.0" -- x-release-please-version
M.version = "12.32.0" -- x-release-please-version
LazyVim.config = M
---@class LazyVimOptions

View file

@ -174,13 +174,11 @@ map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- windows
map("n", "<leader>ww", "<C-W>p", { desc = "Other Window", remap = true })
map("n", "<leader>wd", "<C-W>c", { desc = "Delete Window", remap = true })
map("n", "<leader>w-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>w|", "<C-W>v", { desc = "Split Window Right", remap = true })
map("n", "<leader>w", "<c-w>", { desc = "Windows", remap = true })
map("n", "<leader>-", "<C-W>s", { desc = "Split Window Below", remap = true })
map("n", "<leader>|", "<C-W>v", { desc = "Split Window Right", remap = true })
LazyVim.toggle.map("<leader>wm", LazyVim.toggle.maximize)
map("n", "<c-w>d", "<C-W>c", { desc = "Delete Window", remap = true })
LazyVim.toggle.map("<c-w>m", LazyVim.toggle.maximize)
-- tabs
map("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })

View file

@ -47,6 +47,7 @@ vim.g.deprecation_warnings = false
vim.g.bigfile_size = 1024 * 1024 * 1.5 -- 1.5 MB
-- Show the current document symbols location from Trouble in lualine
-- You can disable this for a buffer by setting `vim.b.trouble_lualine = false`
vim.g.trouble_lualine = true
local opt = vim.opt

View file

@ -169,7 +169,13 @@ return {
{
mode = { "n", "v" },
{ "<leader><tab>", group = "tabs" },
{ "<leader>b", group = "buffer" },
{
"<leader>b",
group = "buffer",
expand = function()
return require("which-key.extras").expand.buf()
end,
},
{ "<leader>c", group = "code" },
{ "<leader>f", group = "file/find" },
{ "<leader>g", group = "git" },
@ -177,7 +183,14 @@ return {
{ "<leader>q", group = "quit/session" },
{ "<leader>s", group = "search" },
{ "<leader>u", group = "ui", icon = { icon = "󰙵 ", color = "cyan" } },
{ "<leader>w", group = "windows" },
{
"<leader>w",
group = "windows",
proxy = "<c-w>",
expand = function()
return require("which-key.extras").expand.win()
end,
},
{ "<leader>x", group = "diagnostics/quickfix", icon = { icon = "󱖫 ", color = "green" } },
{ "[", group = "prev" },
{ "]", group = "next" },
@ -195,6 +208,13 @@ return {
end,
desc = "Buffer Keymaps (which-key)",
},
{
"<c-w><space>",
function()
require("which-key").show({ keys = "<c-w>", loop = true })
end,
desc = "Window Hydra Mode (which-key)",
},
},
config = function(_, opts)
local wk = require("which-key")

View file

@ -56,6 +56,9 @@ return {
{ title = "Neotest Summary", ft = "neotest-summary" },
-- "neo-tree",
},
right = {
{ title = "Grug Far", ft = "grug-far", size = { width = 0.4 } },
},
keys = {
-- increase width
["<c-Right>"] = function(win)

View file

@ -198,20 +198,22 @@ return {
}
-- do not add trouble symbols if aerial is enabled
-- And allow it to be overriden for some buffer types (see autocmds)
if vim.g.trouble_lualine and LazyVim.has("trouble.nvim") then
local trouble = require("trouble")
local symbols = trouble.statusline
and trouble.statusline({
mode = "symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
hl_group = "lualine_c_normal",
})
local symbols = trouble.statusline({
mode = "symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
hl_group = "lualine_c_normal",
})
table.insert(opts.sections.lualine_c, {
symbols and symbols.get,
cond = symbols and symbols.has,
cond = function()
return vim.b.trouble_lualine ~= false and symbols.has()
end,
})
end

View file

@ -87,6 +87,8 @@ function M.open(cmd, opts)
vim.cmd.startinsert()
end,
})
vim.cmd("noh")
end
return terminals[termkey]

View file

@ -5,21 +5,32 @@ local M = {}
---@field name string
---@field get fun():boolean
---@field set fun(state:boolean)
---@overload fun()
local T = {}
T.__index = T
---@class lazyvim.Toggle.wrap: lazyvim.Toggle
---@operator call:boolean
---@param toggle lazyvim.Toggle
function M.wrap(toggle)
return setmetatable(toggle, {
__call = function()
toggle.set(not toggle.get())
local state = toggle.get()
if state then
LazyVim.info("Enabled " .. toggle.name, { title = toggle.name })
else
LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name })
end
return state
end,
}) --[[@as lazyvim.Toggle.wrap]]
end
---@param lhs string
---@param toggle lazyvim.Toggle
function M.map(lhs, toggle)
local t = M.wrap(toggle)
LazyVim.safe_keymap_set("n", lhs, function()
local state = not toggle.get()
toggle.set(state)
if state then
LazyVim.info("Enabled " .. toggle.name, { title = toggle.name })
else
LazyVim.warn("Disabled " .. toggle.name, { title = toggle.name })
end
t()
end, { desc = "Toggle " .. toggle.name })
M.wk(lhs, toggle)
end
@ -41,8 +52,7 @@ function M.wk(lhs, toggle)
})
end
---@type lazyvim.Toggle
M.treesitter = {
M.treesitter = M.wrap({
name = "Treesitter Highlight",
get = function()
return vim.b.ts_highlight
@ -54,12 +64,11 @@ M.treesitter = {
vim.treesitter.stop()
end
end,
}
})
---@param buf? boolean
function M.format(buf)
---@type lazyvim.Toggle
local ret = {
return M.wrap({
name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")",
get = function()
if not buf then
@ -70,8 +79,7 @@ function M.format(buf)
set = function(state)
LazyVim.format.enable(state, buf)
end,
}
return ret
})
end
---@param opts? {values?: {[1]:any, [2]:any}, name?: string}
@ -80,8 +88,7 @@ function M.option(option, opts)
local name = opts.name or option
local on = opts.values and opts.values[2] or true
local off = opts.values and opts.values[1] or false
---@type lazyvim.Toggle
local ret = {
return M.wrap({
name = name,
get = function()
return vim.opt_local[option]:get() == on
@ -89,13 +96,11 @@ function M.option(option, opts)
set = function(state)
vim.opt_local[option] = state and on or off
end,
}
return ret
})
end
local nu = { number = true, relativenumber = true }
---@type lazyvim.Toggle
M.number = {
M.number = M.wrap({
name = "Line Numbers",
get = function()
return vim.opt_local.number:get() or vim.opt_local.relativenumber:get()
@ -110,19 +115,17 @@ M.number = {
vim.opt_local.relativenumber = false
end
end,
}
})
---@type lazyvim.Toggle
M.diagnostics = {
M.diagnostics = M.wrap({
name = "Diagnostics",
get = function()
return vim.diagnostic.is_enabled and vim.diagnostic.is_enabled()
end,
set = vim.diagnostic.enable,
}
})
---@type lazyvim.Toggle
M.inlay_hints = {
M.inlay_hints = M.wrap({
name = "Inlay Hints",
get = function()
return vim.lsp.inlay_hint.is_enabled({ bufnr = 0 })
@ -130,12 +133,11 @@ M.inlay_hints = {
set = function(state)
vim.lsp.inlay_hint.enable(state, { bufnr = 0 })
end,
}
})
---@type {k:string, v:any}[]
M._maximized = nil
---@type lazyvim.Toggle
M.maximize = {
M.maximize = M.wrap({
name = "Maximize",
get = function()
return M._maximized ~= nil
@ -170,7 +172,7 @@ M.maximize = {
vim.cmd("wincmd =")
end
end,
}
})
setmetatable(M, {
__call = function(m, ...)