Search code examples
javascriptjqueryckeditor

How do I get tab spaces to work in CKEditor?


Is it possible to get CKEditor to recognize tab as a feature inside the editor, especially when in source code mode? Right now, when I hit the tab key, the cursor goes to the next field on the page.

I'd like to get the tab character working so CKEditor can work more like a code editor in which I can format my markup with tab spaces.

I'd really appreciate any help I can get with this.

I'm using CKEDitor 4.0.1

Or, perhaps this feature is supported in one of the newer versions of CKEditor?


Solution

  • This link might help: http://get-simple.info/forums/showthread.php?tid=1347

    Basically, just add

    config.tabSpaces = 4; // or some other value
    

    to config.js and every time Tab is hit, you get that number of spaces.