Is there a way to accept [count] in custom maps like [N]gt? In vim v:count and v:count1 can be used to achieve this. However in vifm I get No Range Allowed error.
I am trying to create bindings that jumps to the Nth last/first modified file in the directory.
nnoremap <silent> gn :exe 'goto' fnameescape(system('ls -Atp ' . expand('%d') . ' | grep -vm' . v:count1 . ' / | tail -n 1'))<CR>
nnoremap <silent> gN :exe 'goto' fnameescape(system('ls -Artp ' . expand('%d') . ' | grep -vm' . v:count1 . ' / | tail -n 1'))<CR>
An example of this used in vim is given below:
def JumpToBuffer(bufnr: number, rev: bool = v:false)
if rev
if bufnr == 0
bprevious!
else
exec $":{bufnr}bprevious!"
endif
else
if bufnr == 0
bnext!
else
if !bufnr->bufexists()
return
else
exec $'buffer! {bufnr}'
endif
endif
endif
enddef
nnoremap <silent> gb :<C-U>call <SID>JumpToBuffer(v:count)<CR>
nnoremap <silent> gB :<C-U>call <SID>JumpToBuffer(v:count, v:true)<CR>