Vim - Issue calling repeat#set from function on nomodifiable file
I'm using Tim Pope's repeat.vim plugin and am having some trouble invoking repeat#set correctly. I want to create two mappings for quickly navigating between sections of a help doc, which are delineated by rows of equals signs. My function for going to the next section below works and is repeatable. function! s:NextHelpSection() execute "normal /^===\<CR>" nohlsearch normal zt endfunction nnoremap <buffer> <silent> <LocalLeader>n \ :<C-u>call <SID>NextHelpSection()<CR> \:<C-u>call repeat#set("\<LocalLeader>n")<CR> My function for going to the previous section works on its own but fails when I try to repeat it with E21: Cannot make changes, 'modifiable' is off. function! s:PrevHelpSection() execute "normal ?^===\<CR>" nohlsearch normal zt call repeat#set("\<LocalLeader>p") endfunction nnoremap <buffer> <silent> <LocalLeader>p :<C-u>call <SID>PrevHelpSection()<CR> The difference between the two is just where I call repeat#set, whether it's inside the function or afterwards. Why should this matter? Why would this second version fail? It's cleaner, so I'd prefer to write it this way if possible.
search and Replace in specific pattern using VIM
In terminal - show ouput in new vim buffer
How to start/uninstall eddie-vim?
vim autocmd hook after performing a search in the text?
Map key to itself and another key without overwriting the previous mapping of the key
Setting default number of lines Vim displays
Vim setting for a particular extension
Get the :make argument from a compiler script
What are those many '#' characters seen in a log file from vim?
Open a buffer on a new Tab on Vim
vim command for adding Parentheses efficiently
How do I get Vim to source my .vimrc directly?
Vim not detecting implicit newline characters instead of visible newline characters I am trying to strip
passing argument to a vim “execute”
Vim Wrong Indent When There Is Dash - in Html Tag
Thin cursor in console vim