In what follows, you should find a dense reference for the common tasks you’ll be doing at some point after each class. This assumes you’ve already set everything up.
Soon after each lecture, I will post the notes to the csc103-lectures
git repository. If you cloned the repository in your home directory, you can get my updates by running:
cd ~/csc103-lectures/
$ git pull --no-edit $
If you hadn’t committed your changes yet, do so with something like this:
git commit -a -m 'saving my work.' $
cd ~/csc103-lectures/02/
.git diff
, and commit changes.\c
will save and compile in one step. Moreover, this will also make a list of any errors or warnings from the compiler. You can go through these with ]q
and [q
keybindings.1 (This jumps to the line of the next / previous error, and shows the error message at the bottom of the screen.) If you’re not using vim, then perhaps use a command like make && ./myprogram
in the terminal. Be sure to save your work before running it though!ack -A3 -w 'TODO'
from the lectures directory will show a list of all the exercises from the notes.2 If you are searching through multiple folders, you can keep the output sorted by adding the --sort-files
flag to the ack
command.i3
you will be in your home directory, and not the working directory of the current window. For the special case of vim
, this is easy to fix: just add this line to your ~/.vimrc
somewhere: nnoremap \t :silent exec "!sh -c '(exec xterm &)'"<CR>
. Then typing \t
in vim
will open a terminal with your current directory.In case you are here for the first time, some set-up instructions:
Be sure you’ve read the git tutorial first.
Now clone the repository for lectures:
$ git clone https://bitbucket.org/wes_ccny/csc103-lectures.git
There should now be a csc103-lectures
folder. Inside, you’ll find other folders, each corresponding to a day of lecture.
Note that all of these keybindings have been lifted from my personal vim configuration and are not standard vim keys. See ~/.vimrc
and ~/.vim/after/ftplugin/c.vim
for some of these mappings.↩︎
Note: the -A3
says to print the match and the next 3 lines. You can change the 3 to something larger if necessary.↩︎