Solve a sentence of vim code
淡淡烟草味
淡淡烟草味 2017-05-16 16:37:06
0
2
641

Find out how this line of code works:

imap <C-L> @@@<esc>hhkywjl?@@@<CR>P/@@@<cr>3s

淡淡烟草味
淡淡烟草味

reply all(2)
某草草

This is a mapping of insertion mode. It seems that the purpose is to copy a word above the cursor to the current position.
The general principle is this:

  • @@@ This is actually a place holder. Convenient for the next two positioning (? and /). After understanding this, the rest will...

  • hhk Move the cursor to the word above

  • yw Copy

  • P Paste above the current line, which is the line where the cursor is initially.

  • 3s is to delete those three 3s 是删除那三个 @@@

I won’t explain everything else one by one.

阿神

I have never seen such strange syntax. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template