Closed fdietze closed 9 years ago
Hi, I don't understand from the docs how to use vim-repeat with my own function. What I came up with is not working:
function! ToggleEndChar(charToMatch) let save_cursor = getpos(".") " backup cursor s/\v(.)$/\=submatch(1)==a:charToMatch ? '' : submatch(1).a:charToMatch call setpos('.', save_cursor) " restore cursor endfunction nnoremap <silent> <Leader>, :call ToggleEndChar(',')<CR>\ silent! call repeat#set("ToggleEndChar(',')<CR>", -1)
What am I doing wrong?
You need to call repeat#set in the function, and you need to give it a valid Vim map (not just a function invocation).
Hi, I don't understand from the docs how to use vim-repeat with my own function. What I came up with is not working:
What am I doing wrong?