mirror of
https://github.com/jdhao/nvim-config.git
synced 2025-06-08 14:14:33 +02:00
Compare commits
2 Commits
e7f504a5cb
...
ffa7da3773
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ffa7da3773 | ||
|
|
2f8482639d |
@ -170,7 +170,7 @@ keymap.set("n", "<Down>", "<C-W>j")
|
|||||||
keymap.set({ "x", "o" }, "iu", "<cmd>call text_obj#URL()<cr>", { desc = "URL text object" })
|
keymap.set({ "x", "o" }, "iu", "<cmd>call text_obj#URL()<cr>", { desc = "URL text object" })
|
||||||
|
|
||||||
-- Text objects for entire buffer
|
-- Text objects for entire buffer
|
||||||
keymap.set({ "x", "o" }, "iB", "<cmd>call text_obj#Buffer()<cr>", { desc = "buffer text object" })
|
keymap.set({ "x", "o" }, "iB", ":<C-U>call text_obj#Buffer()<cr>", { desc = "buffer text object" })
|
||||||
|
|
||||||
-- Do not move my cursor when joining lines.
|
-- Do not move my cursor when joining lines.
|
||||||
keymap.set("n", "J", function()
|
keymap.set("n", "J", function()
|
||||||
@ -179,17 +179,17 @@ keymap.set("n", "J", function()
|
|||||||
delmarks z
|
delmarks z
|
||||||
]])
|
]])
|
||||||
end, {
|
end, {
|
||||||
desc = "join line",
|
desc = "join lines without moving cursor",
|
||||||
})
|
})
|
||||||
|
|
||||||
keymap.set("n", "gJ", function()
|
keymap.set("n", "gJ", function()
|
||||||
-- we must use `normal!`, otherwise it will trigger recursive mapping
|
-- we must use `normal!`, otherwise it will trigger recursive mapping
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
normal! zmgJ`z
|
normal! mzgJ`z
|
||||||
delmarks z
|
delmarks z
|
||||||
]])
|
]])
|
||||||
end, {
|
end, {
|
||||||
desc = "join visual lines",
|
desc = "join lines without moving cursor",
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Break inserted text into smaller undo units when we insert some punctuation chars.
|
-- Break inserted text into smaller undo units when we insert some punctuation chars.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user