Mind
A Header is a Section: A Document is divided into many sections by Markdown Header. so we need move cursor among the sections. neither j
/k
move line by line, nor H
/M
/L
move screen by screen;
we need move section by section. so, I write this little project. maybe it can help you, too.
Let we move easily and freely through a markdown document.
HMLjk.vim is inspired by vim
H
M
L
key function.
理念
标题即区间: 标记标题将一篇文档 分隔成一个又一个的区间段。我们通常需要 在这些区间段中移动光标,而不是按j
/k
一行一行 亦或是按H
/M
/L
整屏整屏 地移动光标;
我们需要的是逐段逐段地移动光标。所以,诞生了这个小插件。或许,同样也能帮助到 经常看标记文档的你。
让我们在这些区间丛林中自由跳跃吧!
Use vim 8+ plugins:
$ [ ! -d ~/.vim/pack/plugins/start ] && mkdir -p ~/.vim/pack/plugins/start
$ git clone https://github.com/wishrivers/HMLjk.vim.git ~/.vim/pack/plugins/start/HMLjk
gh
move cursor to the begin of this header section.
gm
move cursor to the middle of this header section.
gl
move cursor to the end of this header section.
gj
move cursor to the next header section.
gk
move cursor to the prev header section.
u can remap the keys in ~/.vimrc
:
nnoremap <leader>h :call hmljk#move('H')<cr>
nnoremap <leader>m :call hmljk#move('M')<cr>
nnoremap <leader>l :call hmljk#move('L')<cr>
nnoremap <leader>j :call hmljk#move('J')<cr>
nnoremap <leader>k :call hmljk#move('K')<cr>