Skip to content

Visual mode repeat #48

Open
Open

Description

@wincent

I was trying to make these mappings repeatable:

xnoremap < <gv
xnoremap > >gv

My initial stab at this was:

xnoremap <silent> <Plug>DedentAndReselect <gv
      \ :silent! call repeat#set("\<Plug>DedentAndReselect")<CR>
xmap < <Plug>DedentAndReselect

Alas, entering command mode in order to invoke repeat#set knocks us out of visual mode, undoing the desired effect of the gv.

I tried a number of different hacky workarounds in an attempt to get this to work, but without success.

Does this seem like something that should be possible with vim-repeat?

Activity

  1. FrigoEU commented on Mar 3, 2016

    @FrigoEU

    I've been trying to repeat a visual mode move, like this:

    vnoremap mj :m '>+1<CR>:call repeat#set("mj", v:count)<CR>gv
    

    but I haven't been able to get it to work. Not sure if I'm doing something wrong or it's just not supported, but any help is much appreciated!

  2. absorber commented on Jul 31, 2016

    @absorber

    Same here, I think.

    For example, when editing an example HTML file:

    1. I v2e so that vim selects 2 words (although for this example I could just as well selected 1 word)
    2. Then S<b> so that those 2 words get wrapped in bold tags.
    3. Place the cursor on a word which doesn't have those tags.
    4. Press .

    That should result in placing the 2 words following the cursor in bold tags like they did the other 2 words. But unfortunately it repeats an action unrelated to the plugin.

  3. wincent commented on Dec 28, 2017

    @wincent
    Author

    Looks like somebody made a plug-in for this, although I haven't tried it: http://www.vim.org/scripts/script.php?script_id=3848

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions