I little bit dig into documentation, and found that I can run user-scripts, so I wrote follow script:
#!/usr/bin/env python3
import os
import sys
cur = sys.argv[1]
for path, dirs, files in os.walk(cur):
if len(dirs) > 1 or len(files) > 0:
print(path)
break
else:
print(cur)
And put it into ~/.config/vifm/scripts
.
After that, I add a new user command:
:com! jmp :execute 'cd' system('cd ~/.config/vifm/scripts && ./dirsjump.py')
And then, map it to <space>
(I want ctrl+right
, but not found how to do that):
:nmap <space> :jmp<cr>
Seems, all work perfectly. Thank you.