Compare commits
No commits in common. "858d26129bdcff2d6b719146f2a5e814f68d9a41" and "06ba9c724fee0e3438dd4823637e459220e47830" have entirely different histories.
858d26129b
...
06ba9c724f
@ -247,9 +247,8 @@ Finish up
|
|||||||
ob-rust
|
ob-rust
|
||||||
haskell-mode
|
haskell-mode
|
||||||
clojure-mode
|
clojure-mode
|
||||||
cider
|
|
||||||
flycheck-clj-kondo
|
|
||||||
sly
|
sly
|
||||||
|
cider
|
||||||
fsharp-mode
|
fsharp-mode
|
||||||
go-mode
|
go-mode
|
||||||
json-mode
|
json-mode
|
||||||
@ -269,7 +268,7 @@ Finish up
|
|||||||
(gptel :url "https://github.com/karthink/gptel")
|
(gptel :url "https://github.com/karthink/gptel")
|
||||||
(indent-bars :url "https://github.com/jdtsmith/indent-bars")
|
(indent-bars :url "https://github.com/jdtsmith/indent-bars")
|
||||||
(pyenv :url "https://github.com/jorgenschaefer/pyvenv")
|
(pyenv :url "https://github.com/jorgenschaefer/pyvenv")
|
||||||
(time-zones :url "https://github.com/xenodium/time-zones")
|
(doom-themes :url "https://github.com/JosephFerano/doom-themes")
|
||||||
(org-timeblock :url "https://github.com/ichernyshovvv/org-timeblock")
|
(org-timeblock :url "https://github.com/ichernyshovvv/org-timeblock")
|
||||||
(dape :url "https://github.com/svaante/dape")
|
(dape :url "https://github.com/svaante/dape")
|
||||||
(odin-mode :url "https://github.com/mattt-b/odin-mode")
|
(odin-mode :url "https://github.com/mattt-b/odin-mode")
|
||||||
@ -517,9 +516,7 @@ Setup other stuff
|
|||||||
(doom-modeline-mode)
|
(doom-modeline-mode)
|
||||||
(doom-modeline-def-modeline 'main
|
(doom-modeline-def-modeline 'main
|
||||||
'(bar modals bar window-number matches buffer-info remote-host buffer-position word-count selection-info)
|
'(bar modals bar window-number matches buffer-info remote-host buffer-position word-count selection-info)
|
||||||
'(parrot objed-state misc-info battery grip irc mu4e gnus github debug repl lsp vcs bar input-method indent-info buffer-encoding bar major-mode process))
|
'(parrot objed-state misc-info battery grip irc mu4e gnus github debug repl lsp bar input-method indent-info buffer-encoding bar major-mode process))
|
||||||
(setq doom-modeline-vcs-max-length 20)
|
|
||||||
|
|
||||||
;; Show the tab names, just put this at the car of the previous list
|
;; Show the tab names, just put this at the car of the previous list
|
||||||
;; workspace-name
|
;; workspace-name
|
||||||
;; Set default mode-line
|
;; Set default mode-line
|
||||||
@ -844,8 +841,8 @@ Fill region is great, except when you don't need it...
|
|||||||
(define-key global-map (kbd "C-=") #'er/expand-region)
|
(define-key global-map (kbd "C-=") #'er/expand-region)
|
||||||
(define-key global-map (kbd "C-+") #'er/contract-region)
|
(define-key global-map (kbd "C-+") #'er/contract-region)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** COMMENT Boon
|
*** Boon
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp :tangle no
|
||||||
(defun joe/psp-scroll-down-half-page ()
|
(defun joe/psp-scroll-down-half-page ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(pixel-scroll-precision-scroll-down-page (/ (window-pixel-height) 2)))
|
(pixel-scroll-precision-scroll-down-page (/ (window-pixel-height) 2)))
|
||||||
@ -936,7 +933,7 @@ Fill region is great, except when you don't need it...
|
|||||||
(kbd "SPC p") project-prefix-map
|
(kbd "SPC p") project-prefix-map
|
||||||
(kbd "SPC q") 'kill-buffer-and-window
|
(kbd "SPC q") 'kill-buffer-and-window
|
||||||
(kbd "SPC h") 'help-command
|
(kbd "SPC h") 'help-command
|
||||||
(kbd "SPC k") 'kill-current-buffer
|
(kbd "SPC k") 'kill-this-buffer
|
||||||
(kbd "SPC hf") 'helpful-callable
|
(kbd "SPC hf") 'helpful-callable
|
||||||
(kbd "SPC hv") 'helpful-variable
|
(kbd "SPC hv") 'helpful-variable
|
||||||
(kbd "SPC hk") 'helpful-key
|
(kbd "SPC hk") 'helpful-key
|
||||||
@ -1015,7 +1012,7 @@ Fill region is great, except when you don't need it...
|
|||||||
** Buffers
|
** Buffers
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(global-set-key (kbd "C-x k") #'kill-current-buffer)
|
(global-set-key (kbd "C-x k") #'kill-this-buffer)
|
||||||
|
|
||||||
(global-set-key (kbd "C-x M-k") #'kill-buffer)
|
(global-set-key (kbd "C-x M-k") #'kill-buffer)
|
||||||
(require 'all-the-icons-ibuffer)
|
(require 'all-the-icons-ibuffer)
|
||||||
@ -1086,9 +1083,9 @@ Harpoon lets you quickly switch between bookmarked buffers
|
|||||||
|
|
||||||
;; (setq display-buffer-alist nil)
|
;; (setq display-buffer-alist nil)
|
||||||
|
|
||||||
;; (setq joe/popper-side-toggle 'right)
|
(setq joe/popper-side-toggle 'right)
|
||||||
;; (defun joe/window-split-vertical () (interactive) (set 'joe/popper-side-toggle 'right))
|
(defun joe/window-split-vertical () (interactive) (set 'joe/popper-side-toggle 'right))
|
||||||
;; (defun joe/window-split-horizontal () (interactive) (set 'joe/popper-side-toggle 'below))
|
(defun joe/window-split-horizontal () (interactive) (set 'joe/popper-side-toggle 'below))
|
||||||
|
|
||||||
(define-key ctl-x-4-map (kbd "|") #'joe/window-split-vertical)
|
(define-key ctl-x-4-map (kbd "|") #'joe/window-split-vertical)
|
||||||
(define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal)
|
(define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal)
|
||||||
@ -1122,15 +1119,15 @@ Harpoon lets you quickly switch between bookmarked buffers
|
|||||||
(windmove-down)
|
(windmove-down)
|
||||||
(joe/qtile-move-dir "down")))
|
(joe/qtile-move-dir "down")))
|
||||||
|
|
||||||
(global-set-key (kbd "s-h") #'joe/windmove-left)
|
;; (global-set-key (kbd "s-h") #'joe/windmove-left)
|
||||||
(global-set-key (kbd "s-l") #'joe/windmove-right)
|
;; (global-set-key (kbd "s-l") #'joe/windmove-right)
|
||||||
(global-set-key (kbd "s-k") #'joe/windmove-up)
|
;; (global-set-key (kbd "s-k") #'joe/windmove-up)
|
||||||
(global-set-key (kbd "s-j") #'joe/windmove-down)
|
;; (global-set-key (kbd "s-j") #'joe/windmove-down)
|
||||||
|
|
||||||
;; (global-set-key (kbd "s-h") #'windmove-left)
|
(global-set-key (kbd "s-h") #'windmove-left)
|
||||||
;; (global-set-key (kbd "s-l") #'windmove-right)
|
(global-set-key (kbd "s-l") #'windmove-right)
|
||||||
;; (global-set-key (kbd "s-k") #'windmove-up)
|
(global-set-key (kbd "s-k") #'windmove-up)
|
||||||
;; (global-set-key (kbd "s-j") #'windmove-down)
|
(global-set-key (kbd "s-j") #'windmove-down)
|
||||||
|
|
||||||
;; There's a bug in Gnome where frames are resized to the wrong dimensions
|
;; There's a bug in Gnome where frames are resized to the wrong dimensions
|
||||||
(defun joe/resize-frames ()
|
(defun joe/resize-frames ()
|
||||||
@ -1842,11 +1839,9 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
|
|||||||
#+end_src
|
#+end_src
|
||||||
** Email
|
** Email
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq mu4e-dir-path "/usr/local/share/emacs/site-lisp/mu4e/")
|
(when (file-exists-p "/usr/share/emacs/site-lisp/mu4e/")
|
||||||
(when (file-exists-p mu4e-dir-path)
|
(add-to-list 'load-path "/usr/share/emacs/site-lisp/mu4e/")
|
||||||
(add-to-list 'load-path mu4e-dir-path)
|
|
||||||
(require 'mu4e)
|
(require 'mu4e)
|
||||||
(setq mu4e-use-maildirs-extension nil)
|
|
||||||
|
|
||||||
;; Attach files to a message composition buffer by going into `dired'
|
;; Attach files to a message composition buffer by going into `dired'
|
||||||
;; and doing C-c C-m C-a (M-x `gnus-dired-attach').
|
;; and doing C-c C-m C-a (M-x `gnus-dired-attach').
|
||||||
@ -1935,12 +1930,46 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
|
|||||||
'((:maildir "/ferano.io/Inbox" :key ?f)
|
'((:maildir "/ferano.io/Inbox" :key ?f)
|
||||||
(:maildir "/gmail/Inbox" :key ?g)))
|
(:maildir "/gmail/Inbox" :key ?g)))
|
||||||
|
|
||||||
(add-hook 'mu4e-thread-mode-hook #'mu4e-thread-fold-all)
|
(mu4e 't)
|
||||||
;; (mu4e 't)
|
|
||||||
(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display))
|
(add-hook 'after-init-hook #'mu4e-alert-enable-mode-line-display))
|
||||||
;; (:name "Ferano.io Unread" :query "m:/ferano.io/Inbox AND g:unread" :key ?u)))
|
;; (:name "Ferano.io Unread" :query "m:/ferano.io/Inbox AND g:unread" :key ?u)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
Fold threads. This is a gist provided by Rougier [[https://gist.github.com/rougier/98e83fb50e19fb73fe34a7ecc5fc1ccc][here]]. His other package is
|
||||||
|
[[https://github.com/rougier/mu4e-thread-folding][mu4e-thread-folding]] but they work slightly differently. Code for the latter will
|
||||||
|
be kept here commented out in case we want to try it again.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
(when (file-exists-p "/usr/share/emacs/site-lisp/mu4e/")
|
||||||
|
(load-file "/home/joe/Dotfiles/.config/emacs/elisp/mu4e-fast-folding.el")
|
||||||
|
|
||||||
|
(evil-define-key 'normal mu4e-headers-mode-map (kbd "TAB")
|
||||||
|
#'mu4e-fast-folding-thread-toggle)
|
||||||
|
|
||||||
|
(evil-define-key 'normal mu4e-headers-mode-map (kbd "<backtab>")
|
||||||
|
#'mu4e-fast-folding-thread-toggle-all))
|
||||||
|
|
||||||
|
;; (load-file "/home/joe/Dotfiles/.config/emacs/elisp/mu4e-thread-folding.el")
|
||||||
|
;; (require 'mu4e-fast-folding)
|
||||||
|
;; (add-to-list 'mu4e-header-info-custom
|
||||||
|
;; '(:empty . (:name "Empty"
|
||||||
|
;; :shortname ""
|
||||||
|
;; :function (lambda (msg) " "))))
|
||||||
|
;; (setq mu4e-headers-fields '((:empty . 2)
|
||||||
|
;; (:human-date . 12)
|
||||||
|
;; (:flags . 6)
|
||||||
|
;; (:mailing-list . 10)
|
||||||
|
;; (:from . 22)
|
||||||
|
;; (:subject . nil)))
|
||||||
|
;; (evil-define-key 'normal mu4e-headers-mode-map (kbd "TAB")
|
||||||
|
;; #'mu4e-headers-fold-at-point)
|
||||||
|
|
||||||
|
;; (evil-define-key 'normal mu4e-headers-mode-map (kbd "<backtab>")
|
||||||
|
;; #'mu4e-headers-unfold-at-point)
|
||||||
|
|
||||||
|
;; (mu4e-thread-folding-mode +1)
|
||||||
|
#+end_src
|
||||||
** Avy
|
** Avy
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@ -1977,13 +2006,12 @@ odd looking ~'(t .t)~ is for specifying a default for all other actions.
|
|||||||
(setq vterm-max-scrollback 100000)
|
(setq vterm-max-scrollback 100000)
|
||||||
(setq vterm-kill-buffer-on-exit t)
|
(setq vterm-kill-buffer-on-exit t)
|
||||||
|
|
||||||
;; (defun joe/close-popup-buffer (vterm-buf event-msg)
|
(defun joe/close-popup-buffer (vterm-buf event-msg)
|
||||||
;; (unless (or (eq popper-popup-status nil)
|
(unless (or (eq popper-popup-status nil)
|
||||||
;; (eq popper-popup-status 'raised))
|
(eq popper-popup-status 'raised))
|
||||||
;; (popper-close-latest)))
|
(popper-close-latest)))
|
||||||
|
|
||||||
;; (setq vterm-exit-functions '(joe/close-popup-buffer))
|
(setq vterm-exit-functions '(joe/close-popup-buffer))
|
||||||
;; (setq vterm-exit-functions nil)
|
|
||||||
|
|
||||||
(defun joe/vterm-here ()
|
(defun joe/vterm-here ()
|
||||||
(interactive)
|
(interactive)
|
||||||
@ -2168,10 +2196,7 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
|
|||||||
#+end_src
|
#+end_src
|
||||||
*** LSP
|
*** LSP
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq lsp-keymap-prefix "C-c l")
|
|
||||||
(require 'lsp-mode)
|
(require 'lsp-mode)
|
||||||
(setq lsp-enable-completion-at-point nil)
|
|
||||||
(setq lsp-enable-indentation nil)
|
|
||||||
(setq lsp-enable-which-key-integration t)
|
(setq lsp-enable-which-key-integration t)
|
||||||
(setq lsp-headerline-breadcrumb-enable nil)
|
(setq lsp-headerline-breadcrumb-enable nil)
|
||||||
(setq lsp-modeline-diagnostics-enable nil)
|
(setq lsp-modeline-diagnostics-enable nil)
|
||||||
@ -2207,29 +2232,6 @@ These help speed eglot up apparently [[https://www.reddit.com/r/emacs/comments/1
|
|||||||
(evil-global-set-key 'normal (kbd "SPC lD") #'consult-lsp-diagnostics)
|
(evil-global-set-key 'normal (kbd "SPC lD") #'consult-lsp-diagnostics)
|
||||||
(evil-global-set-key 'normal (kbd "SPC lf") #'consult-lsp-file-symbols))
|
(evil-global-set-key 'normal (kbd "SPC lf") #'consult-lsp-file-symbols))
|
||||||
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Omnisharp is very slow to start, so I want to start it manually, but not if the
|
|
||||||
buffer already belongs to the current lsp workspace. This function checks if a
|
|
||||||
newly opened buffer belongs to an LSP session and if it does, start lsp
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun lsp-mode-server-exists-p+ (mode &optional all-workspaces)
|
|
||||||
(when (buffer-file-name) ; Needed for lsp--matching-clients?
|
|
||||||
(let ((major-mode mode))
|
|
||||||
(seq-intersection
|
|
||||||
(lsp--filter-clients (-andfn #'lsp--supports-buffer?
|
|
||||||
#'lsp--server-binary-present?))
|
|
||||||
(when-let ((workspaces
|
|
||||||
(if all-workspaces
|
|
||||||
(-flatten (hash-table-values (lsp-session-folder->servers (lsp-session))))
|
|
||||||
(gethash (lsp-workspace-root) (lsp-session-folder->servers (lsp-session))))))
|
|
||||||
(mapcar #'lsp--workspace-client workspaces))
|
|
||||||
#'equal))))
|
|
||||||
|
|
||||||
;; (setq treesit-load-name-override-list '((csharp "libtree-sitter-c-sharp.so")))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Flycheck
|
*** Flycheck
|
||||||
|
|
||||||
@ -2321,10 +2323,18 @@ newly opened buffer belongs to an LSP session and if it does, start lsp
|
|||||||
** AI
|
** AI
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq gptel-default-mode #'org-mode)
|
(setq gptel-default-mode #'org-mode)
|
||||||
(setq gptel-api-key (with-temp-buffer
|
(setq
|
||||||
|
gptel-model 'claude-sonnet-4-20250514
|
||||||
|
gptel-api-key (with-temp-buffer
|
||||||
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
|
(insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
|
||||||
(buffer-string)))
|
(buffer-string)))
|
||||||
(gptel-make-anthropic "Claude" :stream t :key (with-temp-buffer
|
;; (add-hook 'gptel-post-response-functions #'font-lock-ensure)
|
||||||
|
;; (gptel-make-openai "ChatGPT"
|
||||||
|
;; :stream t :key (with-temp-buffer
|
||||||
|
;; (insert-file-contents (expand-file-name "gptel-gpt-key" user-emacs-directory))
|
||||||
|
;; (buffer-string)))
|
||||||
|
(gptel-make-anthropic "Claude"
|
||||||
|
:stream t :key (with-temp-buffer
|
||||||
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
|
(insert-file-contents (expand-file-name "gptel-key" user-emacs-directory))
|
||||||
(buffer-string)))
|
(buffer-string)))
|
||||||
|
|
||||||
@ -2346,10 +2356,17 @@ newly opened buffer belongs to an LSP session and if it does, start lsp
|
|||||||
gptel-context-remove-all without confirmation
|
gptel-context-remove-all without confirmation
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(defun joe/gptel-context-remove-all ()
|
(defun joe/gptel-context-remove-all (&optional verbose)
|
||||||
"Remove all gptel context. No confirmation."
|
"Remove all gptel context. No confirmation."
|
||||||
(interactive)
|
(interactive (list t))
|
||||||
(gptel-context-remove-all nil))
|
(if (null gptel-context--alist)
|
||||||
|
(message "No gptel context sources to remove.")
|
||||||
|
(cl-loop
|
||||||
|
for (source . ovs) in gptel-context--alist
|
||||||
|
if (bufferp source) do ;Buffers and buffer regions
|
||||||
|
(mapc #'gptel-context-remove ovs)
|
||||||
|
else do (gptel-context-remove source) ;files or other types
|
||||||
|
finally do (setq gptel-context--alist nil))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
gptel-ask command so I can ask LLMs about whatever I have in my region. Might be
|
gptel-ask command so I can ask LLMs about whatever I have in my region. Might be
|
||||||
@ -2421,48 +2438,87 @@ This checks if it’s a ts mode then runs their counterparts.
|
|||||||
|
|
||||||
(add-hook 'prog-mode-hook 'run-non-ts-hooks)
|
(add-hook 'prog-mode-hook 'run-non-ts-hooks)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Clojure
|
*** CSharp
|
||||||
|
|
||||||
|
Omnisharp is very slow to start, so I want to start it manually, but not if the
|
||||||
|
buffer already belongs to the current lsp workspace. This function checks if a
|
||||||
|
newly opened buffer belongs to an LSP session and if it does, start lsp
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'clojure-mode)
|
(defun lsp-mode-server-exists-p+ (mode &optional all-workspaces)
|
||||||
(require 'cider)
|
(when (buffer-file-name) ; Needed for lsp--matching-clients?
|
||||||
(require 'flycheck-clj-kondo)
|
(let ((major-mode mode))
|
||||||
(setq cider-use-xref nil)
|
(seq-intersection
|
||||||
|
(lsp--filter-clients (-andfn #'lsp--supports-buffer?
|
||||||
|
#'lsp--server-binary-present?))
|
||||||
|
(when-let ((workspaces
|
||||||
|
(if all-workspaces
|
||||||
|
(-flatten (hash-table-values (lsp-session-folder->servers (lsp-session))))
|
||||||
|
(gethash (lsp-workspace-root) (lsp-session-folder->servers (lsp-session))))))
|
||||||
|
(mapcar #'lsp--workspace-client workspaces))
|
||||||
|
#'equal))))
|
||||||
|
|
||||||
(defvar joe/cider-last-reported-exception nil
|
;; (setq treesit-load-name-override-list '((csharp "libtree-sitter-c-sharp.so")))
|
||||||
"The last exception string reported by Cider.")
|
|
||||||
|
|
||||||
(defun joe/clojure-cider-throw-last-error ()
|
|
||||||
(interactive)
|
|
||||||
(let* ((error-str (nrepl-dict-get
|
|
||||||
(cider-nrepl-sync-request:eval "@error-reporting/last-exception")
|
|
||||||
"value"))
|
|
||||||
(error-buffer (get-buffer "*cider-error*"))
|
|
||||||
(same-error-p (and error-buffer
|
|
||||||
(string= joe/cider-last-reported-exception error-str))))
|
|
||||||
(unless same-error-p
|
|
||||||
(setq joe/cider-last-reported-exception error-str)
|
|
||||||
(cider-interactive-eval "(throw @error-reporting/last-exception)")))
|
|
||||||
|
|
||||||
(defun joe/cider-repl-preoutput-hook (output)
|
|
||||||
(if (string-match "EMACS-CIDER-REPORT-EXCEPTION" output)
|
|
||||||
(progn
|
|
||||||
(joe/clojure-cider-throw-last-error)
|
|
||||||
"")
|
|
||||||
output)))
|
|
||||||
|
|
||||||
(add-hook 'cider-repl-preoutput-hook #'joe/cider-repl-preoutput-hook)
|
|
||||||
|
|
||||||
(defun joe/clojure-mode-hook ()
|
|
||||||
(hs-minor-mode +1)
|
|
||||||
(when (lsp-mode-server-exists-p+ 'clojure-mode)
|
|
||||||
(lsp)))
|
|
||||||
|
|
||||||
(add-hook 'clojure-mode-hook #'joe/clojure-mode-hook)
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Elisp
|
|
||||||
|
And we do the rest here, including a macro
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(global-set-key (kbd "C-x C-r") 'eval-region)
|
(defun joe/csharp-mode-hook ()
|
||||||
(evil-define-key 'insert emacs-lisp-mode-map (kbd "C-j") 'eval-print-last-sexp)
|
(yas-minor-mode t)
|
||||||
|
(defalias 'joe/serialized-private-public-getter
|
||||||
|
(kmacro "^ W W Y o C-y <escape> ^ i p u b l i c SPC <escape> l W y i w P a SPC = > SPC <escape> B B ~"))
|
||||||
|
(evil-set-register ?g (lambda nil "Unity/C#"
|
||||||
|
(call-interactively 'joe/serialized-private-public-getter)))
|
||||||
|
;; (schmo/reapply-csharp-ts-mode-font-lock-settings)
|
||||||
|
|
||||||
|
(electric-pair-local-mode t)
|
||||||
|
(when (lsp-mode-server-exists-p+ 'csharp-mode)
|
||||||
|
(lsp)))
|
||||||
|
(add-hook 'csharp-mode-hook #'joe/csharp-mode-hook)
|
||||||
|
#+end_src
|
||||||
|
*** Common Lisp
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(setq inferior-lisp-program "/usr/local/bin/sbcl")
|
||||||
|
(setq sly-lisp-implementations '((sbcl ("/usr/local/bin/sbcl"
|
||||||
|
"--dynamic-space-size" "4096"
|
||||||
|
"--core" "/home/joe/.config/emacs/sbcl.core-for-sly"))
|
||||||
|
(ecl ("/usr/bin/ecl"))))
|
||||||
|
(setq sly-symbol-completion-mode nil)
|
||||||
|
|
||||||
|
(defun joe/sly-copy-call-to-repl ()
|
||||||
|
"Copy name/symbol of toplevel sexp to sly-mREPL and select sly-mREPL."
|
||||||
|
(interactive)
|
||||||
|
(let (string
|
||||||
|
replwin)
|
||||||
|
(save-excursion
|
||||||
|
(beginning-of-defun)
|
||||||
|
(forward-thing 'symbol 2)
|
||||||
|
(setq string (format "(%s )" (thing-at-point 'symbol 'no-props))))
|
||||||
|
(setq replwin (get-buffer-window (call-interactively #'sly-mrepl)))
|
||||||
|
(with-selected-window replwin
|
||||||
|
(insert string)
|
||||||
|
(forward-char -1))))
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
*** Odin
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(with-eval-after-load 'lsp-mode
|
||||||
|
(setq-default lsp-auto-guess-root t) ;; Helps find the ols.json file with Projectile or project.el
|
||||||
|
(setq lsp-language-id-configuration (cons '(odin-mode . "odin") lsp-language-id-configuration))
|
||||||
|
|
||||||
|
(lsp-register-client
|
||||||
|
(make-lsp-client :new-connection (lsp-stdio-connection "~/.local/bin/ols") ;; Adjust the path here
|
||||||
|
:major-modes '(odin-mode)
|
||||||
|
:server-id 'ols
|
||||||
|
:multi-root t))) ;; Ensures lsp-mode sends "workspaceFolders" to the server
|
||||||
|
|
||||||
|
;; (add-hook 'odin-mode-hook #'lsp)
|
||||||
|
|
||||||
|
(defun joe/odin-mode-hook ()
|
||||||
|
(electric-pair-local-mode))
|
||||||
|
(add-hook 'odin-mode-hook #'joe/odin-mode-hook)
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** C
|
*** C
|
||||||
|
|
||||||
@ -2547,29 +2603,56 @@ it doesn't close it.
|
|||||||
;; (setq lsp-rust-analyzer-display-reborrow-hints t)
|
;; (setq lsp-rust-analyzer-display-reborrow-hints t)
|
||||||
;; (setq lsp-rust-analyzer-cargo-watch-command "clippy"))
|
;; (setq lsp-rust-analyzer-cargo-watch-command "clippy"))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Common Lisp
|
*** OCaml
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq inferior-lisp-program "/usr/local/bin/sbcl")
|
(require 'tuareg)
|
||||||
(setq sly-lisp-implementations '((sbcl ("/usr/local/bin/sbcl"
|
(require 'dune)
|
||||||
"--dynamic-space-size" "4096"
|
(require 'utop)
|
||||||
"--core" "/home/joe/.config/emacs/sbcl.core-for-sly"))
|
;; (require 'merlin)
|
||||||
(ecl ("/usr/bin/ecl"))))
|
;; (require 'merlin-eldoc)
|
||||||
(setq sly-symbol-completion-mode nil)
|
;; Might be worth checking out, depeding on whether we stick with flycheck or not
|
||||||
|
;; (elpaca 'flycheck-ocaml)
|
||||||
|
;; Also check this out, see if it adds anything
|
||||||
|
;; (require 'ocp-indent)
|
||||||
|
|
||||||
(defun joe/sly-copy-call-to-repl ()
|
(defun opam-env ()
|
||||||
"Copy name/symbol of toplevel sexp to sly-mREPL and select sly-mREPL."
|
"Load the opam env to get the PATH variables so everything works"
|
||||||
(interactive)
|
(interactive nil)
|
||||||
(let (string
|
(dolist (var
|
||||||
replwin)
|
(car (read-from-string
|
||||||
(save-excursion
|
(shell-command-to-string "opam config env --sexp"))))
|
||||||
(beginning-of-defun)
|
(setenv (car var) (cadr var))))
|
||||||
(forward-thing 'symbol 2)
|
(setq opam-share
|
||||||
(setq string (format "(%s )" (thing-at-point 'symbol 'no-props))))
|
(substring (shell-command-to-string
|
||||||
(setq replwin (get-buffer-window (call-interactively #'sly-mrepl)))
|
"opam config var share 2> /dev/null") 0 -1))
|
||||||
(with-selected-window replwin
|
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||||
(insert string)
|
(add-to-list 'exec-path "/home/joe/.opam/default/bin/")
|
||||||
(forward-char -1))))
|
#+end_src
|
||||||
|
|
||||||
|
We won't use the LSP server but rather directly talk to Merlin, since I guess LSP just wraps Merlin
|
||||||
|
and there's no need for a middle-man when it's already been implemented.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
|
;; (require 'utop)
|
||||||
|
;; Use the opam installed utop
|
||||||
|
(setq utop-command "opam exec -- utop -emacs")
|
||||||
|
|
||||||
|
(let ((opam-share (ignore-errors (car (process-lines "opam" "var" "share")))))
|
||||||
|
(when (and opam-share (file-directory-p opam-share))
|
||||||
|
;; Register Merlin
|
||||||
|
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||||
|
(autoload 'merlin-mode "merlin" nil t nil)
|
||||||
|
;; Automatically start it in OCaml buffers
|
||||||
|
(add-hook 'tuareg-mode-hook 'merlin-mode t)
|
||||||
|
(add-hook 'caml-mode-hook 'merlin-mode t)
|
||||||
|
;; Use opam switch to lookup ocamlmerlin binary
|
||||||
|
(setq merlin-command 'opam)))
|
||||||
|
#+end_src
|
||||||
|
*** Elisp
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(global-set-key (kbd "C-x C-r") 'eval-region)
|
||||||
|
(evil-define-key 'insert emacs-lisp-mode-map (kbd "C-j") 'eval-print-last-sexp)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Web
|
*** Web
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@ -2645,89 +2728,6 @@ it doesn't close it.
|
|||||||
|
|
||||||
(add-hook 'sql-login-hook 'joe/sql-login-hook)
|
(add-hook 'sql-login-hook 'joe/sql-login-hook)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Odin
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(with-eval-after-load 'lsp-mode
|
|
||||||
(setq-default lsp-auto-guess-root t) ;; Helps find the ols.json file with Projectile or project.el
|
|
||||||
(setq lsp-language-id-configuration (cons '(odin-mode . "odin") lsp-language-id-configuration))
|
|
||||||
|
|
||||||
(lsp-register-client
|
|
||||||
(make-lsp-client :new-connection (lsp-stdio-connection "~/.local/bin/ols") ;; Adjust the path here
|
|
||||||
:major-modes '(odin-mode)
|
|
||||||
:server-id 'ols
|
|
||||||
:multi-root t))) ;; Ensures lsp-mode sends "workspaceFolders" to the server
|
|
||||||
|
|
||||||
;; (add-hook 'odin-mode-hook #'lsp)
|
|
||||||
|
|
||||||
(defun joe/odin-mode-hook ()
|
|
||||||
(electric-pair-local-mode))
|
|
||||||
(add-hook 'odin-mode-hook #'joe/odin-mode-hook)
|
|
||||||
|
|
||||||
#+end_src
|
|
||||||
*** CSharp
|
|
||||||
|
|
||||||
And we do the rest here, including a macro
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun joe/csharp-mode-hook ()
|
|
||||||
(yas-minor-mode t)
|
|
||||||
(defalias 'joe/serialized-private-public-getter
|
|
||||||
(kmacro "^ W W Y o C-y <escape> ^ i p u b l i c SPC <escape> l W y i w P a SPC = > SPC <escape> B B ~"))
|
|
||||||
(evil-set-register ?g (lambda nil "Unity/C#"
|
|
||||||
(call-interactively 'joe/serialized-private-public-getter)))
|
|
||||||
;; (schmo/reapply-csharp-ts-mode-font-lock-settings)
|
|
||||||
|
|
||||||
(electric-pair-local-mode t)
|
|
||||||
(when (lsp-mode-server-exists-p+ 'csharp-mode)
|
|
||||||
(lsp)))
|
|
||||||
(add-hook 'csharp-mode-hook #'joe/csharp-mode-hook)
|
|
||||||
#+end_src
|
|
||||||
*** COMMENT OCaml
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(require 'tuareg)
|
|
||||||
(require 'dune)
|
|
||||||
(require 'utop)
|
|
||||||
;; (require 'merlin)
|
|
||||||
;; (require 'merlin-eldoc)
|
|
||||||
;; Might be worth checking out, depeding on whether we stick with flycheck or not
|
|
||||||
;; (elpaca 'flycheck-ocaml)
|
|
||||||
;; Also check this out, see if it adds anything
|
|
||||||
;; (require 'ocp-indent)
|
|
||||||
|
|
||||||
(defun opam-env ()
|
|
||||||
"Load the opam env to get the PATH variables so everything works"
|
|
||||||
(interactive nil)
|
|
||||||
(dolist (var
|
|
||||||
(car (read-from-string
|
|
||||||
(shell-command-to-string "opam config env --sexp"))))
|
|
||||||
(setenv (car var) (cadr var))))
|
|
||||||
(setq opam-share
|
|
||||||
(substring (shell-command-to-string
|
|
||||||
"opam config var share 2> /dev/null") 0 -1))
|
|
||||||
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
|
||||||
(add-to-list 'exec-path "/home/joe/.opam/default/bin/")
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
We won't use the LSP server but rather directly talk to Merlin, since I guess LSP just wraps Merlin
|
|
||||||
and there's no need for a middle-man when it's already been implemented.
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
|
|
||||||
;; (require 'utop)
|
|
||||||
;; Use the opam installed utop
|
|
||||||
(setq utop-command "opam exec -- utop -emacs")
|
|
||||||
|
|
||||||
(let ((opam-share (ignore-errors (car (process-lines "opam" "var" "share")))))
|
|
||||||
(when (and opam-share (file-directory-p opam-share))
|
|
||||||
;; Register Merlin
|
|
||||||
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
|
||||||
(autoload 'merlin-mode "merlin" nil t nil)
|
|
||||||
;; Automatically start it in OCaml buffers
|
|
||||||
(add-hook 'tuareg-mode-hook 'merlin-mode t)
|
|
||||||
(add-hook 'caml-mode-hook 'merlin-mode t)
|
|
||||||
;; Use opam switch to lookup ocamlmerlin binary
|
|
||||||
(setq merlin-command 'opam)))
|
|
||||||
#+end_src
|
|
||||||
*** COMMENT Haskell
|
*** COMMENT Haskell
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(require 'haskell-mode)
|
(require 'haskell-mode)
|
||||||
@ -2736,6 +2736,12 @@ and there's no need for a middle-man when it's already been implemented.
|
|||||||
(evil-define-key 'insert haskell-interactive-mode-map (kbd "C-n") #'haskell-interactive-mode-history-next)
|
(evil-define-key 'insert haskell-interactive-mode-map (kbd "C-n") #'haskell-interactive-mode-history-next)
|
||||||
(evil-define-key 'insert haskell-interactive-mode-map (kbd "C-p") #'haskell-interactive-mode-history-previous)
|
(evil-define-key 'insert haskell-interactive-mode-map (kbd "C-p") #'haskell-interactive-mode-history-previous)
|
||||||
|
|
||||||
|
#+end_src
|
||||||
|
*** Clojure
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(require 'clojure-mode)
|
||||||
|
(require 'cider)
|
||||||
|
;; (setq cider-show-error-buffer 'only-in-repl)
|
||||||
#+end_src
|
#+end_src
|
||||||
*** COMMENT FSharp
|
*** COMMENT FSharp
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@ -2810,7 +2816,7 @@ and there's no need for a middle-man when it's already been implemented.
|
|||||||
(define-key global-map (kbd "<f5>") #'joe/dape-toggle-breakpoint-and-rerun)
|
(define-key global-map (kbd "<f5>") #'joe/dape-toggle-breakpoint-and-rerun)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Apparently this helps with the performance of dape, as well as LSP
|
Apparently this helps with the performance of dape
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq read-process-output-max (* 1024 1024)) ;; 1mb
|
(setq read-process-output-max (* 1024 1024)) ;; 1mb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user