auto indent

24 прегледа
Пређи на прву непрочитану поруку

Eliza

непрочитано,
27. 8. 2019. 00:29:1627.8.19.
– vim...@googlegroups.com
Hi,

How to disable auto indent globally when pasting a piece of code into VIM?

thanks

wsd...@163.com

непрочитано,
27. 8. 2019. 04:34:2127.8.19.
– vim...@googlegroups.com
you can use set paste

Eliza

непрочитано,
27. 8. 2019. 04:54:1827.8.19.
– vim...@googlegroups.com
yes. The first time I used "set noautoindent" but found not much useful.
Then I searched and found "set paste" which did work fine.
How to setup it by global? thanks.

on 2019/8/27 14:49, wsd...@163.com wrote:
> you can use set paste

Tony Mechelynck

непрочитано,
27. 8. 2019. 05:12:1527.8.19.
– vim_use
On Tue, Aug 27, 2019 at 10:54 AM Eliza <e...@chinabuckets.com> wrote:
>
> yes. The first time I used "set noautoindent" but found not much useful.
> Then I searched and found "set paste" which did work fine.
> How to setup it by global? thanks.

You shouldn't set it permanently, because it has a lot of
side-effects: it sets a lot of options to off or to 0, and in
addition, in 'paste' mode, mappings don't work.

What you can do is ":set paste" just before pasting and ":set nopaste"
afterwards. Or use a 'pastetoggle' as explained in the help.

Best regards,
Tony.

Eliza

непрочитано,
27. 8. 2019. 05:23:1927.8.19.
– vim...@googlegroups.com
Hi

on 2019/8/27 17:11, Tony Mechelynck wrote:
> You shouldn't set it permanently, because it has a lot of
> side-effects: it sets a lot of options to off or to 0, and in
> addition, in 'paste' mode, mappings don't work.
>
> What you can do is ":set paste" just before pasting and ":set nopaste"
> afterwards. Or use a 'pastetoggle' as explained in the help.

that's right. thanks.

Paul

непрочитано,
31. 8. 2019. 11:55:3931.8.19.
– vim_use
On Tue, Aug 27, 2019 at 11:11:56AM +0200, Tony Mechelynck wrote:
>What you can do is ":set paste" just before pasting and ":set nopaste"
>afterwards. Or use a 'pastetoggle' as explained in the help.

Another option is to make use of bracketed paste, if possible: https://cirw.in/blog/bracketed-paste
signature.asc
Одговори свима
Одговори аутору
Проследи
0 нових порука