add ligature
This commit is contained in:
parent
dfc3c84f5f
commit
bd52926f31
@ -22,9 +22,15 @@
|
|||||||
|
|
||||||
* Book I'm reading
|
* Book I'm reading
|
||||||
|
|
||||||
** TODO Poor Charlie's Alamnach
|
** DONE Poor Charlie's Alamnach
|
||||||
|
- State "DONE" from "TODO" [2024-01-29 Mon 20:09]
|
||||||
It's actualy available [[https://www.stripe.press/poor-charlies-almanack/cover][online]]
|
It's actualy available [[https://www.stripe.press/poor-charlies-almanack/cover][online]]
|
||||||
|
|
||||||
|
** DONE The Opium War
|
||||||
|
- State "DONE" from "TODO" [2024-01-29 Mon 20:10]
|
||||||
|
|
||||||
|
** TODO Guide to Software Engineering Guidebook
|
||||||
|
|
||||||
* [2024-01-28 Mon]
|
* [2024-01-28 Mon]
|
||||||
|
|
||||||
** Finished reading =The Opium war=
|
** Finished reading =The Opium war=
|
||||||
|
220
init.el
220
init.el
@ -87,6 +87,19 @@
|
|||||||
(use-package uniquify
|
(use-package uniquify
|
||||||
:config (setq uniquify-buffer-name-style 'post-forward))
|
:config (setq uniquify-buffer-name-style 'post-forward))
|
||||||
|
|
||||||
|
;; ligature fonts
|
||||||
|
;; https://github.com/mickeynp/ligature.el
|
||||||
|
(use-package ligature
|
||||||
|
:config
|
||||||
|
;; Enable all Iosevka ligatures in programming modes
|
||||||
|
(ligature-set-ligatures 'prog-mode '("<---" "<--" "<<-" "<-" "->" "-->" "--->" "<->" "<-->" "<--->" "<---->" "<!--"
|
||||||
|
"<==" "<===" "<=" "=>" "=>>" "==>" "===>" ">=" "<=>" "<==>" "<===>" "<====>" "<!---"
|
||||||
|
"<~~" "<~" "~>" "~~>" "::" ":::" "==" "!=" "===" "!=="
|
||||||
|
":=" ":-" ":+" "<*" "<*>" "*>" "<|" "<|>" "|>" "+:" "-:" "=:" "<******>" "++" "+++"))
|
||||||
|
;; Enables ligature checks globally in all buffers. You can also do it
|
||||||
|
;; per mode with `ligature-mode'.
|
||||||
|
(global-ligature-mode t))
|
||||||
|
|
||||||
;; Highlight matching parenthesis
|
;; Highlight matching parenthesis
|
||||||
(show-paren-mode 1)
|
(show-paren-mode 1)
|
||||||
(setq show-paren-delay 0)
|
(setq show-paren-delay 0)
|
||||||
@ -99,17 +112,35 @@
|
|||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
|
'(ac-use-fuzzy nil)
|
||||||
|
'(backup-directory-alist '(("." . "~/.local/share/emacs/backups")))
|
||||||
|
'(column-number-mode t)
|
||||||
|
'(compilation-context-lines 2)
|
||||||
|
'(compilation-error-screen-columns nil)
|
||||||
|
'(compilation-scroll-output t)
|
||||||
|
'(compilation-search-path '(nil "src"))
|
||||||
'(custom-enabled-themes '(misterioso))
|
'(custom-enabled-themes '(misterioso))
|
||||||
|
'(electric-indent-mode nil)
|
||||||
|
'(indent-tabs-mode nil)
|
||||||
'(ledger-default-date-format "%Y/%m/%d")
|
'(ledger-default-date-format "%Y/%m/%d")
|
||||||
'(ledger-reports
|
'(ledger-reports
|
||||||
'(("reg" "ledger [[ledger-mode-flags]] -f /home/haqadosch/Documents/Accounting/ledger.dat reg")
|
'(("reg" "ledger [[ledger-mode-flags]] -f /home/haqadosch/Documents/Accounting/ledger.dat reg")
|
||||||
("bal" "ledger [[ledger-mode-flags]] -f /home/haqadosch/Documents/Accounting/ledger.dat bal")
|
("bal" "ledger [[ledger-mode-flags]] -f /home/haqadosch/Documents/Accounting/ledger.dat bal")
|
||||||
("payee" "%(binary) -f %(ledger-file) reg @%(payee)")
|
("payee" "%(binary) -f %(ledger-file) reg @%(payee)")
|
||||||
("account" "%(binary) -f %(ledger-file) reg %(account)")))
|
("account" "%(binary) -f %(ledger-file) reg %(account)")))
|
||||||
|
'(line-move-visual t)
|
||||||
|
'(next-error-highlight t)
|
||||||
|
'(next-error-highlight-no-select t)
|
||||||
|
'(next-line-add-newlines nil)
|
||||||
'(org-agenda-files '("~/Documents/agenda.org"))
|
'(org-agenda-files '("~/Documents/agenda.org"))
|
||||||
'(package-selected-packages
|
'(package-selected-packages
|
||||||
'(gptel company-ledger flycheck-ledger ledger-mode ellama 0blayout magit magit-annex magit-commit-mark magit-delta magit-diff-flycheck magit-filenotify magit-find-file magit-gerrit magit-gh-pulls magit-gitflow magit-imerge magit-lfs magit-org-todos magit-p4 magit-patch-changelog magit-popup magit-rbr magit-reviewboard magit-stats magit-stgit magit-svn magit-tbdiff magit-todos magit-topgit magit-vcsh magithub mermaid-mode mermaid-ts-mode ob-mermaid rust-mode company-web company elfeed-autotag elfeed-curate elfeed-dashboard elfeed-goodies elfeed-org elfeed-protocol elfeed-score elfeed-summary elfeed-tube-mpv elfeed-web elfeed-webkit smex typescript-mode deno-fmt flycheck-deno ob-deno flycheck emms racket-mode pdf-tools))
|
'(ligature yaml-mode flycheck-ocaml ocamlformat tuareg utop eglot dune dune-format merlin merlin-ac merlin-company merlin-eldoc merlin-iedit gptel company-ledger flycheck-ledger ledger-mode ellama 0blayout magit magit-annex magit-commit-mark magit-delta magit-diff-flycheck magit-filenotify magit-find-file magit-gerrit magit-gh-pulls magit-gitflow magit-imerge magit-lfs magit-org-todos magit-p4 magit-patch-changelog magit-popup magit-rbr magit-reviewboard magit-stats magit-stgit magit-svn magit-tbdiff magit-todos magit-topgit magit-vcsh magithub mermaid-mode mermaid-ts-mode ob-mermaid rust-mode company-web company elfeed-autotag elfeed-curate elfeed-dashboard elfeed-goodies elfeed-org elfeed-protocol elfeed-score elfeed-summary elfeed-tube-mpv elfeed-web elfeed-webkit smex typescript-mode deno-fmt flycheck-deno ob-deno flycheck emms racket-mode pdf-tools))
|
||||||
|
'(require-final-newline t)
|
||||||
'(safe-local-variable-values '((my-variables . value)))
|
'(safe-local-variable-values '((my-variables . value)))
|
||||||
|
'(sentence-end-double-space nil)
|
||||||
|
'(show-trailing-whitespace t)
|
||||||
|
'(tab-bar-mode t)
|
||||||
|
'(visible-bell t)
|
||||||
'(warning-suppress-log-types '((comp))))
|
'(warning-suppress-log-types '((comp))))
|
||||||
'(warning-suppress-types '((comp) (comp) (comp)))
|
'(warning-suppress-types '((comp) (comp) (comp)))
|
||||||
(custom-set-faces
|
(custom-set-faces
|
||||||
@ -117,7 +148,7 @@
|
|||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
;; Your init file should contain only one such instance.
|
;; Your init file should contain only one such instance.
|
||||||
;; If there is more than one, they won't work right.
|
;; If there is more than one, they won't work right.
|
||||||
)
|
'(default ((t (:family "Fira Code" :foundry "CTDB" :slant normal :weight light :height 128 :width normal)))))
|
||||||
|
|
||||||
;; Specify mmdc path for org-babel with mermaid
|
;; Specify mmdc path for org-babel with mermaid
|
||||||
(setq ob-mermaid-cli-path "/home/haqadosch/.nvm/versions/node/v20.10.0/bin/mmdc")
|
(setq ob-mermaid-cli-path "/home/haqadosch/.nvm/versions/node/v20.10.0/bin/mmdc")
|
||||||
@ -128,16 +159,83 @@
|
|||||||
'((js . t)
|
'((js . t)
|
||||||
(shell . t)))
|
(shell . t)))
|
||||||
|
|
||||||
|
;; Based on the doc https://www.gnu.org/software/emacs/manual/html_mono/eglot.html
|
||||||
|
;; (with-eval-after-load 'eglot
|
||||||
|
;; (add-to-list 'eglot-server-programs
|
||||||
|
;; '((js-mode typescript-mode) . (eglot-deno "deno" "lsp"))))
|
||||||
|
|
||||||
;; Deno config with eglot
|
;; Deno config with eglot
|
||||||
(add-to-list 'eglot-server-programs '((js-mode typescript-mode) . (eglot-deno "deno" "lsp")))
|
;; (add-to-list 'eglot-server-programs '((js-mode typescript-mode) . (eglot-deno "deno" "lsp")))
|
||||||
|
|
||||||
(defclass eglot-deno (eglot-lsp-server) ()
|
;; (defclass eglot-deno (eglot-lsp-server) ()
|
||||||
:documentation "A custom class for deno lsp.")
|
;; :documentation "A custom class for deno lsp.")
|
||||||
|
|
||||||
(cl-defmethod eglot-initialization-options ((server eglot-deno))
|
;; (cl-defmethod eglot-initialization-options ((server eglot-deno))
|
||||||
"Passes through required deno initialization options"
|
;; "Passes through required deno initialization options to the SERVER."
|
||||||
(list :enable t
|
;; (list :enable t
|
||||||
:lint t))
|
;; :lint t))
|
||||||
|
|
||||||
|
;; Based on the bash-language-server doc for eglot
|
||||||
|
;; https://github.com/bash-lsp/bash-language-server?tab=readme-ov-file#emacs
|
||||||
|
(use-package eglot
|
||||||
|
:config
|
||||||
|
(add-to-list 'eglot-server-programs
|
||||||
|
'((sh-mode bash-ts-mode) . ("bash-language-server" "start"))
|
||||||
|
;; '((typescript-mode javascript-mode) . ("typescript-language-server" "--stdio"))
|
||||||
|
)
|
||||||
|
|
||||||
|
:hook
|
||||||
|
(sh-mode . eglot-ensure)
|
||||||
|
(bash-ts-mode . eglot-ensure)
|
||||||
|
;; (typescript-mode . eglot-ensure)
|
||||||
|
;; (javascript-mode . eglot-ensure)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
;; Tree sitter config for TSX JSX mode
|
||||||
|
(use-package jtsx
|
||||||
|
:ensure t
|
||||||
|
:mode (("\\.jsx?\\'" . jtsx-jsx-mode)
|
||||||
|
("\\.tsx?\\'" . jtsx-tsx-mode))
|
||||||
|
:commands jtsx-install-treesit-language
|
||||||
|
:hook ((jtsx-jsx-mode . hs-minor-mode)
|
||||||
|
(jtsx-tsx-mode . hs-minor-mode))
|
||||||
|
:custom
|
||||||
|
;; Optional customizations
|
||||||
|
;; (js-indent-level 2)
|
||||||
|
;; (typescript-ts-mode-indent-offset 2)
|
||||||
|
;; (jtsx-switch-indent-offset 0)
|
||||||
|
;; (jtsx-indent-statement-block-regarding-standalone-parent nil)
|
||||||
|
;; (jtsx-jsx-element-move-allow-step-out t)
|
||||||
|
;; (jtsx-enable-jsx-electric-closing-element t)
|
||||||
|
;; (jtsx-enable-electric-open-newline-between-jsx-element-tags t)
|
||||||
|
;; (jtsx-enable-jsx-element-tags-auto-sync nil)
|
||||||
|
(jtsx-enable-all-syntax-highlighting-features t)
|
||||||
|
:config
|
||||||
|
(defun jtsx-bind-keys-to-mode-map (mode-map)
|
||||||
|
"Bind keys to MODE-MAP."
|
||||||
|
(define-key mode-map (kbd "C-c C-j") 'jtsx-jump-jsx-element-tag-dwim)
|
||||||
|
(define-key mode-map (kbd "C-c j o") 'jtsx-jump-jsx-opening-tag)
|
||||||
|
(define-key mode-map (kbd "C-c j c") 'jtsx-jump-jsx-closing-tag)
|
||||||
|
(define-key mode-map (kbd "C-c j r") 'jtsx-rename-jsx-element)
|
||||||
|
(define-key mode-map (kbd "C-c <down>") 'jtsx-move-jsx-element-tag-forward)
|
||||||
|
(define-key mode-map (kbd "C-c <up>") 'jtsx-move-jsx-element-tag-backward)
|
||||||
|
(define-key mode-map (kbd "C-c C-<down>") 'jtsx-move-jsx-element-forward)
|
||||||
|
(define-key mode-map (kbd "C-c C-<up>") 'jtsx-move-jsx-element-backward)
|
||||||
|
(define-key mode-map (kbd "C-c C-S-<down>") 'jtsx-move-jsx-element-step-in-forward)
|
||||||
|
(define-key mode-map (kbd "C-c C-S-<up>") 'jtsx-move-jsx-element-step-in-backward)
|
||||||
|
(define-key mode-map (kbd "C-c j w") 'jtsx-wrap-in-jsx-element)
|
||||||
|
(define-key mode-map (kbd "C-c j u") 'jtsx-unwrap-jsx)
|
||||||
|
(define-key mode-map (kbd "C-c j d") 'jtsx-delete-jsx-node))
|
||||||
|
|
||||||
|
(defun jtsx-bind-keys-to-jtsx-jsx-mode-map ()
|
||||||
|
(jtsx-bind-keys-to-mode-map jtsx-jsx-mode-map))
|
||||||
|
|
||||||
|
(defun jtsx-bind-keys-to-jtsx-tsx-mode-map ()
|
||||||
|
(jtsx-bind-keys-to-mode-map jtsx-tsx-mode-map))
|
||||||
|
|
||||||
|
(add-hook 'jtsx-jsx-mode-hook 'jtsx-bind-keys-to-jtsx-jsx-mode-map)
|
||||||
|
(add-hook 'jtsx-tsx-mode-hook 'jtsx-bind-keys-to-jtsx-tsx-mode-map))
|
||||||
|
|
||||||
;; Remap list buffers =C-x C-b= with the ibuffer command
|
;; Remap list buffers =C-x C-b= with the ibuffer command
|
||||||
(global-set-key [remap list-buffers] 'ibuffer)
|
(global-set-key [remap list-buffers] 'ibuffer)
|
||||||
@ -154,27 +252,91 @@
|
|||||||
(add-to-list 'load-path "/home/haqadosch/.opam/ocaml-book/share/emacs/site-lisp")
|
(add-to-list 'load-path "/home/haqadosch/.opam/ocaml-book/share/emacs/site-lisp")
|
||||||
(require 'ocp-indent)
|
(require 'ocp-indent)
|
||||||
|
|
||||||
|
(let ((opam-share (ignore-errors (car (process-lines "opam" "var" "share")))))
|
||||||
|
(when (and opam-share (file-directory-p opam-share))
|
||||||
|
;; Register Merlin
|
||||||
|
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||||
|
(autoload 'merlin-mode "merlin" nil t nil)
|
||||||
|
;; Automatically start it in OCaml buffers
|
||||||
|
(add-hook 'tuareg-mode-hook 'merlin-mode t)
|
||||||
|
(add-hook 'caml-mode-hook 'merlin-mode t)
|
||||||
|
;; Use opam switch to lookup ocamlmerlin binary
|
||||||
|
(setq merlin-command 'opam)
|
||||||
|
;; To easily change opam switches within a given Emacs session, you can
|
||||||
|
;; install the minor mode https://github.com/ProofGeneral/opam-switch-mode
|
||||||
|
;; and use one of its "OPSW" menus.
|
||||||
|
))
|
||||||
|
|
||||||
|
; Make company aware of merlin
|
||||||
|
(with-eval-after-load 'company
|
||||||
|
(add-to-list 'company-backends 'merlin-company-backend))
|
||||||
|
; Enable company on merlin managed buffers
|
||||||
|
(add-hook 'merlin-mode-hook 'company-mode)
|
||||||
|
|
||||||
|
;; Ocaml formatting using ocamlformat
|
||||||
|
(use-package ocamlformat
|
||||||
|
:custom (ocamlformat-enable 'enable-outside-detected-project)
|
||||||
|
:hook (before-save . ocamlformat-before-save)
|
||||||
|
)
|
||||||
|
|
||||||
;; GPTel with Llamafile config
|
;; GPTel with Llamafile config
|
||||||
;; Llama.cpp offers an OpenAI compatible API
|
;; Llama.cpp offers an OpenAI compatible API
|
||||||
(gptel-make-openai "openai"
|
;; See https://github.com/karthink/gptel?tab=readme-ov-file#llamacpp-or-llamafile
|
||||||
:stream t
|
;; (gptel-make-openai "Llamafile"
|
||||||
:header (lambda () `(("Authorization" . ,(concat "Bearer " (gptel--get-api-key)))))
|
;; :stream t
|
||||||
:key 'gptel-api-key
|
;; :host "127.0.0.1:8080"
|
||||||
:models '("gpt-3.5-turbo"))
|
|
||||||
|
|
||||||
;; Llama.cpp offers an OpenAI compatible API
|
|
||||||
;; (gptel-make-openai "llama-cpp" ;Any name
|
|
||||||
;; :stream t ;Stream responses
|
|
||||||
;; :protocol "http"
|
;; :protocol "http"
|
||||||
;; :host "127.0.0.1:8000" ;Llama.cpp server location
|
;; :key "no-key"
|
||||||
;; :models '("local")) ;Any names, doesn't matter for Llama
|
;; :models '("local"))
|
||||||
;; And now set it as the default backend
|
|
||||||
(setq gptel-default-mode 'org-mode)
|
;; (setq gptel-default-mode 'org-mode)
|
||||||
(setq-default gptel-backend (gptel-make-openai "Llamafile"
|
;; (setq-default gptel-backend (gptel-make-openai "Llamafile"
|
||||||
:stream t
|
;; :stream t
|
||||||
:host "127.0.0.1:8080"
|
;; :host "127.0.0.1:8080"
|
||||||
:protocol "http"
|
;; :protocol "http"
|
||||||
:key "no-key"
|
;; :key "no-key"
|
||||||
:models '("local"))
|
;; :models '("local"))
|
||||||
gptel-model "local")
|
;; gptel-model "local")
|
||||||
|
|
||||||
|
;; Basic .emacs with a good set of defaults, to be used as template for usage
|
||||||
|
;; with OCaml and OPAM
|
||||||
|
;;
|
||||||
|
;; Author: Louis Gesbert <louis.gesbert@ocamlpro.com>
|
||||||
|
;; Released under CC0
|
||||||
|
|
||||||
|
;; Generic, recommended configuration options
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;; ANSI color in compilation buffer
|
||||||
|
(require 'ansi-color)
|
||||||
|
(defun colorize-compilation-buffer ()
|
||||||
|
(toggle-read-only)
|
||||||
|
(ansi-color-apply-on-region (point-min) (point-max))
|
||||||
|
(toggle-read-only))
|
||||||
|
(add-hook 'compilation-filter-hook 'colorize-compilation-buffer)
|
||||||
|
|
||||||
|
;; Some key bindings
|
||||||
|
|
||||||
|
(global-set-key [f3] 'next-match)
|
||||||
|
(defun prev-match () (interactive nil) (next-match -1))
|
||||||
|
(global-set-key [(shift f3)] 'prev-match)
|
||||||
|
(global-set-key [backtab] 'auto-complete)
|
||||||
|
;; OCaml configuration
|
||||||
|
;; - better error and backtrace matching
|
||||||
|
|
||||||
|
(defun set-ocaml-error-regexp ()
|
||||||
|
(set
|
||||||
|
'compilation-error-regexp-alist
|
||||||
|
(list '("[Ff]ile \\(\"\\(.*?\\)\", line \\(-?[0-9]+\\)\\(, characters \\(-?[0-9]+\\)-\\([0-9]+\\)\\)?\\)\\(:\n\\(\\(Warning .*?\\)\\|\\(Error\\)\\):\\)?"
|
||||||
|
2 3 (5 . 6) (9 . 11) 1 (8 compilation-message-face)))))
|
||||||
|
|
||||||
|
(add-hook 'tuareg-mode-hook 'set-ocaml-error-regexp)
|
||||||
|
(add-hook 'caml-mode-hook 'set-ocaml-error-regexp)
|
||||||
|
;; ## added by OPAM user-setup for emacs / base ## 56ab50dc8996d2bb95e7856a6eddb17b ## you can edit, but keep this line
|
||||||
|
(require 'opam-user-setup "~/.emacs.d/opam-user-setup.el")
|
||||||
|
;; ## end of OPAM user-setup addition for emacs / base ## keep this line
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;; init.el ends here
|
;;; init.el ends here
|
||||||
|
Loading…
Reference in New Issue
Block a user