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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:44:03+00:00 2026-06-15T10:44:03+00:00

Many plugins make their public mapping interface accessible through <Plug> maps. Users can then

  • 0

Many plugins make their public mapping interface accessible through <Plug> maps. Users can then use these maps as hooks for their own mappings, e.g. :nmap <Leader>fu <Plug>fooPluginUnlinkRootDir.

Recently I have come across some plugins which put their map names in brackets, e.g.

  • <Plug>(textobj-indent-a) in the textobj-indent plugin,
  • <Plug>(LineJugglerBlankUp) in the LineJuggler plugin.

This syntax is not documented anywhere in the help files nor do any of the bundled Vim runtime files use it. Nevertheless, these plugins do their job just fine.

What is the motivation for the brackets? Is there any advantage in using them? Should plugin authors be encouraged to follow this practice (as a best practice)?

  • 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-15T10:44:04+00:00Added an answer on June 15, 2026 at 10:44 am

    Thanks ZyX; your answer already covers the fundamentals, so let me just add why I’ve adopted the <Plug>(PluginNameAndMore) notation. (I think I saw it first in Kana Natsuno’s plugins.)

    Two reasons:

    1. When wrapping a mapping with other stuff, it’s easier to visually parse the individual mapping targets, like here:

      imap <C-x><C-c> <Plug>(CompleteStart)<Plug>(CamelCaseComplete)<SID>(CamelCaseCompleteModifyUndo)<Plug>(CamelCasePostComplete)<Plug>(CompleteoptLongestSelect)

    2. When defining multiple mappings for a plugin, one must be careful that the LHS of one is not contained in another mapping. Otherwise, there will be a delay when the mapping is triggered, as Vim needs to wait for additional keystrokes before the ambiguity can be resolved. The closing parenthesis prevents any such ambiguity.

    BAD                 GOOD
    <Plug>MyFunc        <Plug>MyFuncNext, <Plug>(MyFunc)
    <Plug>MyFuncReverse <Plug>MyFuncPrev, <Plug>(MyFuncReverse)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use simple javascripts, jquery library and many plugins , should i make one
I was thinking to make custom scrollbar jQuery plugin, there are many plugins available
I'm founder of a major, so-called 'toplist'. The users can submit their website to
I have a main app that will have many plugins. Here is the PluginReader
I am loading two JS files, one with many plugins, including Jquery. The 'ready()'
I have started using ajax/jQuery in our websites / application. There are many plugins
Many people use this method to add animation on switching views. When I try
Given this code public interface IRepository<T> { IQueryable<T> GetAll(); } and this public class
I need a suggestion regarding how I can make an accordion tree hierarchical. There
I know there are many good plugins for pretty alert boxes, but I have

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.