How to find files and soft links when using vim (gvim) in Windows

Source: Internet
Author: User
I believe many of my friends, like me, use vim for office in both linux and windows. but after all, vim is native in linux, and some support in windows is still not very good. This series of articles will be discussed together. 1. search for chicken ribs files in linux. it is very convenient to find the list of files containing a paragraph of text: to traverse all

I believe many of my friends, like me, use vim for office in both linux and windows. but after all, vim is native in linux, and some support in windows is still not very good.

This series of articles will be discussed together.

  1. search for chicken ribs files

In linux, it is very convenient to find the list of files containing a paragraph of text:

It is also easy to traverse all subfolders:

But in windows, the file search function of the chicken ribs basically cannot find anything you want. what should I do?

Fortunately, vim has taken this into consideration and implemented the vimgrep command internally. we have previously introduced it in the article. this time we will introduce it in detail.

Although the name looks like grep, its usage is still different. let's take a look at the common search:

To traverse all subdirectories cyclically, the syntax is as follows:

The list of searched files is added to quickfix. run the following command:

The list of all objects is displayed.

OK. in this way, the content search problem in windows will be solved ~

  2. there is no similar soft link function

Some friends who have never used linux may not understand what soft links are. Simply put, a file or folder directs to another file or folder, and there is no difference between users outside. But why does the problem occur when vim is used in windows?

Here we will first introduce the vimwiki plug-in. this plug-in can be used to build a personal wiki. it is said that the vim plugin is required, and I have been using it all the time, it is mainly used for GTD.

However, the problem with wiki is that many independent pages are generated. if I have two computers and want to be able to process the GTD schedule at home and at work, what should I do with synchronization? There are already a lot of good cloud storage services in China. you can find them here.

The problem is, what if the synchronization directory of cloud storage is inconsistent with that of wiki? Linux can be easily solved through soft links, but Windows XP does not come with such a tool.

Of course, there are solutions to the problem. for details, refer to this article:

Http://jdev.tw/blog/1242/mklink-junction-quick-folders-access

According to the introduction in this article, Vista and later versions are installed with mklink by default, implementing a function similar to soft link. because I use XP on my computer, I use junction as the soft link, that is:




Junction virtual_dir real_dir

In this way, the problem of association between different directories is also solved, but please note that:

   Unlike linux soft links, after junction is used for association, deleting virtual file directories will also delete the real directories! Be careful!

Okay. I have summarized these two points for the time being. I hope to provide some help to vim (gvim) users in windows. we will continue to discuss this article in the future ~

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.