This page is here to help you choose, setup, and find an efficient workflow for a text editor to use in this class. While you can make just about anything work, you must make sure that your code compiles and runs on attu before submitting. In order to make this requirement somewhat easier, all of the tools covered in this article will connect to attu and do the editing there, to minimize the amount of file-copying/git-push-pull-ing when debugging.
In the past, students have successfully used a variety of editors in this class, including: vim, VS Code, and emacs. This article covers setup and tips for the two most popular options: vim and VS Code.
Vim is an extremely customizable and powerful text editor, but can have a fairly high learning curve. This is the editor that many of you likely used in CSE 351, and getting it set up on attu is simple. So simple, in fact, that it's already done for you!
vim
or vim <filename>
on the
command line and press <Enter>. This will open a welcome
screen or the specified file, respectively, for viewing and
modification.:q
to
exit (or :q!
to exit and discard changes).vimtutor
can be run from the command line and
gives a brief introduction to vim terminology and the general gist
of how it works. This describes how to move around, select, copy,
paste, and other basic functions of vim. However,
vimtutor
is quite dry..vimrc
Commands placed in the file ~/.vimrc
will be run
when vim starts up. The CSE 333 starter vimrc file can be
automatically placed in the correct location for you using the
following command:
curl -Lo ~/.vimrc https://cs.uw.edu/333/resources/vimrc.txt
This should serve as a good starting point for you to customize vim yourself and does the following for you:
F9
to run make (you can also
just do :make
). Then, you can run
:copen
to see the output alongside your code. Vim
will even take you to the lines that have compiler
problems.:Man <page number>
<function>
command, which allows you to view
man
pages within vim.‘ron’
. Instructions for
changing this are in the .vimrc
file.If you're curious how it works, the file has comments that
describe what each command does; just open the file with
vim ~/.vimrc
.
c.vim
Vim also has features that allow it to conditionally execute commands from a file. A particularly useful example is that vim can recognize file types and conditionally execute a command file based on the file type. The course staff has provided a file that sets up vim to help with automatically formatting C/C++ files. You can download and properly install it using this command:
curl --create-dirs -Lo ~/.vim/after/ftplugin/c.vim https://cs.uw.edu/333/resources/c_vim.txt
Like with the ~/.vimrc
, this file includes comments
that explain what it's doing. You can view them with
vim ~/.vim/after/ftplugin/c.vim
.
VS Code is another editor commonly used by CSE 333 students. While the use of the editor itself has a much lower learning curve, the setup process can be much more involved if you want to run VS Code locally on your PC and remotely edit files on attu.
Ctrl-P
) and paste this command:
ext install ms-vscode-remote.remote-ssh
<F1>
works on all platforms) and paste
the following:
Remote-SSH: Add New SSH Host...
Then run it by hitting <Enter>
.ssh CSENetId@attu.cs.washington.edu
,
substituting your CSE Net ID.attu.cs.washington.edu
domain. It will also keep
track of your recent files you've opened on attu.attu.cs.washington.edu
, right-click
it and select “Connect to Host in Current Window.”
Enter your CSE Net ID password when prompted.Ctrl-`
or use View: Toggle
Terminal
in the command palette.