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.
why \r\n displayed as ^M in vi? [duplicate]
Multiline search/replace in Vim without escaping
w / b in vim is including . in the word
How do I use tcomment (vim's plugin) and how do can I say it is installed?
Vim - close autocomplete menu and go to normal mode when pressing ESC
node-jslint with Syntastic in vim on Cygwin only display partial errors
How can I set a global syntax rule that takes precedent over a file specific one?
Reset Vim Window switching shortcut in Python Mode
Command for putting backticks around the current word
Vim, setting .el folding has killed syntax highlighting
Creating a generic command to edit and quickly execute (python) scripts
Vim: How do I see whether a command is switched on?
How do I prevent changing buffer when using the :bufdo command?
Why does vim not recognize comments after non-whitespace characters? How can this be resolved?
Vim: executing a visual command on startup
Vim - how to exclude part of clipboard register when pasting