Every time I create a new file I have to select the file type manually via Document->Set Filetype->.....
Is there a shortcut or a custom command I can use to select programming language to pascal fast?
I'm glad you asked. The same annoyance bugs me every I create a new file to write a Bash script. So, I worked out a solution.
If you're using a Linux system, you can set up a custom command to call xdotool
to do the job. If you don't have it installed, it should be available in your distro's repo. With xdotool
, you can simulate a sequence of keypresses to do the work of selecting Pascal for you.
Edit > Format > Send Selection to > Set Custom Commands
xdotool
command in the Command edit box (see below)The exact command to select Pascal on my Geany installation is...
xdotool key alt+d t p Page_Down Up Up Up Up Up Up Up Return
...but make adjustments if needed.
You'll also want to set a keyboard shortcut to run the custom command. (Important! The new document needs to have focus for the custom command to work.) You can try Ctrl+1, which is supposed to be the default keyboard shortcut for Custom Command 1, but it wouldn't work on my Geany installation for some reason. If you have the same issue, then...
Edit > Preferences > Keybindings
If you're using Windows, where xdotool
isn't available, I'd probably try out xdotool-for-windows first, and if it didn't work out I'd see if something listed at AlternativeTo would serve the purpose.