Open files in existing Gvim in multiple (new) tabs

前端 未结 6 1913
耶瑟儿~
耶瑟儿~ 2020-12-12 10:47

I have put some aliases in my .bashrc to open a group of project files in gvim, each in their own tab:

gvim -p 

        
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 11:23

    Linux users may use this kind of script:

    #!/bin/bash
    
    ANS=`pgrep -fx "gvim --servername GVIM"`
    
    echo $@
    
    if [[ ! $ANS ]]; then
        gvim --servername GVIM
    fi
    
    if [[ $1 ]]; then
        gvim --servername GVIM --remote-tab "${@}"
    fi
    

    And then edit gvim.desktop file for using this script:

    Exec=/home/user/bin/my_gvim_script.sh %F
    

提交回复
热议问题