summaryrefslogtreecommitdiff
path: root/lisp/general.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/general.el')
-rw-r--r--lisp/general.el46
1 files changed, 45 insertions, 1 deletions
diff --git a/lisp/general.el b/lisp/general.el
index 9b3f6c9..4b51b9b 100644
--- a/lisp/general.el
+++ b/lisp/general.el
@@ -32,6 +32,33 @@
:weight 'normal
:width 'normal)
+; Taken from: https://emacs.stackexchange.com/questions/55059/ligatures-with-the-jetbrains-mono-font
+(defconst jetbrains-ligature-mode--ligatures
+ '("-->" "//" "/**" "/*" "*/" "<!--" ":=" "->>" "<<-" "->" "<-"
+ "<=>" "==" "!=" "<=" ">=" "=:=" "!==" "&&" "||" "..." ".."
+ "|||" "///" "&&&" "===" "++" "--" "=>" "|>" "<|" "||>" "<||"
+ "|||>" "<|||" ">>" "<<" "::=" "|]" "[|" "{|" "|}"
+ "[<" ">]" ":?>" ":?" "/=" "[||]" "!!" "?:" "?." "::"
+ "+++" "??" "###" "##" ":::" "####" ".?" "?=" "=!=" "<|>"
+ "<:" ":<" ":>" ">:" "<>" "***" ";;" "/==" ".=" ".-" "__"
+ "=/=" "<-<" "<<<" ">>>" "<=<" "<<=" "<==" "<==>" "==>" "=>>"
+ ">=>" ">>=" ">>-" ">-" "<~>" "-<" "-<<" "=<<" "---" "<-|"
+ "<=|" "/\\" "\\/" "|=>" "|~>" "<~~" "<~" "~~" "~~>" "~>"
+ "<$>" "<$" "$>" "<+>" "<+" "+>" "<*>" "<*" "*>" "</>" "</" "/>"
+ "<->" "..<" "~=" "~-" "-~" "~@" "^=" "-|" "_|_" "|-" "||-"
+ "|=" "||=" "#{" "#[" "]#" "#(" "#?" "#_" "#_(" "#:" "#!" "#="
+ "&="))
+
+(sort jetbrains-ligature-mode--ligatures (lambda (x y) (> (length x) (length y))))
+
+(dolist (pat jetbrains-ligature-mode--ligatures)
+ (set-char-table-range composition-function-table
+ (aref pat 0)
+ (nconc (char-table-range composition-function-table (aref pat 0))
+ (list (vector (regexp-quote pat)
+ 0
+ 'compose-gstring-for-graphic)))))
+
;; Don't ask to kill when we have an open line number
(setq-default confirm-kill-processes nil)
@@ -86,6 +113,22 @@
(setq-default left-fringe-width 20)
(setq-default right-fringe-width 20)
+;; Margins: https://stackoverflow.com/a/22320638/7980887
+(defun my-set-text-margins ()
+ "Set margins in current buffer."
+ (setq left-margin-width 50)
+ (setq right-margin-width 50))
+
+(add-hook 'text-mode-hook 'my-set-text-margins)
+
+(defun my-set-prog-margins ()
+ "Set margins in current buffer."
+ (setq left-margin-width 25)
+ (setq right-margin-width 25))
+
+(add-hook 'prog-mode-hook 'my-set-prog-margins)
+
+
;; Highlight todos
(use-package hl-todo
:ensure t
@@ -248,7 +291,8 @@
:bind ("<f2>" . #'eglot-rename)
:config
(add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd"))
- (add-hook 'c-mode-common-hook 'eglot-ensure))
+ (add-hook 'c-mode-common-hook 'eglot-ensure)
+ (add-hook 'dart-mode-hook 'eglot-ensure))
(set-face-underline 'eglot-highlight-symbol-face t)