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.
How do I create a Vim function-list inside quick-fix window?
How to filter out files by extension in NERDTree?
vim “modifiable” is off
vim TagList only generate tags in the Ctags58 folder
Vim gets unresponsive when toggling NERDTREE
Change vim concealed text font size
Making NERDTree work 'as expected'
Is there an Vim/MacVim equivalent for TextMate's Find in Project?
vim nerd tree plugin and dvorak keyboard layout
vim: `:q` instead of `:bdelete` when only one buffer listed
Is there a way to shift the screen 20 rows, but keep the cursor in the same position?
In VIM, what do the letters and codes mean on the other, unfocused tabs (e.g. \S\r\b\m\filename.txt)
Are these features possible in Macvim?
Multi-line Highlight in Vim
Vim and Latex-Suite
Auto-reload browser when I save changes to html file, in Chrome?