💤 LazyGit and Gists

- Implement LazyGit and integrate with UI
- Implement Gists:
  - Create Gist from file or selection
  - Find existing gists and open them for editing
This commit is contained in:
2024-07-09 09:26:46 -04:00
parent 84f12e6524
commit 64715b251f
4 changed files with 114 additions and 55 deletions
+22
View File
@@ -1,6 +1,28 @@
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- -------------------------------- KEYBINDS ----------------------------------- -- -------------------------------- KEYBINDS -----------------------------------
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Leader Maps
local wk = require("which-key")
wk.register({
["<leader>"] = {
l = {
name = "󰒲 Lazy",
v = { "<cmd>Lazy<cr>", "󰒲 LazyVim" },
x = { "<cmd>LazyExtras<cr>", " LazyExtras" },
},
g = {
name = " Git",
S = { "<cmd>LazyGit<cr>", " LazyGit" },
n = {
name = " Gists",
c = { "<cmd>GistCreate<cr>", " Create Gist" },
f = { "<cmd>GistList<cr>", "󰮗 Find Gists" },
},
},
},
})
-- Make :Q close all of the buffers -- Make :Q close all of the buffers
vim.api.nvim_create_user_command("Q", function() vim.api.nvim_create_user_command("Q", function()
vim.cmd.bdelete() vim.cmd.bdelete()
+2 -1
View File
@@ -1,4 +1,3 @@
return { return {
"nvimdev/dashboard-nvim", "nvimdev/dashboard-nvim",
lazy = false, lazy = false,
@@ -54,6 +53,7 @@ return {
{ action = "ene | startinsert", desc = " New File", icon = "", key = "n" }, { action = "ene | startinsert", desc = " New File", icon = "", key = "n" },
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "", key = "r" }, { action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = "", key = "r" },
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "", key = "g" }, { action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = "", key = "g" },
{ action = "LazyGit", desc = " LazyGit", icon = "", key = "G" },
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "", key = "c" }, { action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = "", key = "c" },
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" }, { action = 'lua require("persistence").load()', desc = " Restore Session", icon = "", key = "s" },
{ action = 'RemoteStart', desc = " Remote Session", icon = "󰢹 ", key = "v" }, { action = 'RemoteStart', desc = " Remote Session", icon = "󰢹 ", key = "v" },
@@ -95,3 +95,4 @@ return {
return opts return opts
end, end,
} }
+17
View File
@@ -0,0 +1,17 @@
return {
{
"Rawnly/gist.nvim",
cmd = { "GistCreate", "GistCreateFromFile", "GistsList" },
config = true,
},
-- `GistsList` opens the selected gif in a terminal buffer,
-- nvim-unception uses neovim remote rpc functionality to open the gist in an actual buffer
-- and prevents neovim buffer inception
{
"samjwill/nvim-unception",
lazy = false,
init = function()
vim.g.unception_block_while_host_edits = true
end,
},
}
+19
View File
@@ -0,0 +1,19 @@
return {
"kdheepak/lazygit.nvim",
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = " LazyGit" },
},
}