Files and Windows Flashcards

1
Q

zf{textobject}

A

manually create a fold around the text object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

zo

A

manually open a fold

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

zc

A

manually close a fold

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Start Vim with a list of files to edit

A

$vim file1 file2 etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

:args

A

Show on the status line the files open for editing. The current file is surrounded by brackets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

:n[ext]

A

Move to the next file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

:wnext

A

Write the current file and move to the next file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

:next!

A

Move to the next file, abandoning changes to the current file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

:prev[ious]

A

Move the previous file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

:first

A

move to the first file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

:last

A

move to the last file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

:set (no)autowrite

A

Turn (off) on autowriting - when moving from file to file Vim will automatically write any changes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

CTRL-^

A

Jump between current file and the previously edited (the ‘alternate’) file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

:edit filename

A

Opens file ‘filename’ for editing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

“{a-z}[ypd]

A

Perform the y, p or d operation (followed by each operations motion arguments) on the register specified by a single character from a to z.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Append to file

A

:write&raquo_space; newfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Append selection to file

A

Use visual mode to select a block of text. Then do

:write&raquo_space; newfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

vim -R file

A

Open the file in Vim as read-only, ! will override

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

view file

A

Open the file in Vim as read-only, ! will override

20
Q

vim -M file

A

Open the file in Vim as read-only, cannot be overridden.

21
Q

:saveas name

A

Saves the current file as a new file named ‘name’

22
Q

:(count)split

A

Split the (current) window horizontally, gives new window the height specified by count

23
Q

CTRL-W w

A

Jump to another window

24
Q

:close

A

Close the current window

25
Q

:only

A

Close all windows but the current window

26
Q

:split filename

A

Opens filename for editing in the split window

27
Q

:new

A

Opens a window on a new, empty file

28
Q

CTR-W +

A

Increase size of window

29
Q

CTRL-W -

A

Decrease size of window

30
Q

(count) CTRL-W _

A

Set window to size specified by count

31
Q

‘v’ before a window split command

A

Does the split vertically :vsplit (file), :vnew

32
Q

CTRL-W [hjkltb]

A

Move TO the window left, above, down, right, top or bottom.

33
Q

CTRL-W [HJKL]

A

Move the window itself to the far left, top, bottom, or right.

34
Q

:[wq!]all

A

Writes or quits all open windows, overridden as needed by !.

35
Q

The -o flag

A

Opens all arguments as horizontally split windows

36
Q

The -O flag

A

Opens all arguments as vertically split windows

37
Q

:all and :vertical all

A

Opens all arguments in windows from within vim.

38
Q

:tab filename

A

Open filename in a new tab

39
Q

:tab split

A

Open a new tab editing the same buffer

40
Q

:tab

A

In general, can be prepended to any Ex command that would open a file or window and will open the file or window in a new tab

41
Q

:tabonly

A

close all other tabs

42
Q

(count)gt

A

Goto Tab (next tab is default, can be specified by the count)

43
Q

q{register}… q

A

Begin recording a macro in {register} == [a-z]

…. the ‘q’uit recording.

44
Q

@{register}

A

Execute the macro in {register}. May take a count.

45
Q

@@

A

Execute the last @{register} command used. May take a count.

46
Q

Y

A

== yy. I.e, yank the whole line

47
Q

Appending to a register

A

Type out the command as normal but instead of the lowercase letter referencing the register, use an uppercase letter. Example:
qA[commands]q will append [commands] to register a, which is then executed ‘@a’.