Skip to content

Ranger: txt files open in Firefox even though text/plain is set to use Vim.desktop in mimeapps.list

Friends,

I have ranger configured to use xdg-open.

xdg-open xxx.txt from the terminal opens the file in vim as expected.

for some reason within Ranger, txt files are still opening in Firefox.

Any ideas?

1 points10 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Text
ID
cedoal

Author

58
posts
386
comments
5
media
View profile

10 comments

How does your vim.desktop look like?

1 points
1 points

Hmm I should have asked what de or wm your using and if its pure vim or not. I can see that's gvim right? I have my nvim.desktop in ~/.local/share/applications but I use nvim so that's a bit different.

I think that ranger has a rifle.conf file that has all the settings to open files and things. Check the file for mime text and I think you have to change the editor to whatever you use. Also man rifle.

Have fun.

​

Looking more at this I think you should check if you have your EDITOR and VISUAL environment variables set to gvim in bash or whatever you use.

​

edit: env variables.

1 points

It's the standard file in usr/share/applications that vim creates on installation. Haven't changed it.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.