Re: [Help]How can I add some char before a block?

2007-04-13 Thread Xi Juanjie

To comment/uncomment a visual block, just type \x.
and also you can map this key to any other keys

dan123 wrote:



dan123 wrote:



Xi Juanjie wrote:
If you just want to comment/uncomment your source in a easy way, try 
this plugin EnhancedCommentify



I am a newbie. How to use it? I installed it like described. E.g. what
should I write  as Plug if I like to comment a visual block?
 Thanks
   Daniel



Is this the way to use it?
:map C-F6 ESC:','call EnhancedCommentify('no', 'Comment')CRj

  dan


Re: [Help]How can I add some char before a block?

2007-04-13 Thread dan123



Xi Juanjie wrote:
 
 To comment/uncomment a visual block, just type \x.
 and also you can map this key to any other keys
 
 dan123 wrote:
 
 
 dan123 wrote:


 Xi Juanjie wrote:
 If you just want to comment/uncomment your source in a easy way, try 
 this plugin EnhancedCommentify

 I am a newbie. How to use it? I installed it like described. E.g. what
 should I write  as Plug if I like to comment a visual block?
  Thanks
Daniel

 
 Is this the way to use it?
 :map C-F6 ESC:','call EnhancedCommentify('no', 'Comment')CRj
 
   dan
 
 

Thanks a lot!


-- 
View this message in context: 
http://www.nabble.com/-Help-How-can-I-add-some-char-before-a-block--tf3569153.html#a9974258
Sent from the Vim - General mailing list archive at Nabble.com.



Re: [Help]How can I add some char before a block?

2007-04-13 Thread Dimitar
I normally use a plugin for commenting:
http://www.vim.org/scripts/script.php?script_id=23
For inserting chars before a block I use ctrl-v 
and then I to insert code.

,
Dimitar


* 陈方荣 [EMAIL PROTECTED] [070413 07:10]:
 Hi all,
     How can I add some char before a block?
     Just like C++ comment.
     
     Before:
     Comment line1
     Comment line2
     Comment line3
     Comment line4
 
     After:
     //Comment line1
     //Comment line2
     //Comment line3
     //Comment line4
     
 Thanks.
 
 ---
 Best regards
 chenfangrong
 
 


[Help]How can I add some char before a block?

2007-04-12 Thread 陈方荣
Hi all,
    How can I add some char before a block?
    Just like C++ comment.
    
    Before:
    Comment line1
    Comment line2
    Comment line3
    Comment line4

    After:
    //Comment line1
    //Comment line2
    //Comment line3
    //Comment line4
    
Thanks.

---
Best regards
chenfangrong




Re: [Help]How can I add some char before a block?

2007-04-12 Thread Ricky Zhou
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

陈方荣 wrote:
 Hi all,
 How can I add some char before a block?
 Just like C++ comment.
Use V to select the block you want, then type :s/^/\/\//

Hope this helps,
Ricky
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGHtjniXbZ7NjlUcARAobAAJ41JhevS6njMUaTVPSTbsuaOb5LcQCg5Uek
g90dvl8/hixZlSWmhlCWax8=
=r5cj
-END PGP SIGNATURE-


Re: [Help]How can I add some char before a block?

2007-04-12 Thread Easwy Yang

:help CTRL-V
or
:help CTRL-V-alternative
and then :help blockwise-operators, :help v_b_I_example

or you can try The NERD Commenter plugin:
http://www.vim.org/scripts/script.php?script_id=1218

Hope it helps.

Easwy

2007/4/13, Ricky Zhou [EMAIL PROTECTED]:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

陈方荣 wrote:
 Hi all,
 How can I add some char before a block?
 Just like C++ comment.
Use V to select the block you want, then type :s/^/\/\//

Hope this helps,
Ricky
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGHtjniXbZ7NjlUcARAobAAJ41JhevS6njMUaTVPSTbsuaOb5LcQCg5Uek
g90dvl8/hixZlSWmhlCWax8=
=r5cj
-END PGP SIGNATURE-



Re: [Help]How can I add some char before a block?

2007-04-12 Thread Xi Juanjie
If you just want to comment/uncomment your source in a easy way, try 
this plugin EnhancedCommentify


