0

I usually wrote my code in Pycharm at my local machine and then git push. Then I logged on to a remote Linux machine to get pull the code. Occasionally, I need to edit the code a little bit with vim at the remote machine. But every time when I change anything in the code, it always reports this error:

TabError: inconsistent use of tabs and spaces in indentation

And the change I made is below:

def __call__(self, doc):
    print(doc.text)
    matches = self.matcher(doc)
    spans = []
    ...

I added the 'print' statement in VIM (from the line above and press enter key, it automatically aligned with 'matches' line) and it is perfectly indented. How to avoid this issue? I also tried this command and it doesn't effect:

autopep8 -i relation.py 
marlon
  • 6,029
  • 8
  • 42
  • 76

0 Answers0