User:Nardog/CodeEditorAssist

From Wikipedia, the free encyclopedia
CodeEditorAssist
DescriptionAllows customizing the code editor, e.g. changing the color theme and enabling live autocompletion
UpdatedApril 24, 2024
    (0 days ago)
Browser supportChrome, Firefox, etc.
SourceUser:Nardog/CodeEditorAssist.js

Did you know that pressing Ctrl+, in the code editor for CSS, JavaScript, JSON, Lua, and edit filters opens a configuration panel where you can customize the highlighting theme, keybindings, font size, wrapping style, cursor style, indentation method, undo buffers, and even live autocompletion? I know, right? Or you did but you wished you could have kept your preferences across pages? Right, right. Well, you've come to the right place.

CodeEditorAssist will allow you to save your code editor preferences and automatically apply them every time you open the editor. It also adds a handy settings button to the code editor toolbar.

Installation[edit]

Add the following to your common.js or global.js:

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/CodeEditorAssist.js&action=raw&ctype=text/javascript');

Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.

Saving settings[edit]

Settings are saved to your global preferences. While saved settings are automatically loaded every time you open a page with the code editor, you have to hit Save in order to save them in the first place (so any changes made to the settings afterwards will not be saved, including through the default toggle buttons on the toolbar). The options "Mode" and "Read-only" are not saved.

See also[edit]