Text Editing with Pico or Nano


Introduction

Rather than edit files using command line programs directly on the server, another option is to connect to the server using a secure FTP program. You can then open the file with programs in your windowed environment (i.e. Windows or MacOS) and can edit there, save changes and then compile on the server.

You will still need a Putty window open and must work from the shell to compile the program and observe its output, but your file editing can use more familiar programs.

For Windows, I recommend the free program WinSCP as an SFTP client and the free editor Notepad++. Here is a quick summary of useful steps to get started.


Notepad++

  1. Download and install the 64 bit version of Notepad++.
  2. Open Notepad++ then go to Settings -> Preferences -> New Document
  3. Look for the setting box titled "Format (Line ending)".
  4. Change the setting to "Unix (LF)" and click Close
  5. This must be done before you create new files.

WinSCP

  1. Make sure to login with Putty and set your password before using WinSCP
  2. Download and install WinSCP
  3. Start WinSCP
  4. The the file protocol and port number should default to SFTP and 22
  5. Enter the host name: classes.csc.lsu.edu
  6. Enter your username and password.

WinSCP basics and changing the default editor to Notepad++

  1. After login, right-click and create a new directory. Give it a name and click "ok"
  2. Double click to enter the directory (double click the ".." to exit a directory).
  3. Inside the directory, right-click and create a new file named test.c
  4. WinSCP automatically opens it in the internal text editor. Enter at least one character then save and close the file.
  5. Right click the file in the interface and choose "Edit -> Edit with ..."
  6. Click the browse button and choose "C:\Program Files\Notepad++\notepad++.exe"
  7. Check "remember this editor" then click OK
  8. This opens the editor. Close it again so we can make it the default.
  9. Right click your file in the interface again and choose "Edit -> Configure"
  10. Click "Notepad++" in the list then click "Up" button a until its at the top of the list.
  11. Click OK and test opening your file with a double click. It should open in Notepad++.
  12. In WinSCP if you save the file from your text editor (even without closing it) changes are saved to the server. The general usage strategy is to edit your code, press Ctrl+S to save, then switch to your Putty window to compile.