search

Home  >  Q&A  >  body text

Solve a sentence of vim code

Find out how this line of code works:

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

淡淡烟草味淡淡烟草味2774 days ago628

reply all(2)I'll reply

  • 某草草

    某草草2017-05-16 16:39:06

    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.

    reply
    0
  • 阿神

    阿神2017-05-16 16:39:06

    I have never seen such strange syntax. . .

    reply
    0
  • Cancelreply