Behave.js - A JavaScript Library To Add IDE-Style Behavior To HTML Text Areas
Join the DZone community and get the full member experience.
Join For Free
behave.js is a lightweight javascript library which allows you to augment plain html text areas to have ide-like behavior.
behave.js includes several features as listed below:
- replace tab – pressing the tab key will insert a tab character in the text area instead of cycling through control on the page.
- soft tabs – instead of using the tab character to denote tabs, spaces are used instead, with the ability to set the soft tabs size.
- auto open - behave.js automatically inserts closing counterpart characters for ( { [ “ and ‘ .
- overwrite closing characters – if you type a closing character immediately preceding the same character, one of the duplicate characters is deleted.
- auto strip – if the cursor is placed between two paired characters, pressing backspace to delete the first character results in both characters to be deleted.
- auto indent – using this option allows behave.js to auto indent your code.
naturally, all of the above options are optional and can be activated and deactivated as required.
requirements:
none
demo:
http:/ / jakiestfu. github. com/ behave. js/
license:
mit license
Published at DZone with permission of Hirvesh Munogee, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments