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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:59:49+00:00 2026-06-11T19:59:49+00:00

Vim can open a file under cursor using gf . For example, if I

  • 0

Vim can open a file under cursor using gf. For example, if I have the following under my cursor:

SensorManagementActivity.java

Hitting gf will open SensorManagementActivity.java.

The problem is that in Java, the references lack the java suffix, and often appear as SomeClass, SomeClass() or SomeClass.method().

  • How do I open SomeClass.java and jump to someMethod() when the cursor is on SomeClass.someMethod() in another file?
  • Is there a way to open a new file without saving the current one, and going back to the current one without losing changes?
  • 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-11T19:59:50+00:00Added an answer on June 11, 2026 at 7:59 pm

    The 'suffixesadd' option allows gf to handle Java file extensions; it is already set by the java filetype that ships with Vim, like this:

    :setlocal suffixesadd=.java
    

    To jump to methods, Vim can use a tags file that must be (re-)generated first (there are plugins that can automate that). For Java, you can use the exuberant ctags tool.

    :! ctags -R
    

    For more information and alternatives, read :help ctags. Use the :tag command or the Ctrl-] shortcut to jump.

    You can jump to a split window via Ctrl-W ]. To be able to leave a modified file and return back to it later, :set hidden in your ~/.vimrc.

    PS: Though here they’re kind of related, it’s best to avoid asking multiple questions at Stack Overflow

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

Sidebar

Related Questions

Possible Duplicate: Open file from complete path under cursor in Vim Let's say I
when I open a file using vim, I'd like vim put the cursor to
Depending on my task in Vim I have several tabs open. How can I
When I open a directory browsing in vim, I can open a file by
Using vim with the Rails plugin, can you create a migration file and then
I have multiple file open in Vim. When i want to switch from one
How can I open a file and (via a command line argument to vim
VIM seems integrated to the terminal. Can I open a remote file from the
In vim gf opens the file whose name is under the cursor in the
I am trying to determine if a vim read-only instance can open a file,

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.