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

vim for “Tex” files
YouCompleteMe unavailable: dlopen… (more in description)
powerline fonts doesn't work on vim/debian
tmux vim display issue on parenthesis
Changing cursor background when highlighting text
Vim “paste once” without update of undo
syntax.vim file is missing
how do I make x11/xQuartz stop opening up
Keyword in Vim syntax region pattern
Error with colorscheme genereated by vivify
vim - I'm looking for plugin what adds tabulation inside block
How can I enable mouse control in vim of homebrew?
gvim: Colour lines differently containing TODO/HACK/etc?
set expandtab in .vimrc not taking effect
Block editing of text before given column in Vim
Vim's errorformat is ignored

Categories

HOME
java
vim
date
clips
proxy
tizen
dictionary
reserved
mfc
fft
relay
bookshelf.js
adb
rdf
fsm
yum
append
session-variables
imacros
circular-dependency
django-admin
reactcsstransitiongroup
sms-gateway
jqwidget
contextmenu
karma-jasmine
grails3
php-openssl
dxf
sqlcipher
cas
bootstrap-duallistbox
fifo
ping
dbclient
facebook-apps
objectanimator
tasklet
gsoap
lightswitch-2013
socialengine
textmate
android-nestedscrollview
dosbox
git-merge
serve
qwerty
web-mining
android-browser
service-discovery
ansible-playbook
unoconv
turbogears
node-sass
eclipse-gef
auto-update
menuitem
revapi
idisposable
yii2-extension
jxcore
sqlclient
flutterwave
nxt
grails-tomcat-plugin
log4c
dstu2-fhir
intrusion-detection
pcf
autorest
fputcsv
iad
maven-tomcat-plugin
ami
xc16
tablelayout
javafx-webengine
asp.net-web-api-odata
issuu
document-classification
php-5.4
mysql-error-1062
xceed-datagrid
didselectrowatindexpath
commoncrypto
ftps
dotnetnuke-5
type-equivalence
flashvars
factory-method
runas
postgresql-performance
pendrive
joyent
locationlistener
javax.script
appendto
android-sdk-2.1
sortable-tables
kdbg
nerddinner
sector
gacutil
ubuntu-9.04
3gp

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile