Remote file editing: Difference between revisions
No edit summary |
No edit summary |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
It's often good to be able to edit files remotely in an editor. This is much superior (for advanced projects) to Jupyter Notebooks for most purposes. Here are some instructions as to how. | It's often good to be able to edit files remotely in an editor. This is much superior (for advanced projects) to Jupyter Notebooks for most purposes. Here are some instructions as to how. | ||
= Text editor apps = | = Text editor apps = | ||
| Line 15: | Line 11: | ||
* and save a document to verify that your connection works. | * and save a document to verify that your connection works. | ||
[https:// | == [https://code.visualstudio.com/ Visual Studio Code] == | ||
(OS X, Linux, Windows) | |||
* Download and install | * Download and install | ||
* Also make sure that you have OpenSSH installed, which comes standard with most versions of Windows 10 now, by opening Command Prompt or PowerShell and running <code>ssh</code> | * Also make sure that you have OpenSSH installed, which comes standard with most versions of Windows 10 now, by opening Command Prompt or PowerShell and running <code>ssh</code> | ||
** Also, if you have not already, | ** Also, if you have not already, set up an SSH key using these instructions: [[How_To_Set_Up_SSH_Keys]]. | ||
* Click on the Extension Tab, and search for "Remote Development Extension Pack" | * Click on the Extension Tab, and search for "Remote Development Extension Pack" | ||
* Click Install | * Click Install | ||
| Line 47: | Line 22: | ||
* The next steps depend on whether you want to work on Tools and/or the Cluster | * The next steps depend on whether you want to work on Tools and/or the Cluster | ||
** Cluster | ** Cluster | ||
*** Add the following code snippet to your ssh config file, replacing USERNAME with your username and the path to your ssh.exe if it is not in System32. | *** Add the following code snippet to your ssh config file, replacing USERNAME with your username and the path to your ssh.exe if it is not in System32. | ||
<pre>Host | <pre>Host hopper | ||
HostName hopper.cluster.earlham.edu | |||
User USERNAME | |||
Host | Host bowie | ||
HostName bowie.cs.earlham.edu | |||
HostName | |||
User USERNAME | User USERNAME | ||
</pre> | </pre> | ||
NOTE: you can add more than just bronte and pollock to the Host line; you just need to separate them by spaces. The config will work the same as long as you've spelled everything correctly! | |||
* After you have done one or both of those instructions, save your config, navigate to the remote editing tab on the left side of the screen, and hit the refresh button.\ | * After you have done one or both of those instructions, save your config, navigate to the remote editing tab on the left side of the screen, and hit the refresh button.\ | ||
* If everything worked correctly, whatever servers you added should appear on the list | * If everything worked correctly, whatever servers you added should appear on the list | ||
== [https://www.sublimetext.com/ Sublime] == | |||
(Commercial (possible to use without cost), OS X, Linux, Windows) | |||
* Download and install. | |||
* Tools > Command Palette > type "package" > Package Control: Install Package > type "sftp" > click first entry | |||
* Now go to File > SFTP/FTP to do tasks like setting up and browsing servers | |||
== [https://www.barebones.com/products/bbedit/ BBEdit] == | |||
(Was TextWrangler, commercial (with free mode), OS X, installed on the CST Macs) | |||
* Download and install. | |||
* From the File menu choose "Open from FTP/SFTP Server" and configure tools.cs.earlham.edu as a server. | |||
== [https://notepad-plus-plus.org/ Notepad++] == | |||
(for Windows) | |||
* Download and install. You're almost certain to want the 64-bit version. | |||
* Plugins > Manage plugins > "NppFTP" (if it's not already installed) | |||
* Plugins > NppFTP > Open NppFTP > gear ("Settings") > Profile settings > Add new | |||
= At the terminal = | |||
Use vi, [[Vim|vim]], nano, or some other editor at the terminal for editing if you want simplicity and do a lot of admin work. | |||
== [https://www.vim.org/ Vi / Vim] == | |||
Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X. It is available on all our systems. | |||
== [https://www.nano-editor.org/ Nano] == | |||
GNU nano is a text editor for Unix-like computing systems or operating environments using a command line interface. It is simple and easy to use, and is available on all our systems. | |||
Tested and working 2022 | Tested and working 2022 | ||
Latest revision as of 21:32, 22 January 2026
It's often good to be able to edit files remotely in an editor. This is much superior (for advanced projects) to Jupyter Notebooks for most purposes. Here are some instructions as to how.
Text editor apps
Generally, a text editor will have either a built-in feature or an extension that supports adding SFTP (secure FTP) servers. You'll want to add tools, hopper, or both to your editor.
A common pattern is to:
- download the software (links with each editor),
- add your username and password or ssh key for the server you want,
- connect,
- and save a document to verify that your connection works.
(OS X, Linux, Windows)
- Download and install
- Also make sure that you have OpenSSH installed, which comes standard with most versions of Windows 10 now, by opening Command Prompt or PowerShell and running
ssh- Also, if you have not already, set up an SSH key using these instructions: How_To_Set_Up_SSH_Keys.
- Click on the Extension Tab, and search for "Remote Development Extension Pack"
- Click Install
- Reload the window if prompted
- If it does not prompt you to, open your ssh configs by pressing CTRL+p, then typing ">Remote-SSH: Open Configuration File", and then pressing enter
- The next steps depend on whether you want to work on Tools and/or the Cluster
- Cluster
- Add the following code snippet to your ssh config file, replacing USERNAME with your username and the path to your ssh.exe if it is not in System32.
- Cluster
Host hopper
HostName hopper.cluster.earlham.edu
User USERNAME
Host bowie
HostName bowie.cs.earlham.edu
User USERNAME
NOTE: you can add more than just bronte and pollock to the Host line; you just need to separate them by spaces. The config will work the same as long as you've spelled everything correctly!
- After you have done one or both of those instructions, save your config, navigate to the remote editing tab on the left side of the screen, and hit the refresh button.\
- If everything worked correctly, whatever servers you added should appear on the list
(Commercial (possible to use without cost), OS X, Linux, Windows)
- Download and install.
- Tools > Command Palette > type "package" > Package Control: Install Package > type "sftp" > click first entry
- Now go to File > SFTP/FTP to do tasks like setting up and browsing servers
(Was TextWrangler, commercial (with free mode), OS X, installed on the CST Macs)
- Download and install.
- From the File menu choose "Open from FTP/SFTP Server" and configure tools.cs.earlham.edu as a server.
(for Windows)
- Download and install. You're almost certain to want the 64-bit version.
- Plugins > Manage plugins > "NppFTP" (if it's not already installed)
- Plugins > NppFTP > Open NppFTP > gear ("Settings") > Profile settings > Add new
At the terminal
Use vi, vim, nano, or some other editor at the terminal for editing if you want simplicity and do a lot of admin work.
Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X. It is available on all our systems.
GNU nano is a text editor for Unix-like computing systems or operating environments using a command line interface. It is simple and easy to use, and is available on all our systems.
Tested and working 2022