cred (demo)
Cred is a text editor implemented in JavaScript and targeting Google Chrome Browser 52 or later. A Chrome App version with enhanced capabilities (especially regarding local files) is planned, but for now this is a web page with a Spacemacs-like UI/UX.
There are text editors already, even for Chrome OS. Why another? And why JavaScript for #@^%’s sake?
- experiment with immediate-mode rendering in a text editor [update: no longer using Canvas for text]
- something Spacemacs-like (but “native” for Chromebooks) doesn’t exist yet
- writing single-browser ES6 is quite pleasant (but I’m used to embedded C++ so YMMV)
- ditch Canvas because its text is fuzzy on devices with lots of pixels
- full rewrite of normal-mode command parser:
yip,d3x,caw(operators besides the implicit “move”)- figure out how generic API should be (do we need specific functions for “word” or “paragraph” finding?)
- visual mode
- text object spans (e.g.
dawshould delete an entire word touching the cursor, even if the cursor is in the middle of the word)
- undo/redo
- File I/O
- syntax/semantic highlighting
- assorted WYSIWYG features: inline images, font style and sizes, drag-and-drop, etc.
Fork, pull request.
MIT
Some inspiration comes from this K style guide. Other conventions include:
- complete thoughts which are short enough (about 100 chars) should go on one line
/* permanent documentation comment */// temporary, TODO, or debugging comment{always wrap blocks in braces}- always terminate statements with a semicolon
; const use=(fat_arrow_notation)=>{/* whenever possible */};const use(alternative_syntax){/* for functions declared inside of objects */};- avoid
var - prefer
constoverlet cu /* commonly used name with a comment explaining its purpose */self_documenting_nameClassName /* with documentation comments */
- tedit - IDE that directly edits Git repos (would love this as a backend)
- vis feature set
- vim command cheatsheet
- robust game loops
- functional javascript
- vim-in-textarea achieves a good portion of my goals
- vim grammar
- piece tables in windows text editors
- gap buffer in C#
- circular gap buffer ‘flexichain’
- gap buffer in Node.js
- yc on this subject
