The text of the modified column pattern in Vim is the increment ordinal of ABCD or 1234

Source: Internet
Author: User

Add in VIMRC

Vnoremap <F3>: <c-u>call <sid>addcharofcursor () <CR>

"Incrementing characters in column mode
function! S:addcharofcursor ()
Let C = col ('. ')
Let L = line ('. ')
Let L0 = line ("' <")
Let L1 = line ("' >")
Let char0 = Strpart (Getline ('. '), c-1,1)
for k in range (1, l1-l0) "Starting at line 2nd
Let Str_before = Strpart (Getline (l+k), 0,c-1)
Let Str_after = Strpart (Getline (l+k), c)
If Char0 =~ ' \d '
Let char1 = Char0 + K
Else
Let char1 = Nr2char (CHAR2NR (char0) +k)
endif
Call Setline (L+k, Str_before char1. Str_after)
ENDfor
Endfunction

Column Select a, press F3, you can change to the right.

If it is 1, the number is incremented, but the number is 9

Friendly reminder: If the letter exceeds Z, the character after the Ascⅱ code will appear.

The text of the modified column pattern in Vim is the increment ordinal of ABCD or 1234

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.