Stop Grouping, folder format, context menu

I would like to write a script to stop grouping and then expand folder, how do i do that?

can i set a hotkey for calling out folder format console?
hotkey for different preset of folder format?

can i control what is showing to me in context menu among different file types?
and can i set hotkey for different option in context menu?

lastly is there a better way i can learn how to write this script or command?