@[email protected] to [email protected] • 11 months ago:wq!lemmy.worldmessage-square115fedilinkarrow-up1226
arrow-up1156image:wq!lemmy.world@[email protected] to [email protected] • 11 months agomessage-square115fedilink
minus-square@[email protected]linkfedilink13•11 months agoVIM Golf… Same outcome, fewer strokes: %d|wq
minus-squareIgnotumlinkfedilink11•11 months agoI use Vim daily, and i have absolutely no clue what that command would do, what would it do? Delete the document, save and quit?
minus-square@[email protected]linkfedilink15•edit-211 months agoexactly. 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
minus-squaremeowlinkfedilink17•11 months agoActually not, binds and commands aren’t the same. ggdG only works as a series of inputs, while wq only works as a command (with the colon).
minus-squareVictorlinkfedilink8•11 months agoExactly. The colon needs to be just before the w, not at the front of the sequence…
minus-squareCaptainBlagbirdlinkfedilink6•11 months agoAnd while you’re at it, throw an ESC in there at the beginning, will ya?
minus-squarei_am_tired_bosslinkfedilink1•11 months agoggdGZZ This actually does what you intend to do. On nvim atleast.
Removed by mod
VIM Golf… Same outcome, fewer strokes:
%d|wq
you can replace wq with x
:%d|x
Only in Vim, not in Vi.
E492: Not an editor command: ggdGwq
I use Vim daily, and i have absolutely no clue what that command would do, what would it do? Delete the document, save and quit?
exactly.
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
Actually 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).Exactly. The colon needs to be just before the
w
, not at the front of the sequence…And while you’re at it, throw an
ESC
in there at the beginning, will ya?If you want to cover every case (mode), indeed. 😊
Removed by mod
Huh… I always just used :1
ggdGZZ
This actually does what you intend to do. On nvim atleast.