Week 3-4: Vim Basics

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/35

flashcard set

Earn XP

Description and Tags

Flashcards covering Vim basics and common editor commands from the lecture notes.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

36 Terms

1
New cards

vim

A modal text editor used in the terminal to create and modify text files.

2
New cards

mkdir

Create a new directory (example: mkdir /FGCU).

3
New cards

cd

Change the current working directory (example: cd /FGCU).

4
New cards

Renewed save and exit command: :x

Write the current buffer to the file and exit Vim.

5
New cards

:w

Save (write) the current buffer to the file; stay in Vim.

6
New cards

:q!

Quit Vim and discard any unsaved changes.

7
New cards

:q

Quit Vim if there are no unsaved changes; otherwise Vim prompts.

8
New cards

:x!

Force write and exit Vim (overwrite, then quit).

9
New cards

Save as (new file name) with :w

Save the current buffer to a new file name without exiting (e.g., :w xyz saves as xyz).

10
New cards

:r filename

Append the contents of filename into the current file at the cursor position (example: :r /etc/passwd).

11
New cards

o

Insert a new line below the current line and enter insert mode.

12
New cards

O

Insert a new line above the current line and enter insert mode.

13
New cards

x

Delete the character under the cursor.

14
New cards

nx

Delete n characters starting from the cursor.

15
New cards

X

Delete the character before the cursor (backspace).

16
New cards

nX

Delete n characters before the cursor (backward deletion).

17
New cards

yy

Copy the current line into the unnamed register.

18
New cards

nyy

Copy n lines starting from the current line.

19
New cards

p

Paste the previously yanked or deleted text after the cursor.

20
New cards

np

Paste n lines after the current line.

21
New cards

u

Undo the last change.

22
New cards

nu

Undo the last n changes.

23
New cards

Ctrl+R

Redo the most recently undone change.

24
New cards

n Ctrl+R

Redo the next n changes (repeat redo commands).

25
New cards

dd

Delete the current line.

26
New cards

ndd

Delete n lines starting from the current line.

27
New cards

:n

Go to the nth line in the file.

28
New cards

gg or :1

Go to the first line (top) of the file.

29
New cards

G or shift+g or :$

Go to the last line (bottom) of the file.

30
New cards

D (shift+d)

Delete from the cursor position to the end of the line.

31
New cards

d0

Delete from the cursor position to the start of the line.

32
New cards

:1, $ s/A/B/g

Substitute A with B across the entire file (from line 1 to end).

33
New cards

/FGCU

Search forward for the string FGCU.

34
New cards

n

Repeat the last search in the same direction (downward).

35
New cards

N

Repeat the last search in the opposite direction (upward).

36
New cards

Ctrl+G

Show cursor position and status information.