Skip to content

Commit

Permalink
chore: misc
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Jan 2, 2025
1 parent 2a7f967 commit e2f2a66
Show file tree
Hide file tree
Showing 9 changed files with 6,642 additions and 260 deletions.
26 changes: 26 additions & 0 deletions .doom.d/autoload.el
Original file line number Diff line number Diff line change
Expand Up @@ -1148,3 +1148,29 @@ It can be used to review the magit diff for my change, or other people's"
(mark-whole-buffer)
(copilot-chat-custom-prompt-selection)
(deactivate-mark)))

;;;###autoload
(defun ++emacs (elisp-string)
"Pretty print and evaluate ELISP-STRING after user confirmation.
Returns evaluation result if confirmed, otherwise returns rejection message."
(let* ((help-window-name "*Eval Preview*")
(formatted-code (with-temp-buffer
(insert elisp-string)
(emacs-lisp-mode)
(indent-region (point-min) (point-max))
(buffer-string)))
(result
(progn
(with-help-window help-window-name
(princ "About to evaluate:\n\n")
(princ formatted-code))
(if (yes-or-no-p "Evaluate this code? ")
(format "Evaluate result from Emacs:
\"\"\"
%S
\"\"\""
(eval (read elisp-string)))
"user rejected your request"))))
(when-let ((window (get-buffer-window help-window-name)))
(quit-window t window))
result))
1 change: 0 additions & 1 deletion .doom.d/better-default.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
split-window-keep-point t
require-final-newline nil
mode-require-final-newline nil
auto-window-vscroll nil
confirm-kill-processes nil
browse-url-generic-program "open"
browse-url-browser-function #'eww-browse-url
Expand Down
7 changes: 7 additions & 0 deletions .doom.d/helper.el
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@
(unless prepend (goto-char (point-max)))
(when newline (unless (bolp) (newline)))
(insert content))))))

(defun +current-buffer-from-client ()
(window-buffer (selected-window)))

(defun +workspace-project-root ()
(with-current-buffer (+current-buffer-from-client)
(projectile-project-root)))
2 changes: 1 addition & 1 deletion .doom.d/navigation.el
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
((file-remote-p project nil t) (file-readable-p project))
;; ((file-remote-p project))
((not (file-remote-p project)) (file-readable-p project))))
(defun +projectile-status-mobile-project-p ()
(defun +projectile-status-mobile-project-p (&optional arg)
(require 's)
(s-ends-with? "status-mobile/" (doom-project-root)))
(projectile-register-project-type 'status-mobile '+projectile-status-mobile-project-p
Expand Down
2 changes: 1 addition & 1 deletion modules/yqrashawn/home-manager/cli/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let
if ! typeset -f _asdf > /dev/null; then
fpath=(${pkgs.asdf-vm}/share/zsh/site-functions $fpath)
fi
export PNPM_HOME="/Users/$HOME/.local/share/pnpm"
export PNPM_HOME="/$HOME/.local/share/pnpm"
'';
zshProfileExtra = ''
fpath=($HOME/.zfunc $fpath)
Expand Down
4 changes: 2 additions & 2 deletions modules/yqrashawn/home-manager/dotfiles/aerospace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ automatically-unhide-macos-hidden-apps = false

## workspaces
[workspace-to-monitor-force-assignment]
B = '^LG'
C = '^Studio'
C = '^LG'
B = '^Studio'
T = '^DELL'
M = '^DELL'
1 = '^DELL'
Expand Down
7 changes: 5 additions & 2 deletions modules/yqrashawn/home-manager/dotfiles/karabiner.edn
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,11 @@
"^com\\.apple\\.Terminal$" "^com\\.googlecode\\.iterm2$"
"^co\\.zeit\\.hyperterm$" "^co\\.zeit\\.hyper$" "^io\\.alacritty$"
"^com\\.github\\.wez\\.wezterm$" "^net\\.kovidgoyal\\.kitty$"
"^com\\.raphaelamorim\\.rio$"]
"^com\\.raphaelamorim\\.rio$" "^com\\.mitchellh\\.ghostty$"]
:Emacs ["^org\\.gnu\\.Emacs$" "^org\\.gnu\\.AquamacsEmacs$"
"^org\\.gnu\\.Aquamacs$"]
"^org\\.gnu\\.Aquamacs$"
;; "^com\\.mitchellh\\.ghostty$"
]
:lem [:paths "common-lisp/lem/lem$"]
:Safari ["^com\\.apple\\.Safari$"]
:Chromes ["^org\\.chromium\\.Chromium$"
Expand All @@ -897,6 +899,7 @@
"^com\\.github\\.wez\\.wezterm$"
"^net\\.kovidgoyal\\.kitty$"
"^com\\.raphaelamorim\\.rio$"
"^com\\.mitchellh\\.ghostty$"
;; "^dev\\.warp\\.Warp.*"
]
:vim-mode-disabled-application
Expand Down
Loading

0 comments on commit e2f2a66

Please sign in to comment.