Basically, I would like to insert sentence(s) at several positions in my
document. The sentences are quite random. It can be inserting lines of
sentences or just a character of \<NL> that is a new line. I have a list of
sentences and the position where I should place the sentences. So, I guess
the best thing to do is use 'goto' and then use 'normal i'.my sentences.
For my function, I want the insertion of \<NL> should be preceded by an
indent, so that if there is insertion later, I don't need to check whether
there is a tab or not.
However, for insertion of many sentences, I just want it copy blindly what
the list says. If there is a indent at the front, then my document should
have. If no indent, then my document should not have one.

Is there a way to turn on and off this auto indent?
I tried to turn off autoindent and smartindent before doing my function, but
no luck.

Anna

On Thu, Nov 12, 2009 at 6:25 PM, Christian Brabandt <[email protected]>wrote:

>
> On Thu, November 12, 2009 10:09 am, anna wrote:
> > I find that "o" and ":normal o" have different effect. I don't know
> > whether it is intentional or not.
> > When I have a line preceded with tab, then "o" will give me a new line
> > that is preceded with tab. Bue, ":normal o" will give me a new line
> > without tab.
>
> I believe, if you simply enter normal o you will open a new line below
> the current line, enter insert mode and immediately leave insert mode
> again. So you are left in normal mode again. And since you did not enter
> anything the indent is deleted. Its like pressing o and immediately
> pressing <ESC>.
>
> Depending on what your want to change, normal o might not be the best
> way to go. But you would need to explain, what how much you like to
> enter inside your function, so we can give you an advice.
>
> regards,
> Christian
> --
> :wq
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to