Recently I am using Vim to write some small scripts. When writing comments, I want to separate them in this way:
"------------------------------------------------ ---------
"-------------This is Comments ----------------------------
"------------------------------------------------ ---------
I know that ni-
我想大声告诉你2017-05-16 16:42:54
Add this to your vimrc:
inoremap <expr> <C-r>* repeat('*', strdisplaywidth(getline(line('.')-1))-strdisplaywidth(getline('.')))
Then press <C-r>* when you need to use an asterisk to align with the previous line.
Another solution is to copy all the asterisks in the previous line before writing the text part, and then press gR where you need to write text to enter the virtual replacement mode, so you don’t have to count the asterisks.
漂亮男人2017-05-16 16:42:54
I don’t know how to do it directly, but there is another way to achieve your needs, and it’s not troublesome:
1. Insert more symbols each time
2. Use block selection to delete redundant symbols at once
给我你的怀抱2017-05-16 16:42:54
Uh~, can you write three asterisks first, jump to the middle, and then press R?