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

Re: Shifting multiple lines of code in Insert mode

Expand Messages
  • Benji Fisher
    ... This is the sort of thing that Normal mode is for. If you could do anything from any mode, there would be no reason to have different modes. If this is
    Message 1 of 3 , Sep 30 6:55 PM
    • 0 Attachment
      Joshua Moore-Oliva wrote:
      >
      > When in insert mode, how does one go about Shifting multiple lines of
      > code?
      >
      > I know that Ctrl + T and Ctrl + D shift and unshift the current *line*
      > of text but how does one shift the current selection or multiple lines
      > while in insert mode?

      This is the sort of thing that Normal mode is for. If you could do
      anything from any mode, there would be no reason to have different modes.

      If this is something that you find yourself doing a lot, you can certainly
      make a map for it. For example:

      :imap <A-t> <C-O>>ap
      :imap <A-d> <C-O><ap

      (There is plenty of room for improvement...)

      :help :imap
      :help map-modes
      :help i_ctrl-o
      :help >
      :help text-objects
      :help =

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