I also have a Linux desktop. I’ve been using rmate
to remotely edit files. It is designed for the TextMate editor, but Sublime Text and VS Code have extensions that can work. I use it with VS Code. Here’s roughly how to set it up:
First, when SSH-ed into your server, get rmate
installed. I prefer to use the bash version so there’s no ruby dependency. You can install it by copying these two lines to the terminal for VS code:
sudo wget -O /usr/local/bin/rmate https://raw.github.com/aurora/rmate/master/rmate
sudo chmod a+x /usr/local/bin/rmate
(by the way Ctrl-Shift-V pastes into the terminal, something I only discovered recently and that saved me countless painful right clicks)
Now from your local computer, you’ll need to create a reverse SSH tunnel so that the server rmate code can communicate with you. There are plenty of ways of doing this, but if you’re connecting using a private key to an ubuntu server, it will be something like this:
ssh -T -R 52698:localhost:52698 -i your-pvt-key.pem ubuntu@your-instance.com
where your-pvt-key.pem
is your private key file for connecting to the server, and your-instance.com is the address of your server. This creates a reverse tunnel (-R) from port 52698 on your local machine to port 52698 on your remote server. rmate defaults to port 52698, although this can be changed by modifying configuration files. You will need to open port 52698 in your security group on AWS if you’re using AWS.
If you are using VS Code as your local editor, you must install the “Remote VSCode” extension, and run the server locally in VS Code (type F1 and then enter “Remote: start server”) so that everything is set up. Sublime and TextMate have similar settings.
Now you’re all set up! Just type rmate yourfile.py
on the server and it will open the file on your local computer in VS Code to be edited. You can open as many files as you like in this fashion, and you get a full blown text editor with no lag when editing these files 
EDIT: I don’t see why this shouldn’t work from Windows too, provided you can set up an SSH tunnel using PuTTY - I’d be curious to see if anyone gets it right!