Skip to content

Commit

Permalink
fix: +clojure-modes-hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
yqrashawn committed Feb 7, 2025
1 parent 3521821 commit 5dbaee7
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
4 changes: 3 additions & 1 deletion .doom.d/autoload.el
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,9 @@ _b_ranch _j_next _k_prev _h_up
(goto-char (point-max))
(and (ignore-errors (re-search-backward "\\[taoensso.timbre :as log\\]")) (call-interactively #'lispyville-delete-whole-line))
(goto-char (point-max))
(and (ignore-errors (re-search-backward "\\[io.pedestal.log :as log\\]")) (call-interactively #'lispyville-delete-whole-line))))))
(and (ignore-errors (re-search-backward "\\[io.pedestal.log :as log\\]")) (call-interactively #'lispyville-delete-whole-line))
(goto-char (point-max))
(and (ignore-errors (re-search-backward "\\[\"@/spy\" :as log\\]")) (call-interactively #'lispyville-delete-whole-line))))))

;; https://xenodium.com/png-to-icns-emacs-dwim-style/
;;;###autoload
Expand Down
12 changes: 8 additions & 4 deletions .doom.d/clojure.el
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
clojure-align-reader-conditionals t
clojure-defun-indents '(fn-traced))

(setq-hook! +clojure-modes-hooks
(setq-hook!
'(clojure-mode-hook clojurec-mode-hook clojurescript-mode-hook)
evil-shift-width 1
lsp-lens-enable nil
lsp-ui-sideline-show-code-actions nil
Expand Down Expand Up @@ -137,7 +138,8 @@ If INSERT-BEFORE is non-nil, insert before the form, otherwise afterwards."
;; fix Regular expression too big
;; https://github.com/clojure-emacs/cider/issues/2866
;; (setq-local cider-font-lock-dynamically '(macro core deprecated function var))
(setq-local cider-font-lock-dynamically '(macro core deprecated)))
(setq-local cider-font-lock-dynamically '(macro core deprecated)
corfu-auto-delay 0.24))

(defun +clojure-use-lsp-over-cider ()
"use clojure-lsp over cider for completion when cider is not connected"
Expand All @@ -147,7 +149,8 @@ If INSERT-BEFORE is non-nil, insert before the form, otherwise afterwards."
#'lsp-completion-at-point)
(add-hook! 'completion-at-point-functions :local :depth -99
#'cider-complete-at-point)
(setq-local cider-font-lock-dynamically nil))
(setq-local cider-font-lock-dynamically nil
corfu-auto-delay 0.5))

(defun +setup-clojure-mode ()
"sort namespace, cleanup log namespace on save"
Expand All @@ -164,7 +167,8 @@ If INSERT-BEFORE is non-nil, insert before the form, otherwise afterwards."
cider-connected-hook
cider-mode-hook
lsp-completion-mode-hook))))
(add-hook! +setup-clojure-mode-hooks '+setup-clojure-mode))
(dolist (h +setup-clojure-mode-hooks)
(add-hook h '+setup-clojure-mode)))

(defun +cider-enable-fuzzy-completion ()
(interactive)
Expand Down
3 changes: 2 additions & 1 deletion .doom.d/lang.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
lsp-eslint-package-manager "npm"
lsp-eslint-run "onSave"
lsp-eslint-auto-fix-on-save t
lsp-semantic-tokens-enable t
lsp-semantic-tokens-enable nil
lsp-completion-show-detail t
lsp-completion-show-kind t
lsp-completion-sort-initial-results nil)
Expand Down Expand Up @@ -71,6 +71,7 @@

(after! lsp-ui
(setq!
lsp-ui-sideline-enable nil
lsp-ui-doc-show-with-cursor nil
lsp-ui-imenu-auto-refresh t
lsp-ui-doc-header t
Expand Down
4 changes: 3 additions & 1 deletion modules/yqrashawn/home-manager/cli/direnv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ in {
config = {
global = { load_dotenv = true; };
whitelist = {
prefix = [ "${home}/workspace/office" "${home}/workspace/home" ];
prefix = [ "${home}/workspace/office"
"${home}/workspace/home"
"/opt/homebrew/var/buildkite-agent/builds" ];
exact = [ "${home}/miniser" ];
};
};
Expand Down
4 changes: 2 additions & 2 deletions modules/yqrashawn/home-manager/dotfiles/.tridactylrc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ bind ]] followpage next
bind [[ followpage prev
bind [c urlincrement -1
bind ]c urlincrement 1
bind <C-x> urlincrement -1
bind <C-a> urlincrement 1
" bind <C-x> urlincrement -1
" bind <C-a> urlincrement 1
bind T current_url tabopen
bind yy clipboard yank
bind ys clipboard yankshort
Expand Down
2 changes: 1 addition & 1 deletion modules/yqrashawn/home-manager/dotfiles/clojure_lsp.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{:add-missing {:add-to-rcf :always}
:java {:download-jdk-source? true}
:semantic-tokens? true
:semantic-tokens? false
:source-aliases #{:dev :test :cljs}}
22 changes: 22 additions & 0 deletions modules/yqrashawn/home-manager/dotfiles/local-bins/killport
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# killport.sh: kill the process listening on a specific port.
# Usage: killport 3000

if [ -z "$1" ]; then
echo "Usage: $0 PORT_NUMBER"
exit 1
fi

PORT=$1

# Get the process IDs (PIDs) that are listening on the port.
# The '-t' flag ensures only the numeric PID is returned.
PIDS=$(lsof -t -i:"$PORT")

if [ -z "$PIDS" ]; then
echo "No process is listening on port $PORT"
exit 0
fi

echo "Killing process(es) on port $PORT: $PIDS"
kill -9 $PIDS

0 comments on commit 5dbaee7

Please sign in to comment.