Vim searching through all existing buffers

前端 未结 8 587
刺人心
刺人心 2021-02-01 13:23

When dealing with a single file, I\'m used to:

/blah
do some work
n
do some work
n
do some work

Suppose now I want to search for some pattern o

8条回答
  •  春和景丽
    2021-02-01 14:16

    Anytime you want to switch to another buffer try this.

    :b +  + tab
    

    For an example. I have this in my buffer

    77 "/var/www/html/TopMenuAlertAlert.vue" line 65
    78 "/var/www/html/MainSidebar.vue" line 29
    79 "/var/www/html/FullScreenSearch.vue" line 26
    80 "/var/www/html/Menu.vue" line 93
    81 "/var/www/html/layouts/RightSidebar.vue" line 195

    As I want to change to another buffer, I probably remember some detail about the file like 'Alert'

    So I just go

    :b Alert + tab
    

    if the file given is not the one I want, I just keep on pressing tab.

    Vim will keep on giving the next file close to it.

    Once you got it. Press Enter.

提交回复
热议问题