How to open and split multiple files

前端 未结 5 1926
不思量自难忘°
不思量自难忘° 2021-01-30 10:45

How can I open in a split window multiple files. One split for each file if I\'m not being clear.

I want to do something like. :sp app/views/*.erb and have

相关标签:
5条回答
  • 2021-01-30 11:14

    Not actually from within vim, but perhaps you can run vim like this:

    vim -o app/views/*.erb
    
    0 讨论(0)
  • 2021-01-30 11:15

    Just learned from tonymec@#vim that you can do

    :args app/views/*.erb | all
    

    for horizontal splits or

    :args app/views/*.erb | vertical all
    

    for vertical.

    0 讨论(0)
  • 2021-01-30 11:25
    vim -O app/views/*.erb
    

    This is also from the shell. It will open as vertical splits.

    0 讨论(0)
  • 2021-01-30 11:30

    Had to whip up a function.

      fun! OpenSplits(dir)
        for f in split(glob(a:dir), '\n')
          execute "sp " f
        endfor
      endfun
    
    0 讨论(0)
  • 2021-01-30 11:34

    What happens when you do a

    :sf app/views/*.erb
    

    from within vim?

    0 讨论(0)
提交回复
热议问题