2015-12-28 12:06:58 +00:00
|
|
|
# vim
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Vi IMproved, a programmer's text editor.
|
2015-12-28 12:06:58 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Open a file with cursor at the given line number:
|
2015-12-28 12:06:58 +00:00
|
|
|
|
|
|
|
`vim {{file}} +{{linenumber}}`
|
|
|
|
|
2016-08-02 01:56:07 +01:00
|
|
|
- Open multiple files at once, each file in its own tab page:
|
2015-12-28 12:06:58 +00:00
|
|
|
|
|
|
|
`vim -p {{file1}} {{file2}} {{file3}}`
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Open a file in read-only mode:
|
2015-12-28 12:06:58 +00:00
|
|
|
|
|
|
|
`view {{file}}`
|
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
- Enter normal text editing mode (insert mode):
|
2015-12-28 12:06:58 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
`<Esc> i`
|
2015-12-29 17:09:30 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
- Search in file:
|
2015-12-29 17:09:30 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
`/{{search_string}}<Enter>`
|
2015-12-29 17:09:30 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
- Save and Exit vim:
|
2016-01-05 22:07:51 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
`<Esc> :wq <Enter>`
|
2015-12-29 17:09:30 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
- Open interactive help:
|
2016-01-05 22:07:51 +00:00
|
|
|
|
2016-08-21 15:00:09 +01:00
|
|
|
`<Esc> :help <Enter>`
|