how use surround.vim

30 views
Skip to first unread message

王军

unread,
Oct 31, 2012, 11:00:38 PM10/31/12
to vim...@googlegroups.com

Hi,everyone

         I use surround.vim.

         I want it can do like this:

        

         Old:

         GT_SI                 <=#`DELAY 0 ;

        

         New:

         begin

                   GT_SI                 <=#`DELAY 0 ;

         End

 

         How can I do?

         Thank you !

 

Alick Zhao

unread,
Nov 1, 2012, 3:53:14 AM11/1/12
to vim...@googlegroups.com, wangju...@gmail.com
After looking through the doc of surround plugin (surround.txt), I think
you might want to add the following line into your .vimrc:

let g:surround_45 = "begin \r End"

Then use ySS- to achive what you want.

See :help surround.txt for more details.

Alick

王军

unread,
Nov 1, 2012, 4:22:58 AM11/1/12
to Alick Zhao, vim...@googlegroups.com
I see its help.
If let g:surround_45 = "begin \r End",it can be :

Begin GT_SI <=#`DELAY 0 ; end

Not:
begin
GT_SI <=#`DELAY 0 ;
End
-----邮件原件-----
发件人: Alick Zhao [mailto:alic...@gmail.com]
发送时间: 2012年11月1日 15:53
收件人: vim...@googlegroups.com
抄送: wangju...@gmail.com
主题: Re: how use surround.vim

Alick Zhao

unread,
Nov 1, 2012, 6:01:42 AM11/1/12
to 王军, vim...@googlegroups.com
Bring the conversation back to the list.
(Sorry for my failing to cc the list in the previous mail.)


On Thu, 1 Nov 2012 17:24:53 +0800, 王军 wrote:
> But how delete begin-end when use ySS- ?

Seems we cannot delete the pair in one step with surround.
(Please point it out if I am wrong.)
However you can just use dd twice instead in this particular situation.

>
> -----邮件原件-----
> 发件人: Alick Zhao [mailto:alic...@gmail.com]
> 发送时间: 2012年11月1日 17:19
> 收件人: 王军
> 主题: Re: 答复: how use surround.vim
>
> On Thu, 1 Nov 2012 16:22:58 +0800, 王军 wrote:
>> I see its help.
>> If let g:surround_45 = "begin \r End",it can be :
>>
>> Begin GT_SI <=#`DELAY 0 ; end
>>
>> Not:
>> begin
>> GT_SI <=#`DELAY 0 ;
>> End
>
> I see letter case mismatch in your reply.
> What was your command? You need captical S (Shift+S) to make the wrap operation linewise, instead of character-wise.
Reply all
Reply to author
Forward
0 new messages