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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:02:27+00:00 2026-06-14T21:02:27+00:00

Tab completion with a popup menu in vim works pretty well with the right

  • 0

Tab completion with a popup menu in vim works pretty well with the right configuration.
http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE

I have a small collection of code generator and code manipulating programs which I use in vim. The procedure is:

1. initiate visual mode
2. highlight text
3. :'<,'>!hashify

I would like to harness vim popup menu to offer a selection of actions.

The new procedure would be:

1. initiate visual mode
2. highlight text
3. <Tab> -- select transform option from menu

Is there a vimscript interface which could be used for this?

  • 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-14T21:02:28+00:00Added an answer on June 14, 2026 at 9:02 pm

    The insert mode completion popup can be used to insert a choice of text fragments. There are two ways to implement it, see :help complete-functions and :help complete(). If your code generator returns single-line (and not too long) text fragments to insert, you could invoke the generator via system(...) and then feed the returned values to the completion function.

    On the other hand, if the menu choices do not directly correspond to inserted text, but are tactical choices or actions, most plugins present a selection menu like this, styled like built-in menus (e.g. from :ilist):

    :echohl Title
    :echo 'Code fragments:'
    :echohl None
    :echo '1. foo'
    :echo '2. bar'
    :let choice = nr2str(getchar())
    :if choice == 1 ...
    

    Then, insert the text corresponding to the choice via :normal! iText, or setline().

    As you appear to need the completion from visual mode, you can first capture the selected text by starting your mapping with y.

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

Sidebar

Related Questions

I have playn installed on eclipse (http://code.google.com/p/playn/wiki/GettingStarted#Running_via_Eclipse), i loaded the sample programs and they
When I'm opening a new file in Vim and I use tab completion, it
I am using the following .bashrc file. The tab completion works fine. However. The
I would like to make tab completion in bash a bit more intelligent. Let's
This may be have a better name than custom tab completion, but here's the
Is there anyway that I can hook into the tab completion for bash from
I would like to control which methods appear when a user uses tab-completion on
In bash, I believe it is possible to enable tab completion on the terminal
When I use Merb's built in console, I get tab auto-completion similar to a
I use the following smart-tab defun in my .emacs for either completion on a

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.