how to set a count before a noremap?
alxndr opened this issue · comments
Alexander Quine commented
e.g. in Vimscript:
nnoremap <expr> <C-d> (winheight(0) / 3) . '<C-d>'
nnoremap <expr> <C-u> (winheight(0) / 3) . '<C-u>'
from https://neovim.discourse.group/t/how-to-make-ctrl-d-and-ctrl-u-scroll-1-3-of-window-height/859/2
Iron-E commented
I'm not sure what you mean by setting a count to noremap
, because I've never seen 3noremap
or something like that.
But if you want to translate those mappings you can use:
local nnoremap = require('cartographer').n.nore.expr
nnoremap['<C-u>'] = "(winheight(0) / 3) . '<C-u>'"
Alexander Quine commented
Aha, I was missing that I needed to use expr
, thank you!