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 7762803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:30:05+00:00 2026-06-01T14:30:05+00:00

Recently, I use Vim as my editor while programming Ruby, but I don’t know

  • 0

Recently, I use Vim as my editor while programming Ruby, but I don’t know if I can do that in Vim. Let’s say in my Vim, I already have 2 vertical split windows named A and B like this:

split window

And then I hit gf to jump to the source file xyz.rb if I park the cursor under the require statement, but it will show in the same window A by default.

Is there any shortcuts or quick combo that I can open or show the source file xyz.rb in the opened B split window? (and even if the window B doesn’t exist yet, create one automatically)

I’ve check the manual, and it does has some ways to show xyz.rb in different horizontal split window or a new tab, but is it possible if I want to show it in specify opened split window B.

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-06-01T14:30:07+00:00Added an answer on June 1, 2026 at 2:30 pm

    The functionality you describe is already present in the form of a ‘preview window’.

    You could map a key (e.g. gf) to something like

    :exec 'pedit ' . expand('<cfile>')
    

    This will open the filename under the cursor in the preview window. A new preview window will be opened if none exists. See :he preview-window for more information.

    Use ^Wz (or :pclose) to close the preview window

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I started to use vim recently, but I miss the character/line selection methods from
I recently discovered that I can use lambdas to create simple event handlers. I
I use the vim editor (on Ubuntu). Recently, I have been working with large
I recently wanted use regex in Cocoa app. But I found that Cocoa does
I recently use this code, and realize that in anonymous class, I can't access
Recently I use stringtemplate,I noticed StringTemplate can't support complex conditional,similar value>1 or value=menu etc.
I have recently started to use Kohana and I know inheritance is in infancy
I've just recently begun to use markdown and have noticed that any markdown within
I recently wanted to use boost::algorithm::join but I couldn't find any usage examples and
I recently use GitHub and downloaded GitHub for Mac. I noticed you can add

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.