Reputation: 25
I was watching George Hotz stream and I saw that he sometimes opens a file via vim/nvim and instead of opening the editor it just opens the file inside the terminal how do I do this?
Upvotes: 1
Views: 1771
Reputation: 677
I assume you are talking about Unix/Linux? Then you should take a look at xdg-mime
. Its database is asked by most applications if they want to open another application. Here is an example on how to set your default application for text files that don't have a special syntax to vim:
xdg-mime default vim.desktop text/plain
To check what the last argument should be for a file run xdg-mime query filetype ~/MySpecialFile.md
[Bonus fact]: To open a file from terminal in the default application you can run xdg-open MySpecialFile.md
Upvotes: 1