Vim: Difference between revisions
From Jedisaber Wiki
Created page with " = Modes = <code>i</code> goes into insert mode <code>Esc</code> goes back to command mode. = Commands = == Saving and Exiting vim == <code>ZZ</code> Save and exit vim" |
No edit summary |
||
| Line 11: | Line 11: | ||
<code>ZZ</code> Save and exit vim | <code>ZZ</code> Save and exit vim | ||
<code>:w</code> Write the file to disk, stay in vim | |||
<code>:w !sudo tee %</code> Saves the file, even you don't have permission to write to the file (do this instead of closing the file, opening with sudo, and re-doing your changes) | |||
<code>:wq</code> Save the file and exit vim | |||
<code>:q</code Quit vim (Note: if you've made changes, you'll get a message that the file has changed. To quit without saving changes, use: <code>:q!</code> ) | |||
== Navigating Withing the Document == | |||
== Manipulating Text == | |||
Revision as of 02:29, 19 December 2016
Modes
i goes into insert mode
Esc goes back to command mode.
Commands
Saving and Exiting vim
ZZ Save and exit vim
:w Write the file to disk, stay in vim
:w !sudo tee % Saves the file, even you don't have permission to write to the file (do this instead of closing the file, opening with sudo, and re-doing your changes)
:wq Save the file and exit vim
:q</code Quit vim (Note: if you've made changes, you'll get a message that the file has changed. To quit without saving changes, use: :q! )
Manipulating Text
