Skip to content

Commit ec679bb

Browse files
committed
fix(nvim): preview git hunk with [directory] now works
1 parent 7edfe73 commit ec679bb

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ Neovim text objects + LSP whichkey + touchcursor keyboard layout + minimal zsh/y
341341
| `ctrl+;` | recent tab | wezterm |
342342
| `shift+space` | tmux-copy-mode-like | wezterm/windows-terminal |
343343
| `ctrl+shift+f` | find text | vscode/wezterm/windows-terminal |
344+
| `ctrl+plus` | zoom in | vscode/wezterm/windows-terminal |
345+
| `ctrl+minus` | zoom out | vscode/wezterm/windows-terminal |
344346

345347
</details>
346348

nvim/init.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,9 +830,9 @@ map({ "n" }, "J", "10gj")
830830
map({ "n" }, "K", "10gk")
831831
map({ "n" }, "H", "10h")
832832
map({ "n" }, "L", "10l")
833-
map({ "n" }, "Y", "yg_", { desc = "Yank forward" }) -- "Y" yank forward by default
833+
map({ "n" }, "Y", "yg_", { desc = "Yank forward" }) -- "Y" yank forward by default
834834
map({ "v" }, "Y", "g_y", { desc = "Yank forward" })
835-
map({ "v" }, "P", "g_P", { desc = "Paste forward" }) -- "P" doesn't change register
835+
map({ "v" }, "P", "g_P", { desc = "Paste forward" }) -- "P" doesn't change register
836836
map({ "v" }, "p", '"_c<c-r>+<esc>', { desc = "Paste (dot repeat)(register unchanged)" })
837837
map({ "n" }, "U", "@:", { desc = "repeat `:command`" }) --> :normal A,jkj --> :normal A,j --->  escape char by pression ctrl+v then escape
838838
map({ "v" }, "<", "<gv", { desc = "continious indent" })
@@ -1265,14 +1265,15 @@ if not vim.g.vscode then
12651265

12661266
require("snacks").picker.git_diff({
12671267
focus = "list",
1268+
layout = { preset = 'big_preview' },
12681269
on_show = function(picker)
12691270

12701271
local pos_index = {} -- { { 6, 3 }, { 19, 4 }, { 45, 5 }, { 55, 6 }, { 63, 7 } }
12711272
local jump = 1
12721273

12731274
-- fill pos_index
12741275
for index, item in ipairs(picker:items()) do
1275-
if item.text:match(curr_file) then
1276+
if (item.text == curr_file .. ":" .. item.pos[1]) then -- /[directory]/ also works
12761277
table.insert(pos_index, {item.pos[1], index})
12771278
end
12781279
end

0 commit comments

Comments
 (0)