On Mon, Sep 10, 2012 at 05:56:52AM -0500, Tim Chase wrote:
> On 09/10/12 02:31, William Robertson wrote:
> > On Monday, September 10, 2012 2:45:48 AM UTC+1, Tim Chase wrote:
> >>> !cal
> >>> How can I get it placed in the current document?
> >>
> >>   :r! cal
> > 
> > Interesting - I've always used "!!" (possibly that's from classic vi), as in
> > 
> > !!cal
> > 
> > which I see Vim translates into
> > 
> > :.!cal

> The main problem with that is it replaces the current line's
> contents with the output of cal.

>  bash$ seq 20 | vi -
>  5G           " go to line 5
>  !!cal        " read in the calendar

> Notice that the line containing "5" is now missing from your document.

in the Who Cares!?! department we have this:  Bee might conceivably be
interested in a slightly fancier calendar, one with today's date
"circled", with the time of day under it, thrown into insertmode, all
by just pressing shift-F7

of course it uses python -- not a python enabled vim, but python needs
to be available

put the following in your vimrc:

    nnoremap <silent> <S-F7> :call Acdmo()<CR>
    inoremap <silent> <S-F7> <ESC>:call Acdmo()<CR>

    function! Acdmo()
        read! ~/py/currmo 38
        let im = strftime("%H:%M")
        call append(line("."), "")
        call append(line("."), im)
        call append(line("."), "")
        normal 3j
        startinsert
    endfunction

and put

    https://github.com/toothpik/toothpik-s-.vimrc/blob/master/py/currmo

in your ~/py path

it makes a nice blog header IMHO

sc

-- 
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