The Quickfix window in vim

Source: Internet
Author: User

Vimgrep is a tool with Vim, which is similar to the use of grep. For example, to find word in the current directory, use the following:

1 : Vimgrep Word *

If you want to recursively look up all the subordinate directories, then use the

1 : Vimgrep Word * *

In addition, if you want to use a shortcut to find the letter under the current cursor, you only need to add the following code to the VIMRC:

1 2 3 4 5 6 "The settings for the search map Ft:call search_word () <CR>:copen<CR> function Search_word () Let w = expand (" < Cword > ")" Grasp the word execute "vimgrep" at the current cursor position. W. "*" Endfunction

The results found by Vimgrep are generated into the Quickfix, as shown in the following figure:

There are a lot of commands for Quickfix as with have said, but I tend to find I only use a small subset of them:

: Copen ' Open the Quickfix window
: CCL   ' close it
: CW    ' Open it if there are ' errors ', close it otherwise (Some people prefer this)
: CN    "Go to" next error in the window
: cnf   "Go to" the "the" the "the" the "the" NEX T file
Get Quickfix List I type Ctrl + W

You can also use:cc 2 (or no other number) to jump to, in this case, the second error in the Quickfix window. Navigating WITH:CN,: CC 4, etc would put the "cursor on" in question.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.