Here is a macro that pads a whole line with 50 "-" chars:

imap ,t  <ESC>0D50gi-<ESC>0R<C-R>"<ESC>A

this pads a word to 10 spaces:

imap ,t  <ESC>diW10gi <ESC>9hR<C-R>"<ESC>A



--- Yakov Lerner <[EMAIL PROTECTED]> wrote:

> On 4/10/06, Hjellvik Vidar <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > how do I create a macro in vim that fills a line with '-'s from the end end
> of the line to e.g. position 50
> 
> Put the following into file x.vim:
>   let m="----------"
>   let x = m.m.m.m.m
>   map <F2> :%s/$/\=strpart(x,0,50-strlen(getline('.')))/<cr>
> 
> The open your text files,
>     :so x.vim
>     <F2>
> 
> Yakov
> 

Reply via email to