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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:45:35+00:00 2026-06-05T06:45:35+00:00

In Vim, when I’m doing an incremental search for x by entering /x I

  • 0

In Vim, when I’m doing an incremental search for “x” by entering /x I then press n to jump to the next occurrence. If I have just matched the last occurrence at the file, when I press n the cursor will start to look for a match at the beginning of the file—it will loop back to the beginning. I do not want it to loop back to the beginning. I want n to simply not find any more matches after it reaches the final occurrence. The reason I want this behavior is so that I can easily see when I have searched through the entire file.

Does anyone know how to effect this behavior?

FYI: I am using the following .vimrc options:

colorscheme zenburn   " zenburn colorscheme

set nocompatible      " prevent Vim from emulating Vi's bugs
set scrolloff=5       " keeps cursor away from top/bottom of screen
set nobackup          " don't make automatic backups

set incsearch         " incremental searching
set ignorecase        " case insensitive matching
set smartcase         " smart case matching
set showmatch         " show matching bracket

set autoindent        " indentation
set smartindent       " indentation
set cindent           " indenting for C code
set tabstop=4         " 4-space tabs
set shiftwidth=4      " 4-space tabs

syntax on             " syntax highlighting
filetype on           " behavior based on file type
filetype plugin on    " behavior based on file type
filetype indent on    " behavior based on file type

set visualbell        " replace beeping with flashing screen

set gfn=Lucida_Sans_Typewriter:h10:cANSI
  • 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-05T06:45:36+00:00Added an answer on June 5, 2026 at 6:45 am

    Turn off the 'wrapscan' option.

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

Sidebar

Related Questions

In Vim I can :set wrapscan so that when I do an incremental search,
Vim provides very useful motion commands to jump to next start/end of a method:
Vim has the terrific shortcut [{ for going to the last open { character.
Vim customization -- I have added these lines in my .vimrc inoremap /* /**/<
In vim , I often want to search on a string with finicky characters
Does VIM (or macvim) have a way to show a code-folding boxtree/circletree like Notepad++?
The vim * star / asterisk search (:help star) is a great feature which
Vim is pretty powerful when editing by line - the search/replace tools are modeled
In Vim's normal mode: e goes to the end of the next word w
In Vim, how do I replace a string matched by certain regexp with its

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.