How do I make vim open all files matching a pattern in different tabs?

后端 未结 4 674
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 14:11

In a given working directory, if I do

:tabe **/test*.py

vim complains with E77: Too many file names. What if I wa

4条回答
  •  走了就别回头了
    2021-01-01 14:27

    This functionality can be included as a command in your .vimrc file:

    "open all files in seperate tabs
    command -nargs=1 OpenAll call openAll()
    function! s:openAll(dir)
        execute 'args ' . a:dir
        silent argdo tabe %
        syntax on
    endfunction
    

    With this function running :OpenAll **/*.py from vim will quickly open all files into new tabs

提交回复
热议问题