On Nov 18, 9:09 pm, Tim Johnson <[EMAIL PROTECTED]> wrote:
> Using vim 7.1 (huge version) on Kubuntu 7.10
>
>  I would like to be able to type <enter> or Ctrl-J
>  in insert mode and open a new line indented one
>  more tab than the previous:
>  example - type "block: []"
>  move cursor between the braces
>  type Ctrl-J
>  result might be:
>  block: [
>      ]
> alternatively, a normal mode approach would be as desirable.
>
>  Any references to discussions on this topic, Help commands
>  or plugins would be welcome.
> thanks
> tim

I would first suggest using an indentexpr or the indent ftplugin for
your file type. See :help 'indentexpr' and :help :filetype-indent-on

If this doesn't work for you, a simple mapping will suffice.

I would suggest:
:imap <C-CR> <CR><C-I>
:imap <C-S-CR> <CR><C-D>

This will allow you to press CTRL-ENTER for a new line with more
indent, and CTRL-SHIFT-ENTER for a new line with less indent.

These keys are not taken by any built-in functionality that I can find.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to