Sunday, July 28, 2013

Re: Mapping Macro using smartindent

On Monday, July 29, 2013 3:45:56 AM UTC+2, Ben Fritz wrote:
> On Sunday, July 28, 2013 9:09:42 AM UTC-5, Sven Kämpf wrote:
>
> > Hello,
>
> >
>
> >
>
> >
>
> > I try to speed up writing using mappings.
>
> >
>
> > Smartindent
>
> > is on, but doesn't
>
> > work appropriatly.
>
> >
>
> >
>
> >
>
> > Example:
>
> >
>
> >
>
> >
>
> > Assume the following mapping:
>
> >
>
> >
>
> >
>
> > imap {
>
> > {}<Esc>i<CR><Esc>ko
>
> >
>
>
>
> I suggest using cindent instead of smartindent. Or better yet, "filetype plugin indent on" in your .vimrc.
>
>
>
> smartindent is not so smart sometimes.

Thank you for your suggestions, but unfortunately it didn't work.

Another Example:

If I type:

<Space><Space>go<CR>{}

...in insert mode, than the following appears:

^__go
^__{}

('^' -> start of line, '_' -> space)

But If I make a mapping like this:

inoremap <Leader>go go<CR>{}

...and I type:

<Space><Space><Leader>go

...in insert mode, then the following appears:

^__go
^{}

It looks like indentation wouldn't work in mappings, right?

If so, what options do I have to solve this problem?

THX in advance.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment