This forum has been archived. All content is frozen. Please use KDE Discuss instead.

GVim won't start with modified .desktop configuration

Tags: None
(comma "," separated)
rsupremo
Registered Member
Posts
51
Karma
0
OS
I changed default gvim.desktop content like this:
Code: Select all
Exec=gvim
-f %F to
Exec=gvim --remote-tab-silent %F


It is ok when I open a file from Krusader by double click/enter (GVim is set as default editor) but when I tried to launch GVim as a KDE application it won't start. The mouse cursor changes but nothing happens.

When I remove --remote-tab-silent argument it works as it should.

Can you explain this behaviour? Is there a way to have look at logs or some output to see what is happening?


openSUSE 13.2, KDE 4.14.2
Arch Linux, KDE 4.14.7
luebking
Karma
0
the remote-tab-silent switch is likely NOOP w/o a file parameter (which is not present when starting it from the start menu)

If gvim doesn't have a "smart" switch (which just starts gvim if there's no file) you'll have to go for a script

gvim.sh
Code: Select all
#!/bin/sh
if [ -e "$1" ]; then
   gvim --remote-tab-silent "$1"
else
   gvim
fi


and use that
Code: Select all
Exec=gvim.sh --remote-tab-silent %F


or file a bug against gvim do do smarter ;-)

PS: kate/kwrite has btw. a vim input style mode.
rsupremo
Registered Member
Posts
51
Karma
0
OS
Yes. I fixed it with the similar script because GVim refuses to run with just --remote-tab-silent option without providing the file name.

Code: Select all
if [ $# -eq 0 ]
then
    #No file name specified. Executed with no argument.
    if [ $(gvim --serverlist | wc -l) -eq 0 ]
    then
        #If no GVim instances just open empty gvim
        gvim
    else
        #There is a GVim instance. Open a new tab for file with name based on curren time.
        gvim -f --remote-tab-silent "file_$(date +%s)"
    fi
else
    #There is a file name (file names?) so just normally call gvim as with remote-tab argument.
    gvim -f --remote-tab-silent "$@"
fi


openSUSE 13.2, KDE 4.14.2
Arch Linux, KDE 4.14.7


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]