SmartReplace? for Xinha

Back To Plugins
developed by Raimund Meyer

One irritating thing with text processing is the total absence of some typographic essentials on the keyboard -- "real" (typographic) quotes and the dash, typically miss-typed as inch or second sign (") and the hyphen(-).

This plugin lends the good old Word behaviour to Xinha, as ",', and - get converted to their respective typographic correct relatives while typing.

Configuration

Changing the quote style from default English

  1. Create a language file in the plugin's lang folder
    // I18N constants
    // LANG: "de", ENCODING: UTF-8
    {
            "SmartReplace Settings" : "SmartReplace Einstellungen",
            "Enable automatic replacements" : "Automatische Ersetzung aktivieren",
            "Convert all quotes and dashes in the current document": "Alle Anführungszeichen und Gedankenstriche umwandeln",
            
            "OpeningDoubleQuotes": "„",
            "ClosingDoubleQuotes": "“",
            "OpeningSingleQuote": "‚",
            "ClosingSingleQuote": "‘"
            
    };
    

or
through a config variable (an array that holds four values: opening single quote, closing single quote, opening double quote, closing double quote)

xinha_config.SmartReplace.quotes = ["‚","‘","„","“"];

Additional config option

Disable automatic replacement by default

xinha_config.SmartReplace.defaultActive = false;

Additional features

The plugin offers a dialog, where you can

  • switch of automatic replacement
  • convert all quotes/dashes in a document that still has the boring "/- stuff