chore: back to fugitive

This commit is contained in:
Mariano Z. 2025-03-28 20:33:57 -03:00
parent cd71c6519e
commit 867159343a
Signed by: marianozunino
GPG key ID: 4C73BAD25156DACE
10 changed files with 107 additions and 130 deletions

View file

@ -1,40 +1,29 @@
local M = {
"monkoose/neocodeium",
cmd = "NeoCodeium",
"Exafunction/codeium.vim",
cmd = "Codeium",
keys = {
{ "<leader>ce", "<cmd>NeoCodeium toggle<cr>", desc = "Codeium Enable" },
{ "<leader>ce", "<cmd>Codeium Toggle<cr>", desc = "Codeium Enable" },
},
}
M.config = function()
local neocodeium = require("neocodeium")
local blink = require("blink.cmp")
neocodeium.setup()
vim.api.nvim_create_autocmd("User", {
pattern = "BlinkCmpMenuOpen",
callback = function()
neocodeium.clear()
end,
})
neocodeium.setup({
filter = function()
return not blink.is_visible()
end,
})
vim.g.codeium_disable_bindings = 1
imap("<Tab>", neocodeium.accept, { expr = true, silent = true, desc = "[codeium] Accept completion" })
imap("<C-g>", function()
return vim.fn["codeium#Accept"]()
end, { expr = true, silent = true, desc = "[codeium] Accept completion" })
imap("<M-;>", function()
return neocodeium.cycle(1)
return vim.fn["codeium#CycleCompletions"](1)
end, { expr = true, silent = true, desc = "[codeium] Cycle completions" })
imap("<M-,>", function()
return neocodeium.cycle(-1)
return vim.fn["codeium#CycleCompletions"](-1)
end, { expr = true, silent = true, desc = "[codeium] Cycle completions" })
imap("<c-x>", function()
return vim.fn["codeium#Clear"]()
end, { expr = true, silent = true, desc = "[codeium] Clear" })
end
return M

View file

@ -1,41 +1,31 @@
return {
{
"alker0/chezmoi.vim",
lazy = false,
init = function()
-- This option is required.
vim.g["chezmoi#use_tmp_buffer"] = true
end,
},
{
"xvzc/chezmoi.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("chezmoi").setup({
-- your configurations
edit = {
watch = true, -- Set true to automatically apply on save.
force = true, -- Set true to force apply. Works only when watch = true.
},
notification = {
on_open = true, -- vim.notify when start editing chezmoi-managed file.
on_apply = true, -- vim.notify on apply.
},
})
"xvzc/chezmoi.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("chezmoi").setup({
-- your configurations
edit = {
watch = true, -- Set true to automatically apply on save.
force = true, -- Set true to force apply. Works only when watch = true.
},
notification = {
on_open = true, -- vim.notify when start editing chezmoi-managed file.
on_apply = true, -- vim.notify on apply.
},
})
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
callback = function()
-- invoke with vim.schedule() for better startup time
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
callback = function()
-- invoke with vim.schedule() for better startup time
vim.schedule(require("chezmoi.commands.__edit").watch)
end,
})
-- Auto-apply chezmoi changes
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
command = [[silent! !chezmoi apply --source-path "%"]],
})
end,
},
-- Auto-apply chezmoi changes
vim.api.nvim_create_autocmd("BufWritePost", {
pattern = { os.getenv("HOME") .. "/.local/share/chezmoi/*" },
command = [[silent! !chezmoi apply --source-path "%"]],
})
end,
}

View file

@ -1,6 +1,7 @@
local M = {
"saghen/blink.cmp",
dependencies = { "L3MON4D3/LuaSnip", version = "v2.*" },
version = "v1.*",
}
@ -18,7 +19,6 @@ M.config = function()
["<C-k>"] = { "select_prev", "fallback" },
["<C-j>"] = { "select_next", "fallback" },
["<Tab>"] = { "fallback" },
},
appearance = {

View file

@ -2,10 +2,47 @@ local M = {
{
"tpope/vim-fugitive",
config = function()
print("Magic")
-- For init.lua
local git_status = function()
local bufnr = vim.api.nvim_get_current_buf()
if vim.b[bufnr].fugitive_status then
local winnr = vim.fn.bufwinid(bufnr)
vim.api.nvim_win_close(winnr, true)
else
vim.cmd("G")
end
end
vim.g.fugitive_git_executable = "env GPG_TTY=$(tty) git"
vim.env.GPG_TTY = vim.fn.system("tty"):gsub("\n", "")
nmap("<leader>lg", ":G<cr>", { desc = "Git Status" })
nmap("<leader>gs", git_status, { desc = "Toggle Git Status" })
nmap("gs", git_status, { desc = "Toggle Git Status" })
vim.api.nvim_create_autocmd("FileType", {
pattern = { "fugitive", "fugitiveblame", "fugitive-status" },
callback = function()
nmap("P", function()
local cmd = "git push --force-with-lease"
vim.notify("Pushing...", vim.log.levels.INFO)
vim.fn.jobstart(cmd, {
on_exit = function(_, code)
if code == 0 then
vim.notify("Push completed successfully", vim.log.levels.INFO)
else
vim.notify("Push failed with exit code: " .. code, vim.log.levels.ERROR)
end
end,
detach = true,
})
end, { buffer = true, desc = "Git Push Force With Lease (Async)" })
nmap("<C-c>", function()
local win_id = vim.api.nvim_get_current_win()
vim.api.nvim_win_close(win_id, false)
end, { buffer = true, desc = "Close window" })
end,
})
end,
},
{

View file

@ -1,34 +0,0 @@
local M = {
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
},
}
M.config = function()
local harpoon = require("harpoon")
harpoon:setup({
settings = {
save_on_toggle = true,
sync_on_ui_close = true,
},
})
nmap("<leader>a", function()
harpoon:list():add()
end, { desc = "Harpoon: Append" })
nmap("<leader>h", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = "Harpoon: Toggle Quick Menu" })
for i = 1, 4 do
nmap("<leader>" .. i, function()
harpoon:list():select(i)
end, { desc = "Harpoon: Select " .. i })
end
end
return M

View file

@ -1,15 +0,0 @@
local M = {
"nvimdev/lspsaga.nvim",
}
M.config = function()
require("lspsaga").setup({
lightbulb = {
enable = false,
},
})
nmap("K", "<cmd>Lspsaga hover_doc<cr>")
nmap("pd", "<cmd>Lspsaga peek_definition<cr>")
end
return M

View file

@ -4,7 +4,6 @@ local M = {
"saghen/blink.cmp",
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
require("plugins.lsp.extras.context"),
require("plugins.lsp.extras.lazydev"),
require("plugins.lsp.extras.gopher"),
require("plugins.lsp.extras.typescript"),

View file

@ -1,16 +1,17 @@
return {
"marianozunino/presenterm.nvim",
dir = "/home/forbi/Dev/marianozunino/presenterm.nvim",
config = function()
require("presenterm").setup({
patterns = {
"*.presenterm",
"*.pterm",
"*.md",
},
auto_launch = true,
terminal_cmd = "kitty --title 'Presenterm: {title}' --override font_size=18 {cmd}",
})
nmap("<leader>pl", ":PresentermLaunch<cr>", { desc = "[Presenterm] Launch" })
nmap("<leader>ps", ":PresentermStop<cr>", { desc = "[Presenterm] Stop" })
end,
}