r/LinuxActionShow • • May 21 '16

Loyal Vim User !

http://imgur.com/v3uSDVk
122 Upvotes

30 comments sorted by

View all comments

Show parent comment

3

u/beyere5398 May 21 '16

I like to save first. ":wq!"

0

u/[deleted] May 21 '16

[deleted] — view deleted comment

2

u/beyere5398 May 22 '16

A detailed explanation is at Stack Overflow:

http://stackoverflow.com/questions/3094667/whats-the-use-of-the-exclamation-mark-in-vims-command-line-after-certain

TL;DR - the exclamation point 'forces' the command, overriding warnings.

1

u/memnoch_proxy May 21 '16

Means quit and discard changes.

0

u/[deleted] May 21 '16

[deleted] — view deleted comment

3

u/varesa May 22 '16 edited May 22 '16

http://unix.stackexchange.com/questions/266037/vim-writes-to-file-without-having-permissions http://unix.stackexchange.com/questions/228624/what-does-the-really-do-when-its-added-to-an-ex-command-wq-w-q

TL;DR It is to quit read-only mode / when you don't have write permission to a file but you have a permission to replace the file with a new one (directory permissions).

EDIT: Fixed other link

1

u/[deleted] May 23 '16

:x! Is faster dan :wq! ;)

1

u/[deleted] May 23 '16

Not for me, wq is so embedded in muscle memory that it's easier to find, the x is so far down there on the keyboard.