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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:27:41+00:00 2026-06-11T10:27:41+00:00

While has(menu) can tell me if gvim will support the menu command, is there

  • 0

While has("menu") can tell me if gvim will support the menu command, is there a way to test in vim script if any menu currently exists?

The closest thing that I could figure out is to execute the :menu command and count the output. For example, in rough pseudo code…

  if count(":menu") != '0'
     " something has created a menu and is visible on screen
  else
     " no menus have been created
  endif
  • 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-11T10:27:42+00:00Added an answer on June 11, 2026 at 10:27 am

    Your request is unusual; that’s why menu items probably aren’t covered by exists() or a function analog to maparg().

    You have to do this as outlined in your pseudo code:

    redir => menuOutput
    silent! menu
    redir END
    
    if menuOutput =~# '--- Menus ---\n$'
        " no menus
    endif
    

    PS: Overreliance on menus is a Vim “smell”; for one, you don’t have them (easily accessible) when using console Vim.

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

Sidebar

Related Questions

var_export function causes an exception while argument has circular references. Are there any alternatives
Can someone help me improve on this? There has to be a better way.
Using parent child relationship where a parent can have children while each child has
Ruby has been around for a while now so I was wondering if there
Is there a way I can determine if an HDC uses alpha channel? I
This is a problem where firefox works just fine, while chrome has the problem.
Possible Duplicate: Getting “Permission denied” page in the admin, while user has permission I've
I've recently upgraded to Komodo Edit 7 from 6.1, and while the upgrade has
While running my application the user has the possibility to show or hide a
This has been frustrating me for a while now. I started developing a site

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.