Quantcast
Channel: Bring gvim forward when I open a new tab from the command line - Ask Ubuntu
Viewing all articles
Browse latest Browse all 3

Bring gvim forward when I open a new tab from the command line

$
0
0

I like my vi command to open the file in Gvim and to open it in a new tab if Gvim is already running.

function vi {    if [[ -z $@ ]]; then        gvim     elif [[ ${1:0:1} = - ]]; then        gvim "$@"    else        gvim --remote-tab-silent "$@"    fi}

This works, but when I specify a filename and it opens in an existing Gvim instance, it doesn't bring the window to the front like it does on Mac or Windows.

How can I make it so that when I enter a "vi file.txt" command in the terminal, it will make Gvim the active window?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images