You're viewing a single thread.
:ggdGwq (please don't do this)
21 2 ReplyVIM Golf.... Same outcome, fewer strokes:
%d|wq
15 1 Replyyou can replace wq with x
:%d|x
7 1 ReplyOnly in Vim, not in Vi.
5 0 Reply
E492: Not an editor command: ggdGwq
12 0 ReplyI use Vim daily, and i have absolutely no clue what that command would do, what would it do? Delete the document, save and quit?
11 0 Replyexactly.
gg -> go to top of document
d -> delete (actually, it's cut, but it destroys the mnemonic)
G -> here is a modifier to "d" and tells it do "delete until end of document"
w -> write current state of buffer to disk
q -> exit program
15 0 ReplyActually not, binds and commands aren't the same.
ggdG
only works as a series of inputs, whilewq
only works as a command (with the colon).17 0 ReplyExactly. The colon needs to be just before the
w
, not at the front of the sequence...8 0 ReplyAnd while you're at it, throw an
ESC
in there at the beginning, will ya?6 0 ReplyIf you want to cover every case (mode), indeed. 😊
2 0 Reply
yeah, I screwed it up
3 0 Reply
gg
Huh.. I always just used :1
2 0 Reply
ggdGZZ
This actually does what you intend to do. On nvim atleast.
2 1 Reply