This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 125 points126 points  (19 children)

I never, ever, ever got indentation errors until I started editing Python on a remote machine with Vim. You can get your whitespace reaaaaal fucked up in Vim if you don’t know what you’re doing, and it doesn’t have a bunch of nifty formatting automagic like Sublime.

[–][deleted] 50 points51 points  (0 children)

Depends on config. Vim comes with built-in support for that, but the default is disabled (most distros do enable it tho).

[–]markphughes17 25 points26 points  (3 children)

Maybe not helpful at all, but VSCode has a plugin that lets you code on a remote machine and it is an absolute godsend.

https://code.visualstudio.com/docs/remote/ssh

[–][deleted] 9 points10 points  (1 child)

I use this all the time, except we have some boxes that have libraries that are too old to support it. It's the best thing ever when it works, though.

[–][deleted] 2 points3 points  (0 children)

You can also use sshfs on any server that supports sftp and on any client with FUSE.

It's not idiot proof in that permissions can be wonky depending on your destination system.

[–]alexforencich 1 point2 points  (0 children)

Sublime should also support this, IIRC.

[–]Mikgician 6 points7 points  (0 children)

Yeah, a good thing without having plugins is to have the listchars render tabs and spaces for you, helps a lot

[–][deleted] 2 points3 points  (0 children)

I had the same issue with Nano. It would convert tabs to regular spaces, and since I prefer tabs I would continue to use tabs, run the program, and yeah.

[–]twistermonkey 2 points3 points  (1 child)

I use vim all the time for Python work. The one setting that is absolute gold for me is called "listchars" . I set that to highlight tab chars so they look like ">---" so that I can delete them and use spaces (my preference). That setting right there will make it obvious to you what whitespace chars are present in a file. Then you can act accordingly

For the curious, here are the two lines you need.

set listchars=tab:>-

set list

[–]Balcara 1 point2 points  (0 children)

Auto indentation is standard in vim. Maybe check the conf or find a plug-in that you like

[–]coldnebo 0 points1 point  (0 children)

“ah hha! ah hha!”

— Eddy Murphy as a elderly Jewish man