nvim: Add punctuation-based undo breakpoints

This commit is contained in:
Marty Oehme 2023-03-01 14:35:04 +01:00
parent ea7fcd92f5
commit e3f123c080
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -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' })