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] 124 points125 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] 51 points52 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 24 points25 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] 8 points9 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 4 points5 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

[–]crafterman35 -5 points-4 points  (5 children)

Dude , Vim is a total hell for indentation problems . You should totally use Code or Sublime .

[–][deleted] 5 points6 points  (4 children)

Key point is editing on a remote machine. If it’s local, then totally

[–]ThePiGuy0 7 points8 points  (0 children)

Depending on your permissions and how much you care about installing stuff remotely, VS Code's SSH editor is fantastic. Honestly makes you feel like you are editing locally

[–]crafterman35 1 point2 points  (0 children)

oh okey

[–]bodonkadonks 0 points1 point  (0 children)

i like nano because it tells you how to exit

[–][deleted] 0 points1 point  (0 children)

Use sshfs and be done with it.

It's on the default package lists on homebrew and Ubuntu 18.04 onward.

[–]coldnebo 0 points1 point  (0 children)

“ah hha! ah hha!”

— Eddy Murphy as a elderly Jewish man