RBGV5L2RZ3QLWUYDVYEZ4YVTUS5BD4VYUQSYSPV2GXU6BSV3EFIQC
XH2KIPQWVRTDCPPICVCHNCFAWLMYB2URJIWVS6D4TTM27OAEUGOQC
RXCY7LD6ZRIOIKZEYKLMCYPMQPXF4DOEEFBDLVR2B22BXLZJFFBQC
A3TVGLVHSVLMEHLHB3TPBSD3QGNVGX3DIK6BEBDTTHWBNW4ALMRAC
IOXOZB2VUXVUEINLFBT4SPSJV32X5ZFT5FKSVRAIEXEFQJLG6MHQC
ABDQA6HCTOUQXY5IDGDTCDBR5DA2WAHUWHBS5EIRYNUJNQCM6GOQC
IOVPOFAVXEQIZ7BCFVVAWFW3RYFXPK2GOILDWA6N6QHQHLAJ4XTAC
F3ENAOSOVGL4WEGHDMXC7MHRZK2Q4M35YYW433N2ABZ6S3SU4AAQC
7XDDBWIHI2COD5CEUUTJUPHH24ZYCTZDIMXUXNKZZTUDGMADO6HAC
AXUYWO36BWJYEJQ7WDYJGK6KE66MA4NBE255ERLNGDPZSJORYTSQC
YXDBKG5MWREH25GV2RUUW7ZI4P2XBNMZSB77WND3A6LUAL4NN63QC
IUA6MCZWWCFQ4EJ4GBWYAPLM4IE7SFB34CGSJJTBVOAFTSL4EDEAC
WCMSYDW4CP3XTAWZV2IATSIMTTCWIAZ5ILB7CV4RHQVONJY57TPAC
UIXIJMKKE7STQ65EALHSRFO7J64YCRPRQOQRAX7FJ27455W4X3WAC
5FLRDDUAB7NCOKJKK57IVQBETGX7JTT7GVKFT46ORSZ7OJ7Q2UFQC
GVWBJPFZ5ICDWUOGNAGGS6LMJ7FZRBKYEQFGBVQ4HG5EJVTSGI5QC
C5ANTJP2SPCUH52MD7YRYUPQFECLCL2JELYPYHCNKLKALVXNWURAC
(progn ;; workaround until this fixed: https://github.com/emacs-evil/evil/issues/1129
;; or this: https://github.com/emacs-evil/evil/pull/1130
(defun config/fix-evil-window-move (orig-fun &rest args)
"Close Treemacs while moving windows around."
(let* ((treemacs-window (treemacs-get-local-window))
(is-active (and treemacs-window (window-live-p treemacs-window))))
(when is-active (treemacs))
(apply orig-fun args)
(when is-active
(save-selected-window
(treemacs)))))
(dolist (func '(evil-window-move-far-left
evil-window-move-far-right
evil-window-move-very-top
evil-window-move-very-bottom))
(advice-add func
:around #'config/fix-evil-window-move)))
(use-package org-projectile
:config
(progn
(org-projectile-per-project)
(setq org-projectile-per-project-filepath
"notes/README.org")
(setq org-agenda-files (append org-agenda-files (org-projectile-todo-files)))
(push (org-projectile-project-todo-entry) org-capture-templates)
(define-key projectile-mode-map (kbd "C-c c") 'org-capture))
:ensure t)
:init
(progn
(add-to-list 'interpreter-mode-alist (cons "node" 'js2-mode))
(setq-default js2-basic-offset 4)
(setq-default js-indent-level 4)
(add-hook 'js2-mode-hook 'flycheck-mode)
(customize-set-variable 'js2-mode-show-parse-errors nil)
(customize-set-variable 'js2-strict-missing-semi-warning nil)
(customize-set-variable 'js2-strict-trailing-comma-warning nil)
(customize-set-variable 'js2-strict-inconsistent-return-warning nil)))
:config
(modify-syntax-entry ?_ "w" js2-mode-syntax-table)
(add-to-list 'interpreter-mode-alist (cons "node" 'js2-mode))
(setq-default js2-basic-offset 4)
(setq-default js-indent-level 4)
(add-hook 'js2-mode-hook 'flycheck-mode)
(customize-set-variable 'js2-mode-show-parse-errors nil)
(customize-set-variable 'js2-strict-missing-semi-warning nil)
(customize-set-variable 'js2-strict-trailing-comma-warning nil)
(customize-set-variable 'js2-strict-inconsistent-return-warning nil))
(use-package js
:ensure t
:config
(modify-syntax-entry ?_ "w" js-mode-syntax-table)
;;; indent ternaries with arrow function correctly---
(defun js--looking-at-operator-p ()
"Return non-nil if point is on a JavaScript operator, other than a comma."
(save-match-data
(and (looking-at js--indent-operator-re)
(or (not (eq (char-after) ?:))
(save-excursion
(js--backward-syntactic-ws)
(when (memq (char-before) '(?\) ?})) (backward-list))
(and (js--re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
(eq (char-after) ??))))
(not (and
(eq (char-after) ?/)
(save-excursion
(eq (nth 3 (syntax-ppss)) ?/))))
(not (and
(eq (char-after) ?*)
;; Generator method (possibly using computed property).
(looking-at (concat "\\* *\\(?:\\[\\|" js--name-re " *(\\)"))
(save-excursion
(js--backward-syntactic-ws)
;; We might misindent some expressions that would
;; return NaN anyway. Shouldn't be a problem.
(memq (char-before) '(?, ?} ?{)))))))))
(use-package jest
:ensure t
:config
(defun jest--project-root ()
"Find the project root directory."
(let ((closest-package-json (fwoar--find-package-json))
(projectile-root (projectile-project-root)))
(message "%s <-> %s" closest-package-json projectile-root)
(if (s-prefix-p projectile-root closest-package-json)
closest-package-json
projectile-root))))
(magit-define-popup-action 'magit-dispatch-popup ?j "Browse remote" 'browse-at-remote))
;; TODO: figure this out with transients
(magit-define-popup-action 'magit-dispatch-popup ?j "Browse remote" 'browse-at-remote)
'magit-dispatch
)
(put 'narrow-to-page 'disabled nil)
(defun js--looking-at-operator-p ()
"Return non-nil if point is on a JavaScript operator, other than a comma."
(save-match-data
(and (looking-at js--indent-operator-re)
(or (not (eq (char-after) ?:))
(save-excursion
(js--backward-syntactic-ws)
(when (memq (char-before) '(?\) ?})) (backward-list))
(and (js--re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
(eq (char-after) ??))))
(not (and
(eq (char-after) ?/)
(save-excursion
(eq (nth 3 (syntax-ppss)) ?/))))
(not (and
(eq (char-after) ?*)
;; Generator method (possibly using computed property).
(looking-at (concat "\\* *\\(?:\\[\\|" js--name-re " *(\\)"))
(save-excursion
(js--backward-syntactic-ws)
;; We might misindent some expressions that would
;; return NaN anyway. Shouldn't be a problem.
(memq (char-before) '(?, ?} ?{))))))))
(progn ;; workaround until this fixed: https://github.com/emacs-evil/evil/issues/1129
;; or this: https://github.com/emacs-evil/evil/pull/1130
(defun config/fix-evil-window-move (orig-fun &rest args)
"Close Treemacs while moving windows around."
(let* ((treemacs-window (treemacs-get-local-window))
(is-active (and treemacs-window (window-live-p treemacs-window))))
(when is-active (treemacs))
(apply orig-fun args)
(when is-active
(save-selected-window
(treemacs)))))
(dolist (func '(evil-window-move-far-left evil-window-move-far-right evil-window-move-very-top evil-window-move-very-bottom))
(advice-add func :around #'config/fix-evil-window-move)))
(defun camel-kebab (string)
(defun fwoar/camel-kebab (string)
(insert (camel-kebab target)))))
(use-package org-projectile
:config
(progn
(org-projectile-per-project)
(setq org-projectile-per-project-filepath
"notes/README.org")
(setq org-agenda-files (append org-agenda-files (org-projectile-todo-files)))
(push (org-projectile-project-todo-entry) org-capture-templates)
(define-key projectile-mode-map (kbd "C-c c") 'org-capture))
:ensure t)
(use-package org-projectile-helm
:after org-projectile
:config
(define-key projectile-mode-map (kbd "C-c n p") 'org-projectile-helm-template-or-project))
(use-package deadgrep
:ensure t)
(insert (fwoar/camel-kebab target)))))
(use-package jest
:ensure t
:config
(defun jest--project-root ()
"Find the project root directory."
(let ((closest-package-json (fwoar--find-package-json))
(projectile-root (projectile-project-root)))
(message "%s <-> %s" closest-package-json projectile-root)
(if (s-prefix-p projectile-root closest-package-json)
closest-package-json
projectile-root))))