Hi Tim!

On Tue, 28 Feb 2012 06:02:21 -0600, Tim Chase wrote:
On 02/28/12 05:41, [email protected] wrote:
[..]
There are two possibilities that occur to me.  The first is if you
want the *whole* line underlined.  There are lots of ways you can do
this.  I personally use

  :t.|s/./-/g

Sounds good.

(which could be wrapped up in a macro) because it doesn't tromp my
scratch register. I know other people use a macro that does something
like

  YpVr-

to "Y"ank the current line, "p"aste it, "V"isualize the line, and
"r"eplace each character in that selection with a "-".  Note that
changes your scratch/yank registers' contents.

Thats so easy if I see it now! Thanks!


You can map them something like

  :nnoremap <leader>- :t.<bar>s/./-/g<cr>
  :nnoremap <leader>= YpVr=

so you can (by default, based on your 'mapleader' setting) type

  \=

to underline the current line with "="s.  I put in both styles so you
can see how each would work, but I'd pick the one that's clearest to
you and stick with it for both cases.

Ok, thanks.

I modified the command to "Ypwv$r=", so ich moved to the next "word" (let the comment marker alive), then marked with standard marker v (not V for whole line) up to the end ("$"), then replacing it :-)



The other case regards visually marking a sub-portion of a line as
underlined such as

   I only want this part underlined, okay?
               --------------------

That's a lot harder, so if it's what you want, time can be taken to
cook up something, but there are some non-trivial edge-cases that
would have to be addressed.

Thats not necessary. For Markdown-Syntax the example above is full functionally.

Thanks a lot!

Regards,
Oliver

--
You received this message from the "vim_use" 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

Reply via email to