vim


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.

Related Links

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

Categories

HOME
oracle11g
activiti
isabelle
routes
spring-jdbc
ezpublish
wamp
flyway4
indesign
django-imagekit
dacpac
facebook-php-sdk
reveal.js
kentor-authservices
timeout
leiningen
visual-studio-2005
quickfix
serverless-framework
ef-migrations
ab-testing
oracle-coherence
sms-gateway
excel-vba-mac
django-cms
immutable.js
conemu
paging
facebook-instant-articles
google-search-api
mustache.php
opennlp
facet
nhapi
log4js-node
dbclient
r-raster
lightswitch-2013
data-manipulation
exuberant-ctags
oracle-fusion-middleware
caret
stringtemplate
scaffold
hot-module-replacement
streamreader
user-controls
unoconv
email-templates
jvm-languages
spring-security-kerberos
midl
wso2carbon
avconv
theming
rails-routing
mu
togetherjs
recursive-datastructures
diagnostics
kbuild
r-forge
abcpdf9
deadbolt-2
etsy
firebaseui
pagedlist
bgp
yaws
ora-00900
jqgrid-formatter
angular-leaflet-directive
truevault
google-style-guide
android-imagebutton
googlemock
article
typeof
contenttype
mechanize-ruby
ember-charts
centos5
mysqltuner
cdc
aqtime
ruby-datamapper
jquery-mobile-dialog
wsdl-2.0
gil
mt
pysimplesoap
php-parser
django-tagging
xdomainrequest
winbugs14
floating
subviews
web-application-design
backcolor
nerddinner
aquaticprime
port-number
scripting-languages
post-build
lzh

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App