Skip to content

Keep selection highlighted #299

Answered by numToStr
Imlimp asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, by using post_hook.

local U = require('Comment.utils')

require('Comment').setup({
    post_hook = function(ctx)
        -- Check whether we were in VISUAL mode
        if ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then
            vim.cmd('norm! gv')
        end
    end,
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Imlimp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants