Add :ui pretty-code & set-pretty-symbols! autodef

Along with defaults for C/C++, elm, elisp, js, typescript, web-mode, and
org-mode. Thanks to @ar1a for inspiration.
This commit is contained in:
Henrik Lissner 2018-06-16 19:32:25 +02:00
parent b991af552c
commit ec8ae0bedc
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
9 changed files with 183 additions and 5 deletions

View file

@ -1,5 +1,23 @@
;;; lang/javascript/config.el -*- lexical-binding: t; -*-
(after! (:any js2-mode web-mode)
(set-pretty-symbols! '(js2-mode web-mode)
'(;; Functional
:def "function"
:lambda "() =>"
:composition "compose"
;; Types
:null "null"
:true "true" :false "false"
;; Flow
:not "!"
:and "&&" :or "||"
:for "for"
:return "return"
;; Other
:yield "import")))
;;
;; Major modes
;;
@ -66,7 +84,23 @@
(after! typescript-mode
(add-hook! 'typescript-mode-hook #'(flycheck-mode rainbow-delimiters-mode))
(set-electric! 'typescript-mode
:chars '(?\} ?\)) :words '("||" "&&")))
:chars '(?\} ?\)) :words '("||" "&&"))
(set-pretty-symbols! 'typescript-mode
;; Functional
:def "function"
:lambda "() =>"
:composition "compose"
;; Types
:null "null"
:true "true" :false "false"
:int "number"
:str "string"
:bool "boolean"
;; Flow
:not "!"
:and "&&" :or "||"
:for "for"
:return "return" :yield "import"))
;; `coffee-mode'