In order to switch between relative and absolute line numbering upon entering command-line, I noremap <expr> <CR>
to "someStuff"
.
Unfortunately this breaks the foldopen
-ing feature for forward searches.
It already happens with the following line
cnoremap <CR> <CR>
MWE
entire .vimrc
set foldmethod=marker
"default foldopen
set foldopen=block,hor,mark,percent,quickfix,search,tag,undo
cnoremap <CR> <CR>
text file
{{{
lkj
}}}
maneuver : normal-mode-type /lkj<CR>
and the fold does not open
comment the cnoremap
reload and do the same, the fold does open
Attempts
I somewhat managed to walk around the issue with a silly hack such as :
cnoremap <CR> <CR>i<C-c>
unfortunately this breaks the repeat (.)
history.
The following works :
cnoremap <CR> <CR>mf.u`f
except at the opening of a vim session, when the .
repeat does nothing.
Is there some way to achieve the cnoremap
ping <CR> <CR>
in a fully transparent way ?