When toggling space/tabs for indentation, would you like the change to only apply to future indentation or all indents, including already existing ones?
To Convert All Existing Spaces to Tabs and Vice Versa
Hotkey: Settings -> Shortcut Mapper -> Main Menu and set hotkeys for the TAB to Space and vice options
Toolbar Button: Install plugin "Customize Toolbar" from Plugins -> Plugin Manager. After installation, Plugins -> Customize Toolbar -> Customize will allow you to add the "Tab to Space" and "Space to Tab" buttons
Toggle indentation character (space or tab) for subsequent indents
- Install the Python Script plugin and from its menu, Create new script.
- Choose a file name and save in the given directory
- In the blank script file add:
editor.setUseTabs(not editor.getUseTabs()) and save
From the Python Script -> Configuration menu:
Hotkey: Add a menu item and restart N++. From Shortcut Mapper -> Plugin Commands, set a shortcut for your toggle script.
Button: Add a button. Restart N++. If the toolbar button is not clickable, a conflict with the Customize Toolbar plugin is occuring, so you might have to remove that plugin. If there is a way to get Customize Toolbar and Python Script to add buttons to the toolbar simultaneously, I haven't found it.
Toggling Whitespace Character Visibility
Hotkey: Shortcut Mapper -> Main Menu -> "Show Whitespace and Tab"
Set Hotkey and/or Toolbar Button for the following N++ Python Script:
# Toggle whitespace visibilty through the following modes
# 0: The normal display mode with white space displayed as an empty background colour
# 1: White space characters are drawn as dots and arrows
# 2: White space used for indentation is displayed normally but after the first visible character, it is shown as dots and arrows
# Mode descriptions from http://www.scintilla.org/ScintillaDoc.html#SCI_GETVIEWWS
editor.setViewWS( (editor.getViewWS()+1)%3 )