Waffelson@lemmy.world to linuxmemes@lemmy.world · 1 year ago:wq!lemmy.worldimagemessage-square109fedilinkarrow-up1212arrow-down171
arrow-up1141arrow-down1image:wq!lemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 1 year agomessage-square109fedilink
minus-square👍Maximum Derek👍@discuss.tchncs.delinkfedilinkEnglisharrow-up19arrow-down2·1 year ago:ggdGwq (please don’t do this)
minus-squareJustinAngel@lemmy.worldlinkfedilinkarrow-up14arrow-down1·1 year agoVIM Golf… Same outcome, fewer strokes: %d|wq
minus-squareitslilith@lemmy.blahaj.zonelinkfedilinkarrow-up5arrow-down1·1 year agoyou can replace wq with x :%d|x
minus-squareMiku Luna \ she/it@lemmy.blahaj.zonelinkfedilinkarrow-up11·1 year agoE492: Not an editor command: ggdGwq
minus-squareIgnotum@lemmy.worldlinkfedilinkarrow-up10·1 year 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-squarefiliberto_kunstlinger@lemmy.worldlinkfedilinkarrow-up12·edit-21 year 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-squareMiku Luna \ she/it@lemmy.blahaj.zonelinkfedilinkarrow-up15·1 year 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-squareVictor@lemmy.worldlinkfedilinkarrow-up7·1 year agoExactly. The colon needs to be just before the w, not at the front of the sequence…
minus-squareCaptainBlagbird@lemmy.worldlinkfedilinkarrow-up5·1 year agoAnd while you’re at it, throw an ESC in there at the beginning, will ya?
minus-squareVictor@lemmy.worldlinkfedilinkarrow-up2·1 year agoIf you want to cover every case (mode), indeed. 😊
minus-square👍Maximum Derek👍@discuss.tchncs.delinkfedilinkEnglisharrow-up3·1 year agoyeah, I screwed it up
minus-squarei_am_tired_boss@lemmy.worldlinkfedilinkarrow-up2arrow-down1·1 year agoggdGZZ This actually does what you intend to do. On nvim atleast.
:ggdGwq (please don’t do this)
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. 😊
yeah, I screwed it up
Huh… I always just used :1
ggdGZZ
This actually does what you intend to do. On nvim atleast.