💤 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:
@@ -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()
|
||||||
|
|||||||
@@ -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,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -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" },
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user