News for hackers. Stuff that matters.
Re:Programmer Tooling Beyond Plain Text by unhammer on Wednesday May 06, 2015 @03:06AM (#9496995)
Isn't d% a more likely vim command?

Although, you'd think vim would have a general "transpose text object" operator. If it were bound to some ŧ, then you could just do %ŧ% (here emulating Emacs' C-M-f C-M-t)

Re:Programmer Tooling Beyond Plain Text by lloeki on Wednesday May 06, 2015 @04:15AM (#9497202)
Short of having a transpose verb, here is what I cape up with (using the arg text objext):

    dia      # 1. delete argument under caret
    df       # 2. delete separator (comma and space)
    %        # 3. move after argument (i.e to end of tuple)
    p        # 4. paste separator
    "2p      # 5. paste argument
I'm not doing this out of the desire of golfing but to analyse and point out that what vim lacks in this specific case is how to semantically do step 3 (ga/gA ?) and possibly step 2 (because what if there's no space? a "separator", like "surround", might be useful), upon which one could easily and semantically build a "ŧa" (transpose argument) sequence (which could also become ŧ2a, ŧ3a to swap with the second or third next argument, and capitalize the a to swap with the previous).

That said vim is still "only" a text editor, but it goes a long way at being a general purpose one with semantic operations.

Re:Programmer Tooling Beyond Plain Text by titanomachy on Wednesday May 06, 2015 @03:38AM (#9497086)
Thinking structurally, I would use `da(`. Of course, `d%` is less keystrokes.