microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
111.8k stars 6.58k forks source link

Please let me configure my own editor other than notepad for the Hosts File Editor #21932

Open gwojan opened 2 years ago

gwojan commented 2 years ago

Description of the new feature / enhancement

I would very much like to use an editor other than Notepad.exe when I select Open hosts file button.

Scenario when this would be used?

This is a power user feature so should it not allow one the ability to use an arbitrary editor other than Notepad? #NeovimRulz 😉

Supporting information

No response

davidegiacometti commented 2 years ago

Hi @gwojan Since the hosts file doesn't have an extenion we can't rely on file association. The editor which the hosts file is opened is the one configured in File Explorer "right click on a text file > Edit" that by default is notepad.exe.

Not 100% sure if this can changed in Windows settings but the registry key is HKEY_CLASSES_ROOT\SystemFileAssociations\image\shell\edit\command. Easy google search on how to change this 😃

/needinfo

gwojan commented 2 years ago

Hi @davidegiacometti,

As I mentioned in the original request, notepad.exe is used to open the hosts file by default.

What I'm asking for is a configuration option to let me choose the editor to use. I don't want to rely on file association. I would like to specify neovim, code, sublime, or whatever. Does that make sense?

davidegiacometti commented 2 years ago

You can already customise notepad through that registry key.

Very unlikely we are going to implement a setting for this since programs may use different arguments.