I'm looking to change the way word boundaries are recognized when using the `M-t` shortcut to swap two words in bash. Ideally, I'd want it to treat a word as being separated by spaces. Since bash relies on readline and readline doesn't allow for custom word boundaries, I'm curious if there's any kind of workaround or hack to make this happen.
4 Answers
Check out this wiki page: https://mywiki.wooledge.org/IFS. It contains useful information about word boundaries, especially regarding how they are defined in readline.
You might try this syntax: `"${WORD#*-}-${WORD%-*}"`. It's a neat trick to manipulate word boundaries in bash, which might help with what you're trying to do.
Readline actually lets you define word boundaries through the `rl_basic_word_break_characters` variable. If you're feeling adventurous, you could use LD_PRELOAD to tweak libreadline settings when launching the shell.
Have you given `C-M-t` a shot? I just tried it, and it worked perfectly for swapping the words as you wanted!

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically