The magic command
Since I am using the my terminal all of the time, I have tried to make it execute comment at the speed of my thoughts. Lucky terminal, my thoughts are slow !!!
The first thing I have done is to create aliases and turn all the frequently used command in a one-letter command. For example, I turn firefox into f. In fact, when possible, I create a symlink in my $HOME/bin directory to allow the command to be called from my launcher.
But the most useful command I have is o, for xdg-open. This is a killer one. Like the open command in OSX. Just install it, and in my case create the association between file type and application in ~/.local/share/applications/mimeapps.list and you are done. Now opening a file (default action) should be as easy as: o file. Whatever file is, it will use the default program I have defined.
My o command in not just a symlink to xdg-open, in fact it is a script since I also want it to handle specific files that are not handled by the xdg-open command such as the archive files.
Now my terminal is executing command at the speed of my thoughts.
In order to know the mimetype of a file: xdg-mime query filetype myfile.ext
In order to see the list of the available applications list: /usr/share/applications
the format of ~/.local/share/applications/mimeapps.list is text/x-tex=gvim.desktop below a [Default Applications] header