how to

quick-line-jumps

Jan 15, 2024
softwares-and-toolsneovim
1 Minutes
131 Words

https://github.com/Houl/repmo-vim/tree/master

put this autoload in your nvim autoload

and paste stuffs like

1
" map a motion and its reverse motion:
2
:noremap <expr> h repmo#SelfKey('h', 'l')|sunmap h
3
:noremap <expr> l repmo#SelfKey('l', 'h')|sunmap l
4
5
" if you like `:noremap j gj', you can keep that:
6
:map <expr> j repmo#Key('gj', 'gk')|sunmap j
7
:map <expr> k repmo#Key('gk', 'gj')|sunmap k
8
9
" repeat the last [count]motion or the last zap-key:
10
:map <expr> ; repmo#LastKey(';')|sunmap ;
11
:map <expr> , repmo#LastRevKey(',')|sunmap ,
12
13
" add these mappings when repeating with `;' or `,':
14
:noremap <expr> f repmo#ZapKey('f')|sunmap f
15
:noremap <expr> F repmo#ZapKey('F')|sunmap F
5 collapsed lines
16
:noremap <expr> t repmo#ZapKey('t')|sunmap t
17
:noremap <expr> T repmo#ZapKey('T')|sunmap T
18
19
" 只记忆 count jumps
20
:let g:repmo_require_count = 1

in your init.vim.

Usage

5j;;;;hjkl;;;

It will remember 5j, not one of hjkl.

just kidding, although https://www.vim.org/scripts/script.php?script_id=2174 says so, it doesn’t seem to work now.

Article title:quick-line-jumps
Article author:Julyfun
Release time:Jan 15, 2024
Copyright 2025
Sitemap