Post #2559776
2025-08-04 21:03 UTC
Dear Geany users,
there is a little hidden gem in Geany you might or might not know about already:
it's called Send Selection To and let's you pass the currently selected text from Geany to any command that will read and process the text from its standard input stream and Geany will read the standard output of the command and replaces the selected text with this output.
The commands to use can be configured freely in Geany. And the first three configured commands can be easily executed with a keyboard shortcut.
There are countless possibilities to quickly alter the text or code you are editing in Geany, only a few ideas:
sort lines (using sort, as seen above)sort lines uniquely to remove duplicates (using sort -u)convert camelCase to snake_case and vice versapretty print JSON (using python3 -mjson.tool)auto format your code (e.g. using black, indent or clang-format or any other command line formatter)pretty print SQL statements (using sqlformat --reindent -)encode Base64 (using base64 -w 0)decode Base64 (using base64 -d)... (feel free to share your custom commands as answers)More details can be found in the documentation:
https://geany.org/manual/#sending-text-through-custom-commands
Some examples are described in detail in the wiki:
https://wiki.geany.org/config/customcmds/sort-selection
https://wiki.geany.org/howtos/format_escaped_newlines
https://wiki.geany.org/howtos/convert_camelcase
#Geany
Replies (0)
No replies.