Waffelson@lemmy.world to linuxmemes@lemmy.world · 11 months ago:wq!lemmy.worldimagemessage-square102fedilinkarrow-up1214arrow-down173
arrow-up1141arrow-down1image:wq!lemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 11 months agomessage-square102fedilink
minus-square👍Maximum Derek👍@discuss.tchncs.delinkfedilinkEnglisharrow-up18arrow-down2·11 months ago:ggdGwq (please don’t do this)
minus-squareJustinAngel@lemmy.worldlinkfedilinkarrow-up14arrow-down1·11 months agoVIM Golf… Same outcome, fewer strokes: %d|wq
minus-squareIgnotum@lemmy.worldlinkfedilinkarrow-up11·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-squarefiliberto_kunstlinger@lemmy.worldlinkfedilinkarrow-up13·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-squaresurewhynotlem@lemmy.worldlinkfedilinkarrow-up2·11 months ago gg Huh… I always just used :1
minus-squarei_am_tired_boss@lemmy.worldlinkfedilinkarrow-up2arrow-down1·11 months 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
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
Huh… I always just used :1
ggdGZZ
This actually does what you intend to do. On nvim atleast.