Home
Browse
Create
Search
Log in
Sign up
Upgrade to remove ads
Only $2.99/month
CSE 15L Lecture 1
STUDY
Flashcards
Learn
Write
Spell
Test
PLAY
Match
Gravity
Terms in this set (49)
vi filename
creates a file and opens it in editor if the file does not exist, otherwise opens the file.
vi -r filename
Edits filename using .filename.swp as the input . The
file .filename.swp must be deleted, using:
rm .filename.swp, after use.
vi -R filename
Edits filename in read-only mode does not allow
changes to filename.
vi +/pattern filename
Edits filename at the line containing the pattern.
:w def
Write to a new file def, but stay in the existing file.
:w! def
Write to an existing file def, but stay in the existing file.
:r def
add (read) file def into the current file
:f
Provides information on the file currently editing, including the current
line number, if it has been modified etc.
:q
quit without saving changes
:wq
save and quit
:q!
quit without saving changes (hard quit)
ZZ or :x
save file only if changes have been made, then quit
i, <esc>
Enter insert mode at this location, exit
insert mode
o, O
Insert new line after/before current
line
a,A
Append after cursor, end of current
line
I (capital i)
Insert at beginning of line
dd
delete this line
dw
delete this word
d}
Delete to next paragraph
d^
delete to beginning of line
d/pattern
Delete to first occurrence of pattern
dn
Delete to next occurrence of pattern
dfa
Delete up to and including a on this line
dta
Delete up to (not including) a on this line
nx
Delete current [and n-1] character[s]
nX
Delete previous n character[s]
rx
replace current character with x
Rtext
replace text beginning at cursor
cx
Replace based on dimension d (e.g.
cw replaces a word) use escape to
terminate replacement
r <enter>
splits the line at the current cursor
J
joins lines at current cursor
h
move cursor left
j
move cursor down
k
move cursor up
l
move cursor right
w,W
Move to beginning of special character delimited
word, whitespace delimited word.
e,E
Move to end of special character delimited word,
whitespace delimited word
b,B
Move back to beginning of special character
delimited word, whitespace delimited word.
(,)
Open or closed parenthesis, move to beginning, end
of current sentence.
{,}
Open or closed curly braces, move to beginning, end
of current paragraph.
0,$
first and last positions
n|
n Column (| is the pipe symbol)
/text
searches for text forward
?text
searches for text backward
n (after search)
searches for same text
:set nu
turn line numbers on
:set nu!
turn line numbers off
:!cmd
To execute a single Unix command from inside the editor
:sh
temporarily return to shell
THIS SET IS OFTEN IN FOLDERS WITH...
CSE 15L Final -- Fall 2015
93 terms
CSE 15L Midterm I -- Fall 2015
57 terms
CSE 15L Practice Questions for Final Exam
123 terms
CSE 15L Lecture 1
49 terms
YOU MIGHT ALSO LIKE...
Vi Commands
61 terms
Editing with vi: commands
67 terms
COP3353 Test 1
50 terms
vim commands
21 terms
OTHER SETS BY THIS CREATOR
Right Triangle Ratios
3 terms
Prime Numbers Less than 60
2 terms
Vocab 3
119 terms
Spanish Vocab 2
107 terms