You are not logged in.

#1 2025-05-30 07:27:11

randomiranda
Member
Registered: 2025-02-23
Posts: 14

[solved] dolphin fails to open vim correctly when file path has spaces

when opening a text file with vim using dolphin, the file path gets cut off after the first space. so instead of opening "~/new folder/file.txt" vim will instead open "~/new"
how do i fix this?

Last edited by randomiranda (2025-05-31 14:40:58)

Offline

#2 2025-05-30 13:30:26

cryptearth
Member
Registered: 2024-02-03
Posts: 2,009

Re: [solved] dolphin fails to open vim correctly when file path has spaces

in some config you seem to have overwriten the default

vim "$*"

to something without quotes

 vim $*

causing vim to fail

Offline

#3 2025-05-30 13:55:14

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,727

Re: [solved] dolphin fails to open vim correctly when file path has spaces

Is this vim specific?
I'd assume that dolphin uses the g|vim.desktop service and that likely via xdg-open - and it seems odd that %F isn't properly escaped, let alone only for vim.

… therefore:

type -a vim gvim

Online

#4 2025-05-30 14:34:12

randomiranda
Member
Registered: 2025-02-23
Posts: 14

Re: [solved] dolphin fails to open vim correctly when file path has spaces

so i ended up reinstalling vim and now the thing doesn't open at all with dolphin. works with thunar though, but i want it to work with dolphin
here's output for that type command

vim is /usr/bin/vim
bash: type: gvim: not found

Last edited by randomiranda (2025-05-30 14:35:23)

Offline

#5 2025-05-30 14:42:16

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,727

Re: [solved] dolphin fails to open vim correctly when file path has spaces

seth wrote:

Is this vim specific?

Since you rely on vim running in a TE, what is your TE (konsole or did you change that) and did you attempt to change that in any way shape or form?
And what DE is this? Plasma?

Online

#6 2025-05-30 14:47:52

randomiranda
Member
Registered: 2025-02-23
Posts: 14

Re: [solved] dolphin fails to open vim correctly when file path has spaces

i'm on kde plasma with xfce4-terminal. i changed the default terminal to xfce4 in the kdeglobals file

Offline

#7 2025-05-30 15:01:46

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,727

Re: [solved] dolphin fails to open vim correctly when file path has spaces

i changed the default terminal to xfce4 in the kdeglobals file

And what happens if you reset that to the default?
Is this plasma on X11 or on wayland?

Online

#8 2025-05-30 15:11:16

randomiranda
Member
Registered: 2025-02-23
Posts: 14

Re: [solved] dolphin fails to open vim correctly when file path has spaces

i'm on x11. konsole opens vim correctly when changing it to default but i don't want to use konsole

Offline

#9 2025-05-31 13:20:14

randomiranda
Member
Registered: 2025-02-23
Posts: 14

Re: [solved] dolphin fails to open vim correctly when file path has spaces

so turns out the reason why it isn't starting is because the automatically generated service file is written wrong as this is the line used to execute the command

ExecStart="/usr/bin/xfce4-terminal" "-e" "/usr/bin/vim" "/home/user/file"

it gives the error

xfce4-terminal[29756]: xfce4-terminal: Unknown option "/home/user/file"

still not sure how to remedy this

Last edited by randomiranda (2025-05-31 13:44:35)

Offline

#10 2025-05-31 14:39:35

randomiranda
Member
Registered: 2025-02-23
Posts: 14

Re: [solved] dolphin fails to open vim correctly when file path has spaces

well, i did it
made a new vim.desktop file in ~/.local/share/applications with this in it

[Desktop Entry]
Name=Vim
Icon=gvim
Exec=xfce4-terminal -e "vim '%F'"
MimeType=text/x-tex;text/x-pascal;text/x-moc;text/x-makefile;text/x-java;text/x-csrc;text/x-csrc;text/x-chdr;text/x-c++src;text/x-c++hdr;text/tcl;text/plain;application/x-shellscript;

Offline

Board footer

Powered by FluxBB