improve lisp experience

- define bigger window heights and organize placement of repl and
magit windows
- add run-tests method to aoc template
- map copilot-expand to C-S-y
This commit is contained in:
Peter Tillemans 2024-12-18 11:42:53 +01:00
parent 8adf66a7fe
commit aee411ac47
2 changed files with 54 additions and 36 deletions

View file

@ -810,7 +810,6 @@ See the excellent documentation on [[https://github.com/minad/consult][Minad's c
#+RESULTS: #+RESULTS:
: [nil 26284 54919 318035 nil elpaca-process-queues nil nil 339000 nil] : [nil 26284 54919 318035 nil elpaca-process-queues nil nil 339000 nil]
** User Interface ** User Interface
*** Display startup time *** Display startup time
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -970,8 +969,20 @@ There is a keybinding on *<F5>* to toggle between light and dark mode.
;; Parameters ;; Parameters
(window-height . 10)) (window-height . 10))
display-buffer-alist) display-buffer-alist)
(push '("magit:.*"
;; set custom info folder ;; display-buffer functions, first one that succeeds is used
(display-buffer-reuse-mode-window
display-buffer-below-selected)
;; Parameters
(window-height . 10))
display-buffer-alist)
(push '("\\*sly-mrepl for .*\\*"
;; display-buffer functions, first one that succeeds is used
(display-buffer-reuse-mode-window
display-buffer-below-selected)
;; Parameters
(window-height . 10))
display-buffer-alist)
(add-to-list 'Info-default-directory-list "~/.local/share/info/") (add-to-list 'Info-default-directory-list "~/.local/share/info/")
#+END_SRC #+END_SRC
@ -1152,7 +1163,6 @@ This enables direnv globally.
#+RESULTS: #+RESULTS:
: [nil 26432 30485 62583 nil elpaca-process-queues nil nil 114000 nil] : [nil 26432 30485 62583 nil elpaca-process-queues nil nil 114000 nil]
** Enable breadcrumbs ** Enable breadcrumbs
Show breadcrumbs in the header line to keep context of the file being Show breadcrumbs in the header line to keep context of the file being
@ -1949,24 +1959,26 @@ Map the keymap consistently to the eglot mappings.
#+END_SRC #+END_SRC
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package copilot (use-package copilot
:ensure (:host github :repo "zerolfx/copilot.el" :ensure (:host github :repo "zerolfx/copilot.el"
:branch "main" :branch "main"
:files ("dist" "*.el")) :files ("dist" "*.el"))
:bind :bind
(:map evil-insert-state-map (:map evil-insert-state-map
("C-y" . copilot-accept-completion)) ("C-S-y" . copilot-accept-completion))
:config :config
(add-to-list 'copilot-indentation-alist '(scheme-mode . 2)) (add-to-list 'copilot-indentation-alist '(scheme-mode . 2))
(add-to-list 'copilot-indentation-alist '(emacs-lisp-mode . 2)) (add-to-list 'copilot-indentation-alist '(emacs-lisp-mode . 2))
(add-to-list 'copilot-indentation-alist '(lisp-mode . 2)) (add-to-list 'copilot-indentation-alist '(lisp-mode . 2))
:hook (set-option 'copilot-indent-offset-warning-disabled t)
(prog-mode . copilot-mode)
(org-mode . copilot-mode)) :hook
(prog-mode . copilot-mode)
(org-mode . copilot-mode))
#+END_SRC #+END_SRC
#+RESULTS: #+RESULTS:
: [nil 26280 62042 380168 nil elpaca-process-queues nil nil 930000 nil] : [nil 26466 40154 497697 nil elpaca-process-queues nil nil 528000 nil]
*** TODO move scheme configuration to the scheme section *** TODO move scheme configuration to the scheme section
or leave it here but move it to config, whatever makes most sense at or leave it here but move it to config, whatever makes most sense at
@ -2007,7 +2019,6 @@ templates to be generated. By default it uses
#+RESULTS: #+RESULTS:
: [nil 26455 5250 886750 nil elpaca-process-queues nil nil 641000 nil] : [nil 26455 5250 886750 nil elpaca-process-queues nil nil 641000 nil]
* Writing and Planning * Writing and Planning
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@ -2180,24 +2191,26 @@ interactive to manually install the latest version if needed.
**** Configure Babel Languages **** Configure Babel Languages
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;; configure babel languages ;; configure babel languages
(use-package org-babel (use-package org-babel
:no-require :no-require
:after '(ob-verb ob-mermaid) :after '(ob-verb ob-mermaid)
:config :config
(org-babel-do-load-languages (org-babel-do-load-languages
'org-babel-load-languages 'org-babel-load-languages
'((emacs-lisp . t) '((emacs-lisp . t)
(shell . t) (shell . t)
(python . t) (python . t)
(latex . t) (latex . t)
(verb . t) (verb . t)
(scheme . t) (scheme . t)
(plantuml . t) (plantuml . t)
(mermaid . t) (mermaid . t)
(dot . t)))) (dot . t))))
#+END_SRC #+END_SRC
#+RESULTS:
**** Temporary Patches for Org Babel **** Temporary Patches for Org Babel
***** Fix Scheme Babel Bug ***** Fix Scheme Babel Bug

View file

@ -106,5 +106,10 @@ written in lower case. The code looks for these case sensitively.
(define-test+run test-part2 (define-test+run test-part2
:parent suite-2024-{{day}} :parent suite-2024-{{day}}
(is equal nil (part2 sample-data))) (is equal nil (part2 sample-data)))
(defun run-tests ()
(run-test-suite 'suite-2024-{{day}}))
#+end_src #+end_src