[INTRO] Trim Whitespace Plugin - Edit Toolbar Button

The Trim Whitespace Plugin

allows you to trim whitespace from text selections in edit-mode

  • creates a new editor toolbar button, that by default removes whitespace from “empty” lines.
  • It has 4 modes
    • leading … will remove leading whitespace
    • trailing … will remove trailing whitespace
    • full … … will remove leading and trailing whitespace
    • white-line (default) … will remove whitespace from “empty lines” only




In the ControlPanelPlugins → Trim Whitespace → readme tab can be used to change the default setting.

Keyboard Shortcuts

See: How to create dynamic editor toolbar buttons for more info and How to define keyboard shortcuts


By default the button only does one thing and gives you fine grained control

If you need a different behaviour the

So users can clone the default button and make it their own, as shown in the code below

  • 1st new $param=“select-all” … dynamically selects all text
  • trim-whitespace will trim the white space
  • tm-save-tiddler will save the tiddler

So if the shortcut is eg: CTRL-Enter, it should do everything with 1 click. So users can be “as destrcurtive” as they want. It’s their decision :wink:

<$action-sendmessage $message="tm-edit-text-operation" $param="select-all"/>

<!-- modes: leading, trailing, full, white-line -->
	mode={{{ [{$:/config/trim-whitespace/mode}trim[]!is[blank]] ~[[white-line]] }}}

<$action-sendmessage $message="tm-save-tiddler" $param=<<targetTiddler>>/>

WikiLabs Suite

The WikiLabs Main Page gives an overview about all editions, plugins and themes.

There is an Introduction Video how to make the WikiLabs Plugin Library available in your own wikis, accessible from the ControlPanel → Plugins → Get More Plugins dialogue.

Show Screenshot


About Open Source

Most open source software is free of charge and that’s a good thing! But that does not mean, that there are no costs for someone to create, support and maintain it.

So if you use it: Support it!

Have fun!