32 lines
565 B
Markdown
32 lines
565 B
Markdown
# vim
|
|
|
|
> Vi IMproved, a programmer's text editor.
|
|
|
|
- Open a file with cursor at the given line number:
|
|
|
|
`vim {{file}} +{{linenumber}}`
|
|
|
|
- Open multiple files at once, each file in its own tab page:
|
|
|
|
`vim -p {{file1}} {{file2}} {{file3}}`
|
|
|
|
- Open a file in read-only mode:
|
|
|
|
`view {{file}}`
|
|
|
|
- Exit vim:
|
|
|
|
`[Esc] (to switch to command mode), then :q`
|
|
|
|
- save file in vim
|
|
|
|
`[Esc] (to switch to command mode), then :w`
|
|
|
|
- save file then exit vim
|
|
|
|
`[Esc] (to switch to command mode), then :wq`
|
|
|
|
- switch to edit (insert) mode
|
|
|
|
`[Esc] (to switch to command mode), then i`
|