Ymacs: Ajax Source Code Editor In Your Browser

7 Dec, 2009, by Team Sheriff || Topics: Script

Hey Readers, Win 25 Citrify Premium Licenses How to Participate and Win!!! :-D . Stay tuned for more premium giveaways coming next by subscribing toRSS feed or Subscribe to App Sheriff - Sworn To Serve by Email. Good Luck Guys!

Ymacs is an Emacs-like editor that works in your browser. At present, it works best only in Firefox. Though it looks good with other browsers it still doesn’t have the required key bindings that makes it work with the other browsers.
This project is based on the DynarchLIB, my AJAX toolkit. The DynarchLIB used to be a closed project but very soon a new version will be released under a similar open license.

ymacs ajax editor

Some new stuffs that are used are C-x b to switch the buffers. TAB completion is available but the default value which should have been to switch to the previously visited buffer is missing. Using the C-x b you can also create a new buffer by simply typing a name for it. Then M-x is used in the javascript_mode or xml_mode etc. The M-x htmlize_region is used to create a new buffer. It is then put into the HTML containing the current “syntax highlighted” code that uses class and not the inline styles.

The Emacs is a gigantic beast with about 30 years of history. The Ymacs currently can do the following. These features aren’t hard-coded in ways that you can’t change. The Ymacs is customizable and also extensible. For example, if you are not satisfied with the Emacs key bindings then it’s fairly trivial to define a different default keymap to the mimic such as Eclipse or Visual Studio.

1. Emacs-like movement keys:
• by character (ARROW_RIGHT, ARROW_LEFT, C-f, C-b)
• by line (ARROW_UP, ARROW_DOWN, C-n, C-p)
• by word (C-ARROW_RIGHT, C-ARROW_LEFT, M-f, M-b)
• by paragraph (C-ARROW_UP, C-ARROW_DOWN)
• even by balanced expressions in some modes (C-M-f, C-M-b, C-M-n, C-M-p)
(but this is really slow currently)
• beginning of buffer (C-HOME, M-<)
• end of buffer (C-END, M->)

2. Emacs-like text manipulation commands:
• transpose chars (C-t)
• transpose words (M-t)
• transpose lines (C-x C-t)
• upcase word (M-u)
• downcase word (M-l)
• capitalize word (M-c)
• center line (M-s)
• word killing (M-d, M-DELETE, C-BACKSPACE)
• dabbrev-expand (M-/) — autocomplete the word at point
• text filling (M-q)

3. Emacs-like editing modes that are currently JavaScript, XML, Lisp and Markdown:
• modes can provide custom keymaps
• and syntax highlighting
• and automatic indentation
• highlighting matching parentheses

4. And other features implemented in an Emacs-like fashion:
• undo queue
• mark, kill ring and transient mark
• minibuffer and mode line
• interactive search
• multiple buffers
• split frames (C-x 2 or C-x 3 to split frame, C-x 1 to delete-other-frames)
• prefix keys, keymaps
• markers, overlays and text properties
• M-x

Inorder to do it without a designMode and without a textarea, all you got to do is draw your own text, draw your own cursor, intercept all keypress events and finally figure out what to do with them. This is exactly what the Ymacs does.


Bookmark and Share

Leave a Reply