Compare commits
No commits in common. "8db95ade2689cbfe306678a28b2cc5cf2565ee09" and "ae54f5b6dca3137ec0f1288090ac6a08db7d7e5f" have entirely different histories.
8db95ade26
...
ae54f5b6dc
@ -115,22 +115,15 @@ end
|
||||
require("which-key").add({
|
||||
-- { "<leader>g", group = "Git" },
|
||||
{ "<leader>gvf", diffOpenFileHistory, desc = "Open DiffView on Files" },
|
||||
{ "<leader>gvt", command("DiffviewToggleFiles"), desc = "toggle diffviewfiles" },
|
||||
{ "<leader>gvc", command("DiffviewClose"), desc = "Open DiffView on Files" },
|
||||
{
|
||||
"<leader>gvh",
|
||||
function()
|
||||
print("gvf with . opens commit wise history of entire codebase.")
|
||||
print("gvf with % opens commit wise history of current file.")
|
||||
print("gvf with <any file path> opens commit wise history of that file.")
|
||||
print("gvo with HEAD opens diff of latest commit.")
|
||||
print("gvo with HEAD~3 opens diff of last 3 commits.")
|
||||
print("gvo with master..HEAD opens changes of your feature branch.")
|
||||
end,
|
||||
desc = "gvo help",
|
||||
},
|
||||
{ "<leader>gt", command("DiffviewToggleFiles"), desc = "Open DiffView on Files" },
|
||||
{ "<leader>gvo", diffOpenWithInput, desc = "Open DiffView" },
|
||||
})
|
||||
-- diffOpenFileHistory with . opens commit wise history of entire codebase.
|
||||
-- diffOpenFileHistory with % opens commit wise history of current file.
|
||||
-- diffOpenFileHistory with <any file path> opens commit wise history of that file.
|
||||
-- diffOpenWithInput with HEAD opens diff of latest commit.
|
||||
-- diffOpenWithInput with HEAD~3 opens diff of last 3 commits.
|
||||
-- diffOpenWithInput with master..HEAD opens changes of your feature branch.
|
||||
--
|
||||
--
|
||||
vim.api.nvim_set_keymap("c", "<C-j>", "<Down>", { noremap = true, silent = true })
|
||||
|
||||
@ -482,4 +482,61 @@ return {
|
||||
"sindrets/diffview.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
untracked = { text = "▎" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "▎" },
|
||||
change = { text = "▎" },
|
||||
delete = { text = "" },
|
||||
topdelete = { text = "" },
|
||||
changedelete = { text = "▎" },
|
||||
},
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "]h", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "]c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("next")
|
||||
end
|
||||
end, "Next Hunk")
|
||||
map("n", "[h", function()
|
||||
if vim.wo.diff then
|
||||
vim.cmd.normal({ "[c", bang = true })
|
||||
else
|
||||
gs.nav_hunk("prev")
|
||||
end
|
||||
end, "Prev Hunk")
|
||||
map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk")
|
||||
map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk")
|
||||
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
|
||||
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
|
||||
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
|
||||
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
|
||||
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
|
||||
map("n", "<leader>ghp", gs.preview_hunk_inline, "Preview Hunk Inline")
|
||||
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
|
||||
map("n", "<leader>ghB", function() gs.blame() end, "Blame Buffer")
|
||||
map("n", "<leader>ghd", gs.diffthis, "Diff This")
|
||||
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,11 +0,0 @@
|
||||
hs.hotkey.bind({ "cmd" }, "\\", function()
|
||||
hs.application.launchOrFocus("Terminal")
|
||||
hs.timer.doAfter(0.1, function()
|
||||
hs.osascript.applescript([[
|
||||
tell application "Terminal"
|
||||
do script "tmux" in front window
|
||||
do script "tmux-td" in front window
|
||||
end tell
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
# Check if Zsh is available
|
||||
if command -v zsh >/dev/null 2>&1; then
|
||||
zsh ~/git/configs/scripts/tmux-td-zsh
|
||||
zsh scripts/tmux-td-zsh
|
||||
else
|
||||
bash ~/git/configs/scripts/tmux-td-bash
|
||||
bash scripts/tmux-td-bash
|
||||
fi
|
||||
|
||||
@ -8,28 +8,6 @@ fi
|
||||
if [[ "$(tmux display-message -p -F "#{session_name}")" == "td-cli" ]]; then
|
||||
tmux detach-client
|
||||
tmux display-popup -C
|
||||
osascript <<EOF
|
||||
tell application "System Events"
|
||||
set frontApp to name of first application process whose frontmost is true
|
||||
end tell
|
||||
|
||||
if frontApp is "Terminal" then
|
||||
tell application "Terminal"
|
||||
activate
|
||||
delay 0.1
|
||||
tell application "System Events"
|
||||
keystroke "x" using control down -- Send Ctrl + x (tmux prefix)
|
||||
delay 0.1
|
||||
keystroke ":kill-session"
|
||||
key code 36 -- Press Enter to execute :detach
|
||||
delay 0.2
|
||||
keystroke "exit"
|
||||
key code 36 -- Press Enter to execute exit
|
||||
end tell
|
||||
end tell
|
||||
end if
|
||||
EOF
|
||||
osascript -e 'tell application "Terminal" to quit'
|
||||
else
|
||||
tmux display-popup -d -C -E -w90% -h90% 'tmux attach-session -x -f wait-exit -t td-cli'
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user