The answers so far are very good and should help you a lot, but to expand some on one of your questions:
On Nov 23, 10:52 am, David <[EMAIL PROTECTED]> wrote: > Here is the problem I started with at the beginning of my 2 hours of > frustration: > I tried Unix>vim>following_command > > :.!date " and here I put a comment > > and received error messages. > The problem is not, as I mistakenly thought, with the comment symbol, > but, as you experts undoubtedly realise instantly, with the fact that > vim is feeding back the whole line > > date " and here I put a comment > > to the Unix shell for interpretation. This brings me to my final > question: > Q8. Is there any way of telling vim not to feed the whole line to the > Unix shell, but only the initial part? I tried shielding the comment > part by inserting a | as shown to me by the vim online help response > to :help comment, but it didn't work. (This all occurs in something I > am trying to automate in a source file of vim commands, and that's why > I do want to include a comment. There are many contexts in which a comment marker is passed to the command. Incidentally, all of these commands are also commands which you cannot string together with a | character. See :help :bar for the full list. If you keep reading, you can see that the easiest way to get around this, allowing you to use | or " with the commands in this list, is to put the command in a string and execute it with the :execute command (:help :execute). For example, your problem would be solved like this: :execute ".!date" " and here I put a comment > I suppose I could give up and put the > comment elsewhere, where vim would find it less puzzling, but a human > reader would find it more puzzling.) > I personally find it even more readable when a comment occurs just above the line to which it refers. This additionally allows for longer comments when you constrain yourself to a certain line length. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
