Skip to content

Commit 19335bf

Browse files
author
James Halliday
committed
more vim tricks
1 parent 4f77e56 commit 19335bf

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

vim.markdown

+42
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,48 @@ or deleting, press `p` to paste.
382382
* `V` - select by lines
383383
* ctrl-`v` - select in a block
384384

385+
---
386+
# more insert modes
387+
388+
There are more ways to insert mode than just `i`:
389+
390+
* `o` - go into insert mode, inserting a new line
391+
below the current line
392+
* `O` - go into insert mode, inserting a new line
393+
* above the current line
394+
* `a` - go into insert mode at one character to
395+
the right
396+
* `A` - go into insert mode at the end of the
397+
current line
398+
399+
---
400+
# fancy odds and ends
401+
402+
* `J` - move the next line to the end of the
403+
current line
404+
405+
---
406+
# insert a file
407+
408+
You can insert a file at the cursor position with:
409+
410+
```
411+
:r otherfile.txt
412+
```
413+
414+
---
415+
# insert with a command in place
416+
417+
You can insert the output of a command at the
418+
cursor position with `:r!`.
419+
420+
For example, to insert the output of the `pwd`
421+
command:
422+
423+
```
424+
:r!pwd
425+
```
426+
385427
---
386428
# .vimrc
387429

0 commit comments

Comments
 (0)