1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/vim.md

32 lines
561 B
Markdown
Raw Normal View History

2015-12-28 13:06:58 +01:00
# vim
> Vi IMproved, a programmer's text editor.
2015-12-28 13:06:58 +01:00
- Open a file with cursor at the given line number:
2015-12-28 13:06:58 +01:00
`vim {{file}} +{{linenumber}}`
2016-08-02 10:56:07 +10:00
- Open multiple files at once, each file in its own tab page:
2015-12-28 13:06:58 +01:00
`vim -p {{file1}} {{file2}} {{file3}}`
- Open a file in read-only mode:
2015-12-28 13:06:58 +01:00
`view {{file}}`
- Exit vim:
2015-12-28 13:06:58 +01:00
2015-12-29 21:24:21 -05:00
`[Esc] (to switch to normal mode), then :q`
2015-12-29 12:09:30 -05:00
- save file in vim
2015-12-29 21:24:21 -05:00
`[Esc] (to switch to normal mode), then :w`
2015-12-29 12:09:30 -05:00
- save file then exit vim
2015-12-29 21:24:21 -05:00
`[Esc] (to switch to normal mode), then :wq`
2015-12-29 12:09:30 -05:00
- switch to edit (insert) mode
2015-12-29 21:24:21 -05:00
`[Esc] (to switch to normal mode), then i`