1
votes

OS: Mac High Sierra

Vim version: VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jul 26 2017 19:10:24)

Vim configurations/settings: installed the awesome version of https://github.com/amix/vimrc

I copied several lines from Vim to clipboard using "Cmd+C" and pasted that to python opened in terminal. It returned "IndentationError: unexpected indent". Below's a screenshot of multi-lines selection in Vim: screenshot of multi-lines selection in vim

From the image, we can see one-space ident at the start of each line. But when I move the cursor in vim editor, no space would be highlighted by the cursor.

Question: how to avoid these unexpected indents? Is there any way to set the .vimrc file?

1

1 Answers

2
votes

The problem is that you haven't told vim to use the mouse. So what you are doing is just selecting text in the terminal, including everything vim displays for formatting.

To change this, try setting set mouse=a in your .vimrc
And take a look at :h mouse for more information on what this does.