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
:only
Close all windows but the current window
26
:split filename
Opens filename for editing in the split window
27
:new
Opens a window on a new, empty file
28
CTR-W +
Increase size of window
29
CTRL-W -
Decrease size of window
30
(count) CTRL-W _
Set window to size specified by count
31
'v' before a window split command
Does the split vertically :vsplit (file), :vnew
32
CTRL-W [hjkltb]
Move TO the window left, above, down, right, top or bottom.
33
CTRL-W [HJKL]
Move the window itself to the far left, top, bottom, or right.
34
:[wq!]all
Writes or quits all open windows, overridden as needed by !.
35
The -o flag
Opens all arguments as horizontally split windows
36
The -O flag
Opens all arguments as vertically split windows
37
:all and :vertical all
Opens all arguments in windows from within vim.
38
:tab filename
Open filename in a new tab
39
:tab split
Open a new tab editing the same buffer
40
:tab
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
:tabonly
close all other tabs
42
(count)gt
Goto Tab (next tab is default, can be specified by the count)
43
q{register}... q
Begin recording a macro in {register} == [a-z] | .... the 'q'uit recording.
44
@{register}
Execute the macro in {register}. May take a count.
45
@@
Execute the last @{register} command used. May take a count.
46
Y
== yy. I.e, yank the whole line
47
Appending to a register
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'.