Skip to content

Commit

Permalink
feat: toggle log spy
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Nov 3, 2024
1 parent eb7cc6d commit 1d7473a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
42 changes: 25 additions & 17 deletions .doom.d/autoload.el
Original file line number Diff line number Diff line change
Expand Up @@ -624,28 +624,36 @@ _b_ranch _j_next _k_prev _h_up
(log-spy-str (if prefix-info
(concat log-spy-str " :info")
log-spy-str)))
(save-excursion
(evil-emacs-state 1)
(if (+lispy-special-p) (lispy-mark) (lispy-mark-symbol))
(call-interactively 'lispy-parens)
(unless (string= (string (following-char)) " ") (forward-char))
(insert (if (string= (string (following-char)) " ") log-spy-str (concat log-spy-str " ")))
(lispy-left 1)
(evil-normal-state 1)))
(unless (+lispy-special-p) (lispy-left 1)))
(if (string= (symbol-at-point) log-spy-str)
(progn
(sp-kill-sexp)
(paredit-splice-sexp))
(progn (save-excursion
(evil-emacs-state 1)
(if (+lispy-special-p) (lispy-mark) (lispy-mark-symbol))
(call-interactively 'lispy-parens)
(unless (string= (string (following-char)) " ") (forward-char))
(insert (if (string= (string (following-char)) " ") log-spy-str (concat log-spy-str " ")))
(lispy-left 1)
(evil-normal-state 1))
(unless (+lispy-special-p) (lispy-left 1))))))

;;;###autoload
(defun log/--spy (arg)
(interactive "P")
(let ((log-spy-str "log/spy"))
(save-excursion
(evil-emacs-state 1)
(if (+lispy-special-p) (lispy-mark) (lispy-mark-symbol))
(call-interactively 'lispy-parens)
(unless (string= (string (following-char)) " ") (forward-char))
(insert (if (string= (string (following-char)) " ") log-spy-str (concat log-spy-str " ")))
(lispy-left 1)
(evil-normal-state 1)))
(if (eq (symbol-at-point) 'log/spy)
(progn
(sp-kill-sexp)
(paredit-splice-sexp))
(save-excursion
(evil-emacs-state 1)
(if (+lispy-special-p) (lispy-mark) (lispy-mark-symbol))
(call-interactively 'lispy-parens)
(unless (string= (string (following-char)) " ") (forward-char))
(insert (if (string= (string (following-char)) " ") log-spy-str (concat log-spy-str " ")))
(lispy-left 1)
(evil-normal-state 1))))
(unless (+lispy-special-p) (lispy-left 1)))

;;;###autoload
Expand Down
4 changes: 2 additions & 2 deletions modules/yqrashawn/home-manager/dotfiles/karabiner.edn
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@
;; [:j [:hsl "/Applications/kitty.app"]]
[:j [:op "/Applications/kitty.app"]]
;; [:k :same_wind_app :Emacs]
;; [:k [:hsl "/Applications/Emacs.app"]]
[:k [:op "/Applications/Emacs.app"]]
[:k [:hsl "/Applications/Emacs.app"]]
;; [:k [:op "/Applications/Emacs.app"]]
;; [:k [:yfocus "Emacs"]]
;; [: [:togg "Logseq"]]
;; [:u [:hsl "Roam Research"]]
Expand Down

0 comments on commit 1d7473a

Please sign in to comment.