chg: Make ,o and ,O repeatable

This commit is contained in:
Sayantan Santra 2024-03-28 04:03:05 -05:00
parent 3529b19864
commit bf01840904
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
3 changed files with 9 additions and 9 deletions

View file

@ -24,8 +24,8 @@ map('n', '<leader>D', '"_D', { remap = false })
map('n', '<leader>x', '"_x', { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":call append(line('.'), '')<cr>", { remap = false })
map('n', '<leader>O', ":call append(line('.')-1, '')<cr>", { remap = false })
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })
-- Use ,u for redo
map('n', '<leader>u', "<c-r>", { remap = false })
@ -45,4 +45,4 @@ map('n', '<leader>S', ":x<cr>", { remap = false })
map('n', '<Esc>', ':noh<cr>', { remap = false })
-- Find files using fzf by ,f
vim.keymap.set('n', '<leader>f', ':Files<cr>', { remap = false, silent = true })
vim.keymap.set('n', '<leader>f', ':Files<cr>', { remap = false })

View file

@ -12,9 +12,9 @@ map({ 'v', 'n' }, '<leader>d', '"_d', { remap = false })
map('n', '<leader>D', '"_D', { remap = false })
map('n', '<leader>x', '"_x', { remap = false })
-- Insert a newline in normal mode by ,o
map('n', '<leader>o', ":call append(line('.'), '')<cr>", { remap = false })
map('n', '<leader>O', ":call append(line('.')-1, '')<cr>", { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })
-- Use ,u for redo
map('n', '<leader>u', "<c-r>", { remap = false })

View file

@ -11,9 +11,9 @@ map({ 'v', 'n' }, '<leader>d', '"_d', { remap = false })
map('n', '<leader>D', '"_D', { remap = false })
map('n', '<leader>x', '"_x', { remap = false })
-- Insert a newline in normal mode by ,o
map('n', '<leader>o', ":call append(line('.'), '')<cr>", { remap = false })
map('n', '<leader>O', ":call append(line('.')-1, '')<cr>", { remap = false })
-- Insert a newline in normal mode by ,o and ,O
map('n', '<leader>o', ":<c-u>call append(line('.'), repeat([''], v:count1))<cr>", { remap = false })
map('n', '<leader>O', ":<c-u>call append(line('.')-1, repeat([''], v:count1))<cr>", { remap = false })
-- Use ,u for redo
map('n', '<leader>u', "<c-r>", { remap = false })