陈方荣 wrote:

Hi all,
How can I add some char before a block?
Just like C++ comment.

Before:

Comment line1
Comment line2
Comment line3
Comment line4

After:
//Comment line1
//Comment line2
//Comment line3
//Comment line4

Thanks.


---
Best regards
chenfangrong




Re: [Help]How can I add some char before a block?

2007-04-12 Thread Tim Chase
 How can I add some char before a block? Just like C++
 comment.
 
 Use V to select the block you want, then type :s/^/\/\//

You can make this a little easier/shorter to type by using

:s!^!//

The alternative delimiters (you can use a variety of characters,
though I tend to choose !, @, or #) allow you to include
certain characters without concern for having to escape the
primary delimiter.

There's also blockwise-visual mode:

:help v_b_I

which can also be an easy/lazy way to do it, especially if you're
already in blockwise-visual mode.

-tim





Re: 答复: [Help]How can I add some char before a block?

2007-04-12 Thread Steven Woody

On 4/13/07, 陈方荣 [EMAIL PROTECTED] wrote:


---
Best regards
陈方荣
 -邮件原件-
 发件人: Tim Chase [mailto:[EMAIL PROTECTED]
 发送时间: 2007年4月13日 :09:44
 收件人: Ricky Zhou
 抄送: 陈方荣; Vim
 主题: Re: [Help]How can I add some char before a block?

  How can I add some char before a block? Just like C++
  comment.
 
  Use V to select the block you want, then type :s/^/\/\//

 You can make this a little easier/shorter to type by using

   :s!^!//

 The alternative delimiters (you can use a variety of characters,
 though I tend to choose !, @, or #) allow you to include
 certain characters without concern for having to escape the
 primary delimiter.

 There's also blockwise-visual mode:

   :help v_b_I

 which can also be an easy/lazy way to do it, especially if you're
 already in blockwise-visual mode.

 -tim




It's work.
Thanks.





comment is not a mechinism designed to erase codes.  using #if 0 ...
#endif to erase a block of code. it's the right way and looks clean.

--
woody

then sun rose thinly from the sea and the old man could see the other
boats, low on the water and well in toward the shore, spread out
across the current.


OT: [Help]How can I add some char before a block?

2007-04-12 Thread panshizhu
陈方荣 [EMAIL PROTECTED] 写于 2007-04-13 09:08:49:
 Hi all,
     How can I add some char before a block?
     Just like C++ comment.

     Before:
     Comment line1
     After:
     //Comment line1
 Thanks.

Offtopic:

Generally, use comment character to comment out real code is not considered
a good programming style.
because comment should be comments, and there should be only real
comments inside the comments.

use #if 0 and #endif to comment out your code is a prefered way.

--
Sincerely, Pan, Shi Zhu. ext: 2606

Re: [Help]How can I add some char before a block?

2007-04-12 Thread dan123



Xi Juanjie wrote:
 
 If you just want to comment/uncomment your source in a easy way, try 
 this plugin EnhancedCommentify
 

I am a newbie. How to use it? I installed it like described. E.g. what
should I write  as Plug if I like to comment a visual block?
 Thanks
   Daniel
-- 
View this message in context: 
http://www.nabble.com/-Help-How-can-I-add-some-char-before-a-block--tf3569153.html#a9973027
Sent from the Vim - General mailing list archive at Nabble.com.



Re: [Help]How can I add some char before a block?

2007-04-12 Thread dan123



dan123 wrote:
 
 
 
 Xi Juanjie wrote:
 
 If you just want to comment/uncomment your source in a easy way, try 
 this plugin EnhancedCommentify
 
 
 I am a newbie. How to use it? I installed it like described. E.g. what
 should I write  as Plug if I like to comment a visual block?
  Thanks
Daniel
 

Is this the way to use it?
:map C-F6 ESC:','call EnhancedCommentify('no', 'Comment')CRj

  dan
-- 
View this message in context: 
http://www.nabble.com/-Help-How-can-I-add-some-char-before-a-block--tf3569153.html#a9973243
Sent from the Vim - General mailing list archive at Nabble.com.