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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:26:09+00:00 2026-06-04T04:26:09+00:00

it seems to be a dumb question, but it has to be posed. I

  • 0

it seems to be a dumb question, but it has to be posed.

I have just experimented with vim’s functions and came across ‘searchpair’. So i started to make use of it.

The buffer on which i employed the function looks like this:

xyz
xyz
[
xyz
xyz
[
xyz
]
xyz
xyz
]
xyz
xyz

And i positioned the cursor at the first line. After that i changed to Ex-mode an executed the command

echo searchpair('[', '', ']')

that puts 0 on the screen.

Obviously searchpair didn’t find the pair of brackets in my buffer, so i played further with the arguments and the buffer. Nevertheless it returns always 0.

Studying :h searchpair() helps me neither.

Maybe someone of you experts can help me to gain some wisdom.

PS: i use

VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul 12 2010 02:31:36)
  • 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-04T04:26:10+00:00Added an answer on June 4, 2026 at 4:26 am

    You forgot to escape your [].

    This version:

    :echo searchpair('\[','','\]')
    

    works but only if it is executed when the cursor is on the character you want to match.

    The number returned is the number of the line on which the match is found.

    Also, : doesn’t put you into “Ex mode”, it puts you into “Command-line” mode.

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

Sidebar

Related Questions

Seems like this is a dumb question, but I need something... substantial. I have
I know this will seem like a dumb question but I'm just getting started
This seems like an incredibly dumb question to have to ask, but how do
Sorry if my question seems dumb. I've started using Eclipse Ganymede 3.4 this week
This has to be a dumb question, but I can't seem to find the
This seems like a dumb question, but I couldn't see any way to do
This could be a dumb question, but I have submitted a few apps where
I know this seems like a dumb question but how do I search a
Maybe this is a really dumb question, but please hear me out. I have
Ok this seems like a dumb question and probably is but I cannot figure

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.