Skip to content

[FR] support for tpope's vim-repeat #4

@auwsmit

Description

@auwsmit

This would be a pretty minor improvement since you can already use macros and @: + @@to repeat the plugin command, but it would still be nice to be able to repeat with dot and it would be very simple to add. I'll make the PR if you want.

In case anyone sees this and wants this functionality now, as well as a short way to define maps for all the commands, you can use this snippet:

let map_prefix = '<Space>~'
let maps = ['~',    'c',     'b',      'k',     's']
let cmds = ['Snek', 'Camel', 'CamelB', 'Kebab', 'Screm']

for i in range(0,len(maps)-1)
  exec 'noremap <silent> <Plug>('.cmds[i].'Case) :'.cmds[i].'<CR>'.
        \ ':silent! call repeat#set("\<Plug>('.cmds[i].'Case)", v:count)<CR>'
  exec 'noremap '.map_prefix.maps[i].' <Plug>('.cmds[i].'Case)'
endfor
" don't switch case if the mapping times out
exec 'noremap '.map_prefix.' <NOP>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions