4

How to paste in Vim

 2 years ago
source link: http://www.donghao.org/2021/07/16/how-to-paste-in-vim/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How to paste in Vim

After I have written the SQL on BigQuery’s UI:

SELECT
  first_column
FROM
  `project.dataset.table`
ORDER BY
  `first_column` ASC
LIMIT
  1000
Python
xxxxxxxxxx
SELECT
  first_column
FROM
  `project.dataset.table`
ORDER BY
  `first_column` ASC
LIMIT
  1000

I tried to copy it to my Vim editor through “Ctrl + c” and “Ctrl + v”. But the result in my Vim looks like irregular steps

SELECT
  *
  FROM
    `project.dataset.table`
    ORDER BY
      `first_column` ASC
      LIMIT
        1000
Python
xxxxxxxxxx
SELECT
  *
  FROM
    `project.dataset.table`
    ORDER BY
      `first_column` ASC
      LIMIT
        1000

Even using “Shift + Option + Command + v” to paste code without format couldn’t solve this problem.

Actually, it’s not a problem about system pasting, but about Vim. The correct way is to set Vim to accept “paste” at first

:set paste
Python
xxxxxxxxxx
:set paste

then we can get the pasting content correctly.

Like this:

Loading...
1:29 am ROBIN DONG develope
Leave a comment

Leave a Reply Cancel reply


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK