mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'LazyVim:main' into main
This commit is contained in:
commit
9f8e3105b7
4 changed files with 25 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 March 29
|
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 April 11
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
Table of Contents *LazyVim-table-of-contents*
|
Table of Contents *LazyVim-table-of-contents*
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ map("n", "<leader>ub", function() LazyVim.toggle("background", false, {"light",
|
||||||
-- lazygit
|
-- lazygit
|
||||||
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
map("n", "<leader>gg", function() LazyVim.lazygit( { cwd = LazyVim.root.git() }) end, { desc = "Lazygit (Root Dir)" })
|
||||||
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
map("n", "<leader>gG", function() LazyVim.lazygit() end, { desc = "Lazygit (cwd)" })
|
||||||
|
map("n", "<leader>gb", LazyVim.lazygit.blame_line, { desc = "Git Blame Line" })
|
||||||
|
|
||||||
map("n", "<leader>gf", function()
|
map("n", "<leader>gf", function()
|
||||||
local git_path = vim.api.nvim_buf_get_name(0)
|
local git_path = vim.api.nvim_buf_get_name(0)
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,11 @@ return {
|
||||||
{
|
{
|
||||||
"echasnovski/mini.pairs",
|
"echasnovski/mini.pairs",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {},
|
opts = {
|
||||||
|
mappings = {
|
||||||
|
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^\\`].", register = { cr = false } },
|
||||||
|
},
|
||||||
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
"<leader>up",
|
"<leader>up",
|
||||||
|
|
|
||||||
|
|
@ -140,4 +140,22 @@ gui:
|
||||||
M.dirty = false
|
M.dirty = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param opts? {count?: number}|LazyCmdOptions
|
||||||
|
function M.blame_line(opts)
|
||||||
|
opts = vim.tbl_deep_extend("force", {
|
||||||
|
count = 3,
|
||||||
|
filetype = "git",
|
||||||
|
size = {
|
||||||
|
width = 0.6,
|
||||||
|
height = 0.6,
|
||||||
|
},
|
||||||
|
border = "rounded",
|
||||||
|
}, opts or {})
|
||||||
|
local cursor = vim.api.nvim_win_get_cursor(0)
|
||||||
|
local line = cursor[1] - 1
|
||||||
|
local file = vim.api.nvim_buf_get_name(0)
|
||||||
|
local cmd = { "git", "log", "-n", opts.count, "-u", "-L", line .. ",+1:" .. file }
|
||||||
|
return require("lazy.util").float_cmd(cmd, opts)
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue