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, the following editors can all be used directly with the CSE Linux environment; you must make sure that your code compiles and runs there before submission. This will help to minimize the amount of file copying and/or git push/pull-ing necessary when debugging.
This page covers setup and tips for the three most popular options: vim (), VS Code (), and Emacs ().
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/editors/vimrc.txt
This should serve as a good starting point for you to customize vim yourself and does the following for you:
‘ron’
.
Instructions for changing this are in the .vimrc
file.
:Man <page number> <function>
command, which allows you to view man
pages within
vim.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.
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 install it using this command:
$ curl --create-dirs -Lo ~/.vim/after/ftplugin/c.vim https://cs.uw.edu/333/editors/c_vim.txt
Like with .vimrc
, this file includes comments that
explain what it's doing.
You can view them with vim ~/.vim/after/ftplugin/c.vim
.
ext install ms-vscode.cpptools
As VS Code is an integrated development environment (IDE), you open and close the application like you would other applications like Microsoft Word and there is no need to use the terminal.
If you haven't used VS Code much before, it might be useful to walk through this tutorial.
ext install ms-vscode-remote.remote-ssh
Remote-SSH: Add New SSH Host...Then run it by hitting [Enter].
ssh <netid>@attu.cs.washington.edu
,
substituting your CSE NetID.attu.cs.washington.edu
, right-click it and select
"Connect to Host in Current Window".
Enter your CSE NetID password when prompted.
View: Toggle Terminal
in the command
palette.emacs
or emacs <filename>
on
the command line and press [Enter].
This will open a welcome screen or the specified file,
respectively, for viewing and modification.Ctrl-x, Ctrl-c
to exit.Ctrl-h, t
from within Emacs.
This will open up a text file with instructions to follow that
covers the basics of movement and editing.
As this is just plain text, it can feel dry and is a lot to read.
.emacs
Commands placed in the file ~/.emacs
will be run when
Emacs starts up.
The default settings should do a decent job as-is, so we won't be
providing a starter configuration file.
If you do feel like customizing a bit, you can find some examples
.