- Select a filetype you'd want to change the default application for and open the File Info (Cmd+I)
- In the "Open with" section, select the app you want to be the default app for the filetype
- To persist the default app along the whole filetype, also click the "Change All" button right below it.
That's up to the application. You can crack open the app packages for Sublime Text and MacVim and see how their Info.plist files differ. It's also worth looking at the Info.plist for TextEdit, which has a catch-all for all non-executable files.
- Select a filetype you'd want to change the default application for and open the File Info (Cmd+I) - In the "Open with" section, select the app you want to be the default app for the filetype - To persist the default app along the whole filetype, also click the "Change All" button right below it.