How to effectively work with multiple files in Vim

前端 未结 28 2756
甜味超标
甜味超标 2020-11-28 00:18

I\'ve started using Vim to develop Perl scripts and am starting to find it very powerful.

One thing I like is to be able to open multiple files at once with:

<
28条回答
  •  一向
    一向 (楼主)
    2020-11-28 00:45

    Adding another answer as this is not covered by any of the answer

    To change all buffers to tab view.

     :tab sball
    

    will open all the buffers to tab view. Then we can use any tab related commands

    gt or :tabn           "    go to next tab
    gT or :tabp or :tabN  "    go to previous tab
    

    details at :help tab-page-commands.

    We can instruct vim to open ,as tab view, multiple files by vim -p file1 file2. alias vim='vim -p' will be useful.
    The same thing can also be achieved by having following autocommand in ~/.vimrc

     au VimEnter * if !&diff | tab all | tabfirst | endif
    

    Anyway to answer the question: To add to arg list: arga file,

    To delete from arg list: argd pattern

    More at :help arglist

提交回复
热议问题