Loading ...
Sorry, an error occurred while loading the content.

blockwise visual mode in a mapping?

Expand Messages
  • Peter Bismuti
    I can t get blockwise visual mode (CTRL-V) to work in a mapping. Can someone please tell me how I can do this? I m trying to indent a block of code by using
    Message 1 of 2 , Apr 2, 2001
    • 0 Attachment
      I can't get blockwise visual mode (CTRL-V) to work in a mapping.
      Can someone please tell me how I can do this? I'm trying to indent
      a block of code by using BVM and the "I" command. Perhaps there is
      a better way of doing this?

      Thx as always


      _____________________________________________________________________
      | |
      | Pete Bismuti |
      | Department of Computer Science |
      | Florida State University |
      | bismuti@... (850) 644-6835 |
      |_____________________________________________________________________|
    • Benji Fisher
      ... Exactly what are you trying to do, and what did you try? I did map 0 jjI and then F9 indented three lines, as expected (starting in
      Message 2 of 2 , Apr 2, 2001
      • 0 Attachment
        Peter Bismuti wrote:

        > I can't get blockwise visual mode (CTRL-V) to work in a mapping.
        > Can someone please tell me how I can do this? I'm trying to indent
        > a block of code by using BVM and the "I" command. Perhaps there is
        > a better way of doing this?
        >
        > Thx as always

        Exactly what are you trying to do, and what did you try? I did

        map <F9> 0<C-V>jjI<Tab><Esc>

        and then F9 indented three lines, as expected (starting in Normal mode).
        You could also do

        >2<CR>

        (starting from Normal mode) or

        :.,.+2s/^/\t

        or lots of other things.

        :help >
        :help :s

        Note that, if you start in Normal mode and type 3: then you get

        :.,.+2

        on the command line automatically.

        HTH
        --Benji Fisher
      Your message has been successfully submitted and would be delivered to recipients shortly.