nvim: Add punctuation-based undo breakpoints
This commit is contained in:
parent
ea7fcd92f5
commit
e3f123c080
1 changed files with 5 additions and 0 deletions
|
@ -50,6 +50,11 @@ map('n', '<Tab>', '%')
|
||||||
map('i', '<C-u>', '<esc>gUiw`]a')
|
map('i', '<C-u>', '<esc>gUiw`]a')
|
||||||
map('i', '<C-y>', '<esc>guiw`]a')
|
map('i', '<C-y>', '<esc>guiw`]a')
|
||||||
|
|
||||||
|
-- Add undo break-points at punctuations for plaintext editing
|
||||||
|
for _, char in pairs({ ",", ".", ";", "?", "!" }) do
|
||||||
|
map("i", char, string.format("%s<c-g>u", char))
|
||||||
|
end
|
||||||
|
|
||||||
-- yank current filename/filepath to f buffer
|
-- yank current filename/filepath to f buffer
|
||||||
map('n', 'yp', ':let @p = expand("%")<Cr>', { desc = 'yank filename' })
|
map('n', 'yp', ':let @p = expand("%")<Cr>', { desc = 'yank filename' })
|
||||||
map('n', 'yP', ':let @p = expand("%:p")<Cr>', { desc = 'yank filepath' })
|
map('n', 'yP', ':let @p = expand("%:p")<Cr>', { desc = 'yank filepath' })
|
||||||
|
|
Loading…
Reference in a new issue