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

  • SEARCH
  • Home
  • 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 9241611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:24:04+00:00 2026-06-18T08:24:04+00:00

I was attempting to do some programming from a machine at work and I

  • 0

I was attempting to do some programming from a machine at work and I am unable to get Vim to recognize folds in my Java program. I’ve set the foldmethod to “syntax”, but I get: “No Fold Found” when I try to collapse method bodies. I changed the filetype to “cpp” to test foldmethod=syntax and it worked!

I attempted to compare ‘java.vim’ and ‘cpp.vim’ to see if I could discern the problem, but I could not make out an issue with ‘java.vim’.

My ‘java.vim’ has the following header:

" Vim syntax file                                                                                                                                                                                   
" Language:     Java                                                                                                                                                                                
" Maintainer:   Claudio Fleiner <claudio@fleiner.com>                                                                                                                                               
" URL:      http://www.fleiner.com/vim/syntax/java.vim                                                                                                                                              
" Last Change:  2007 Dec 21  

Does anyone have any ideas?

  • 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-18T08:24:05+00:00Added an answer on June 18, 2026 at 8:24 am

    Which Vim version?

    The default Vim 7.3.000 install ships syntax/java.vim with a version of 2010 March 23; the latest runtime files (from Mercurial repo) have 2012 Oct 05; both can do Java folding. I strongly recommend you to upgrade.

    If you cannot do this, put the following into ~/.vim/after/syntax/java.vim:

    if v:version < 703
        " The default Java syntax file lacks the 'fold' option.
        syn region javaFold start="{" end="}" transparent fold
    endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im attempting to get some records from a table based on certain factors. One
Alright, so I'm attempting my hand at some pattern programming in my effort to
I am attempting to modify some existing C++ code to work with my needs,
I am attempting to load some images into a very basic C++/SDL based program.
I'm attempting to pull some data from a SQLite database so that I can
I am attempting to pull some information from my tnsnames file using regex. I
I am working on some socket programming stuff and attempting to match some strings.
I have not done much database programming at all. I am working from some
I am attempting to fill some text with a gradient-fill, where by I set
I am new to C# programming, and I am attempting to obfuscate some credentials

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.