Skip to content

Protected: Lab1 Notes

This post is password protected. To view it please enter your password below:


Protected: Test case naming

This post is password protected. To view it please enter your password below:


Protected: Multithreaded Debugging with GDB

This post is password protected. To view it please enter your password below:


Vi Notes

“set makeprg=waf” will cause “.make” compile code using waf.

set makeprg= ./waf \ build
set number – turns on line numbering
set number! – turns off line numbering
set laststatus=2 will show 1 status line even when there is only one window.
syntax on – turn syntax highlighting on
syntax off – turn syntax highlighting off
cd %:h – changes working directory to the current file
set cindent – autoindents for c-style languages
set tabstop n – sets tabs to be 2 spaces
set shiftwidth n – sets tab to put in 2 spaces
set expandtab – replaces tabs in file to spaces… no tabs written to disk.. just spaces

zz – shifts view of buffer so the current line is centered

XCODE BUILD
set makeprg=xcodebuild\ -activetarget\ -activeconfiguration

COMPILATION ERRORS
:cope – Open a window to show the current list of errors
:cn – Skip to next error in the list
:cp – Skip to previous error in the list
:clo – Close current window

FILE EXPLORER
:e . – opens built in file explorer
:Sex – splits window (horiz) and opens file explorer and file in new window
:Vex – splits window (vert) and opens file explorer and file in new window

SHELL
:! cmd – runs command in shell
!! cmd – runs command and inserts result into window
:sh – opens subshell, ctrl-d returns to editor
:e file – edit a file
:r filename – insert the contents of file filename
:cd dir – changes directory
:pwd – prints working directory

TABS
:tabnew – Create a new tab
:tabedit filename – open file filename in new tab
:tabf filename* – open files filename* in new tabs
:tabfirst – show first tab
:tablaast – show last tab
:tabn – show next tab
:tabp – show previous tab
gt switch tabs
:tabm n – move current tab to position n
:tabdo command – execute command command in all tabs
:tab ball – place all open files in tabs
vi -p file1 file2 file3 – Start vi and open a specified files in tabs

WINDOWS
vi -o file1 file2 file3 – Start vi and open specified files in windows
:vsplit – ctrl-w switches
:split – ctrl-w switches
set equalalways=true – sets both width and height of all windows to equal sizes
:winheight x – makes window x lines high
:winwidth x – makes window x columns wide
ctrl-w = – makes all windows the same size
ctrl-w j|k|h|l – moves to window left|right|up|down

BUFFERS
:ls lists all open buffers
:b # opens buffer #
:bn or bp – buffer next, buffer previous
:bd #- delete buffer #
ctrl-O or ctrl-h jumps between buffers

Protected: Github Notes

This post is password protected. To view it please enter your password below:


Switch to our mobile site