I'm trying to find a the fastest way to paste text at the end of the line, but with a space between the previous EOL and new text. The current method is a <ESC>p
or o<ESC>pkJ
. Is there any other, faster way to achive this? I'm thinking about something like "paste with offset"?
Original: The quick brown fox
after $p: The quick brown foxjumps over the lazy dog
desired : The quick brown fox jumps over the lazy dog
Insert "new text " at the beginning of the line. Append " new text" to the end of the line.
Pasting over a block of text You can copy a block of text by pressing Ctrl-v (or Ctrl-q if you use Ctrl-v for paste), then moving the cursor to select, and pressing y to yank. Now you can move elsewhere and press p to paste the text after the cursor (or P to paste before).
If you do not want to use a mapping, you can type Aspacectrl+r".
See :h i_ctrl-r
for more information. This is what is happening:
A Append text to end of line (enters insert mode).
space - Actual space key to insert a space.
ctrl+r - Insert contents of a register.
" - Default register of yank and paste.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With