if 0 == 1
...
endif
Unfortunately, this gives errors when sourcing the file if some line (in the ... replacement) begins with a word like else or insert.
If someone has a block quote mechanism they can share that would be wonderful. If not, a way of finding all the words that can give problems (such as else, insert, ...) would be a good second best.
Barrie.
> --
> You received this message from the "vim_mac" 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
Barrie.
I'm pretty sure you can't do it in Vimscript.
If your comment is at the end of your file, though, you could put a
'finish' command before it.
Otherwise, the previous suggestion of using block-visual mode to insert
(with shift-I) or delete (d or x) a " from the beginning of all the
lines in the comment is, I think, the way to go.
I guess another possible way to avoid problems is to use :insert or
:append, and then :undo. But that's hardly elegant.
Ben.
P.S. This is a general Vim question, not a Mac-specific one, so you may
get more/better answers on the vim_use mailing list.
> On 16/04/11 7:00 PM, Barrie Stott wrote:
>> I gave the wrong subject! I want a block COMMENT - not a block QUOTE. I'm sorry about that.
>
> I'm pretty sure you can't do it in Vimscript.
Many thanks for the reply. I can almost do it but not quite. If I use ':while 0' to start the comment then I would have thought it would be looking only for :endwhile. This fails though if an 'insert' or 'append' is the first non-blank on a line.
> Otherwise, the previous suggestion of using block-visual mode to insert
> (with shift-I) or delete (d or x) a " from the beginning of all the
> lines in the comment is, I think, the way to go.
In principle I'd agree but it would then have to appear on the growing list of snippets that are used too infrequently for me to remember them. It's already becoming unwieldy.
> I guess another possible way to avoid problems is to use :insert or
> :append, and then :undo. But that's hardly elegant.
About on a par with :while ... :endwhile.
> P.S. This is a general Vim question, not a Mac-specific one, so you may
> get more/better answers on the vim_use mailing list.
Thank you for this; I'd never even considered it.
Barrie.
Sorry, but it's vim. Those are the commands. And it's not like it's some arcane combination of keys. The block selection is useful in other situations, as is using I to insert at the beginning of a line.
Otherwise, look into The NERD Commenter. It's a plugin. Gives you several different comment/uncomment commands, mappings for them, and I think it even adds a menu in Macvim.
> On Apr 16, 2011, at 9:46 AM, Barrie Stott <zen1...@zen.co.uk> wrote:
>>> Otherwise, the previous suggestion of using block-visual mode to insert
>>> (with shift-I) or delete (d or x) a " from the beginning of all the
>>> lines in the comment is, I think, the way to go.
>>
>> In principle I'd agree but it would then have to appear on the growing list of snippets that are used too infrequently for me to remember them. It's already becoming unwieldy.
>
> Sorry, but it's vim. Those are the commands. And it's not like it's some arcane combination of keys. The block selection is useful in other situations, as is using I to insert at the beginning of a line.
The problem is not with vim; I think it's an excellent program and have used it for many years. The problem is with me; some people have difficulty remembering how to do something when they haven't done it for a few days and I am now one of them.
Barrie.
Understood. Well that plugin I mentioned might be of some use. Otherwise maybe look into an editor that has more functions in menus for when you can't remember the key commands. Like BBEdit.
Though I must say I use 'i' for inserting all of the time in vim and visual mode gets used multiple times a day as well. So for me at least it's not really remembering any new commands...
The problem is not with vim; I think it's an excellent program and have used it for many years. The problem is with me; some people have difficulty remembering how to do something when they haven't done it for a few days and I am now one of them.
> If someone has a block quote mechanism they can share that would be wonderful.
i've gotten tons of mileage out of TComment (http://www.vim.org/scripts/script.php?script_id=1173).
-steve
--
http://five.sentenc.es
PGP 8477B706 (A92A 1F7E 6D76 16A0 BFF9 E61D AD54 0251 8477 B706)
>
> On Apr 16, 2011, at 4:45 AM, Barrie Stott wrote:
>
>> If someone has a block quote mechanism they can share that would be wonderful.
>
>
> i've gotten tons of mileage out of TComment (http://www.vim.org/scripts/script.php?script_id=1173).
I had been a bit put off by it saying that vimball would need updating for vim version 7, which is the one that I use. With your recommendation, I'l see what the difficulty is with vimball before writing things off.
Thanks for your email.
Barrie.
Thanks for mentioning this plugin. I like it more than Nerd commenter
and switched over.