Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 577621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:10:23+00:00 2026-05-13T14:10:23+00:00

The useful command :r!date is not so useful in gVim for Windows (not Cygwin’s

  • 0

The useful command

:r!date

is not so useful in gVim for Windows (not Cygwin’s gVim) because Windows has its own date function which does not do what I want.

So, something like

:r!c:\cygwin\bin\date

would be great. But that’s a lot to type. And considering that I might want to call a few things this way, it would be nice to write a function, which I could pass an argument foo and it would run

:r!c:\cygwin\bin\foo

What’s the best way to do this? It should be:

  1. Permanent: stored in .vimrc or some startup file.
  2. Executed with as few keystrokes as possible.

Any suggestions for good places to create mappings are appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:10:23+00:00Added an answer on May 13, 2026 at 2:10 pm

    I think, a simpler solution for day-to-day use (especially if you are
    interested in only one of the many system-like commands) would be
    creating a custom synonym-command:

    :command! -nargs=1 -range=% RR <line1>,<line2>read! c:\cygwin\bin\<args>
    

    This tells Vim to create a new command named RR that accepts a range
    and one (mandatory) argument. The command just passes arguments to
    read! prepending c:\cygwin\bin\ to the argument.

    You could even provide a file completion for the files in c:\cygwin\bin\
    directory. All you need for that to work is to create completion-list
    function like this:

    function! RRComplete(A, L, P)
        return system('dir /b /l c:\cygwin\bin')
    endfunction
    

    and then specify the name of that function when creating the command:

    :command! -nargs=1 -complete=custom,RRComplete -range=% RR <line1>,<line2>read! c:\cygwin\bin\<args>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 287k
  • Answers 287k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer there's an error in your form class. The fields should… May 13, 2026 at 5:09 pm
  • Editorial Team
    Editorial Team added an answer There is an event handler MouseLeftMouseButton. When the event handler… May 13, 2026 at 5:09 pm
  • Editorial Team
    Editorial Team added an answer I'm not sure that I understand all the details in… May 13, 2026 at 5:09 pm

Related Questions

Emacs has a useful transpose-words command which lets one exchange the word before the
Is there any bash command that will let you get the nth line of
Here I make a new column to indicate whether myData is above or below
I was hoping: cp -R src/prog.js images/icon.jpg /tmp/package would yield a symmetrical structure in
I recently converted a ruby library to a gem, which seemed to break the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.