This commit is contained in:
Andre Henriques 2023-03-25 23:25:38 +00:00
parent df5eed3f28
commit 675d8f21bb
2 changed files with 130 additions and 128 deletions

2
.gitignore vendored
View File

@ -4,3 +4,5 @@ projectile-bookmarks.eld
recentf recentf
settings.el settings.el
transient/ transient/
.cache/
straight/

View File

@ -9,12 +9,12 @@
(use-package afternoon-theme (use-package afternoon-theme
:ensure t :ensure t
:config :config
;;(load-theme 'afternoon t) (load-theme 'afternoon t)
) )
(use-package modus-themes (use-package modus-themes
:ensure t :ensure t
:config :config
(load-theme 'modus-operandi t) ;;(load-theme 'modus-operandi t)
) )
#+end_src #+end_src
** UI ** UI
@ -169,30 +169,30 @@ Setup tree sitter based indentation
#+end_src #+end_src
*** tsx *** tsx
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package coverlay ;; (use-package coverlay
:ensure t) ;; :ensure t)
;;
(use-package origami ;; (use-package origami
:ensure t) ;; :ensure t)
;;
(use-package css-in-js-mode ;; (use-package css-in-js-mode
:straight '(css-in-js-mode ;; :straight '(css-in-js-mode
:type git ;; :type git
:host github ;; :host github
:repo "orzechowskid/tree-sitter-css-in-js")) ;; :repo "orzechowskid/tree-sitter-css-in-js"))
;;
(use-package corfu ;; (use-package corfu
:ensure t) ;; :ensure t)
;;
(setq eglot-server-programs '()) ;; (setq eglot-server-programs '())
(use-package tsx-mode ;; (use-package tsx-mode
:straight '(tsx-mode ;; :straight '(tsx-mode
:type git ;; :type git
:host github ;; :host github
:repo "orzechowskid/tsx-mode.el" ;; :repo "orzechowskid/tsx-mode.el"
:branch "emacs29") ;; :branch "emacs29")
:config ;; :config
(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . tsx-mode))) ;; (add-to-list 'auto-mode-alist '("\\.tsx?\\'" . tsx-mode)))
#+end_src #+end_src
*** webmode *** webmode
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -338,15 +338,16 @@ Set up lsp
;;(XXX-mode . lsp-mode) ;;(XXX-mode . lsp-mode)
;;(typescriptreact-mode . lsp-mode) ;;(typescriptreact-mode . lsp-mode)
;;(tsx-mode . lsp-mode)
;;(tsx-ts-mode . lsp-mode)
(typescript-mode . lsp-mode) (typescript-mode . lsp-mode)
(tsx-mode . lsp-mode)
(tsx-ts-mode . lsp-mode)
(web-mode . lsp-mode) (web-mode . lsp-mode)
(lsp-mode . lsp-enable-which-key-integration)) (lsp-mode . lsp-enable-which-key-integration))
:commands lsp :commands lsp
:config :config
(add-hook 'tsx-mode-hook 'lsp-mode)) ;;(add-hook 'tsx-mode-hook 'lsp-mode)
)
#+end_src #+end_src
Set up lsp ui Set up lsp ui
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -374,6 +375,19 @@ Set up ivy
:commands lsp-ivy-workspace-symbol) :commands lsp-ivy-workspace-symbol)
#+end_src #+end_src
** Flycheck ** Flycheck
*** Helper function
#+begin_src emacs-lisp
(defun define-level-info (name severity compilation-level margin-str)
(flycheck-define-error-level name
:severity severity
:compilation-level compilation-level
:overlay-category 'flycheck-info-overlay
:margin-spec (flycheck-make-margin-spec margin-str 'flycheck-fringe-info)
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
:fringe-face 'flycheck-fringe-info
:error-list-face 'flycheck-error-list-info))
#+end_src
*** Flycheck
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package flycheck (use-package flycheck
:ensure t :ensure t
@ -407,32 +421,9 @@ Set up ivy
:fringe-face 'flycheck-fringe-warning :fringe-face 'flycheck-fringe-warning
:error-list-face 'flycheck-error-list-warning) :error-list-face 'flycheck-error-list-warning)
(flycheck-define-error-level 'info (define-level-info 'info -10 0 "🅰")
:severity -10 (define-level-info 'lsp-flycheck-info-unnecessary -10 0 "🅰")
:compilation-level 0 (define-level-info 'hint -20 -1 "🆓")
:overlay-category 'flycheck-info-overlay
:margin-spec (flycheck-make-margin-spec "🅰" 'flycheck-fringe-info)
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
:fringe-face 'flycheck-fringe-info
:error-list-face 'flycheck-error-list-info)
(flycheck-define-error-level 'lsp-flycheck-info-unnecessary
:severity -10
:compilation-level 0
:overlay-category 'flycheck-info-overlay
:margin-spec (flycheck-make-margin-spec "🅰" 'flycheck-fringe-info)
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
:fringe-face 'flycheck-fringe-info
:error-list-face 'flycheck-error-list-info)
(flycheck-define-error-level 'hint
:severity -20
:compilation-level -1
:overlay-category 'flycheck-info-overlay
:margin-spec (flycheck-make-margin-spec "🆓" 'flycheck-fringe-info)
:fringe-bitmap'flycheck-fringe-bitmap-double-arrow
:fringe-face 'flycheck-fringe-info
:error-list-face 'flycheck-error-list-info)
;; …every time Flycheck is activated in a new buffer ;; …every time Flycheck is activated in a new buffer
(add-hook 'flycheck-mode-hook #'my/set-flycheck-margins) (add-hook 'flycheck-mode-hook #'my/set-flycheck-margins)
@ -444,36 +435,45 @@ Fly check post tip
;; :ensure t ;; :ensure t
;; :hook (flycheck-mode . flycheck-pos-tip-mode)) ;; :hook (flycheck-mode . flycheck-pos-tip-mode))
#+end_src #+end_src
Fly check inline Fly check inline (disabled because was getting annoyed)
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package flycheck-posframe ;; (use-package flycheck-posframe
:ensure t ;; :ensure t
:after flycheck ;; :after flycheck
:hook (flycheck-mode . flycheck-posframe-mode) ;; :hook (flycheck-mode . flycheck-posframe-mode)
:config ;; :config
(flycheck-posframe-configure-pretty-defaults) ;; (flycheck-posframe-configure-pretty-defaults)
(setq flycheck-posframe-error-prefix "☣️❤️") ;; (setq flycheck-posframe-error-prefix "☣️❤️")
(setq flycheck-posframe-warning-prefix "🅰😞") ;; (setq flycheck-posframe-warning-prefix "🅰😞")
(setq flycheck-posframe-info-prefix "🅰🆓") ;; (setq flycheck-posframe-info-prefix "🅰🆓")
(set-face-attribute 'flycheck-posframe-error-face ;; (set-face-attribute 'flycheck-posframe-error-face
nil ;; nil
:inherit nil ;; :inherit nil
:foreground "#b72c01") ;; :foreground "#b72c01")
(set-face-attribute 'flycheck-posframe-warning-face ;; (set-face-attribute 'flycheck-posframe-warning-face
nil ;; nil
:foreground "#b77401") ;; :foreground "#b77401")
;;
(set-face-attribute 'flycheck-posframe-info-face ;; (set-face-attribute 'flycheck-posframe-info-face
nil ;; nil
:foreground "#0156b7") ;; :foreground "#0156b7")
;;
(setq flycheck-posframe-border-width 3) ;; (setq flycheck-posframe-border-width 1)
(set-face-attribute 'flycheck-posframe-border-face ;; (setq flycheck-posframe-position 'point-top-left-corner)
nil ;;
:foreground "#dc752f") ;; (set-face-attribute 'flycheck-posframe-border-face
(add-to-list 'flycheck-posframe-inhibit-functions #'(lambda () company-backend))) ;; nil
;; :foreground "#dc752f")
;; (add-to-list 'flycheck-posframe-inhibit-functions #'(lambda () company-backend)))
#+end_src #+end_src
** TIDE
#+begin_src emacs-lisp
(use-package tide
:ensure t
:after (typescript-mode company flycheck)
:hook ((typescript-mode . tide-setup)
(typescript-mode . tide-hl-identifier-mode)
(before-save . tide-format-before-save)))
(add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-mode))
#+end_src