Vim: Implement gqq

Created on 30 Mar 2017  路  4Comments  路  Source: VSCodeVim/Vim

gq{motion} % format the line that {motion} moves over
{Visual}gq % format the visually selected area
gqq        % format the current line
kinfeature

Most helpful comment

@andschwa That's because gq was implemented as a command, and only operators support applying them over a region.

Thus, I just implemented it as an operator :smile:

All 4 comments

(And, of course, things like 5gqq to format the next five lines.)

Specifically for me, gq} is broken. While I can visually select some lines and run gq and that works, I can't just go to the top of my comment and run gq}, even though the cursor moves appropriately, the wrapping does not happen. The roadmap states that gq{motion} is implemented, but it appears broken.

Until this is implement, you can also emulate this with:

    "vim.otherModesKeyBindingsNonRecursive": [
        {
            "before": [
                "g",
                "q",
                "q"
            ],
            "after": [
                "V",
                "g",
                "q"
            ]
        }
    ]

@andschwa That's because gq was implemented as a command, and only operators support applying them over a region.

Thus, I just implemented it as an operator :smile:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajinder-yadav picture rajinder-yadav  路  3Comments

orn688 picture orn688  路  3Comments

cckowin picture cckowin  路  3Comments

lucastheisen picture lucastheisen  路  3Comments

spinningarrow picture spinningarrow  路  3Comments