diff --git a/.config/emacs/init.org b/.config/emacs/init.org index 16b4846..23f17c4 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/init.org @@ -499,6 +499,22 @@ Emacs is an great operating system, if only it had a good text editor... #+end_src +Stole this from [[https://github.com/purcell/unfill/][Purcell]] but didn't feel like making it a package depencendy + +#+begin_src emacs-lisp +(defun unfill-toggle () + "Toggle filling/unfilling of the current region. +Operates on the current paragraph if no region is active." + (interactive) + (let (deactivate-mark + (fill-column + (if (eq last-command this-command) + (progn (setq this-command nil) + most-positive-fixnum) + fill-column))) + (call-interactively 'fill-paragraph))) +#+end_src + For the longest time I had no idea why the ~(~ and ~)~ vim motions for sentences weren't working, until I randomly saw this in someone's init.el @@ -1224,8 +1240,8 @@ Ace Window will show a hint if there are more than 2 windows, but I don't really (with-eval-after-load 'project (setq project-vc-ignores '("target/" "bin/" "obj/")) (add-to-list 'project-switch-commands '(magit-project-status "Magit" ?m)) + (add-to-list 'project-switch-commands '(joe/vterm-here "VTerm" ?s)) (add-to-list 'project-vc-extra-root-markers ".dir-locals.el") - (setq frame-title-format "%b") (defun joe/project-root-override (dir) (let ((proj-name (project-try-vc dir))) @@ -1779,7 +1795,10 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i #+begin_src emacs-lisp (with-eval-after-load 'eglot (global-eldoc-mode -1) - (flymake-mode -1) + ;; (flymake-mode -1) + ;; Disable it completely until we find out how the hell we can toggle it + (setq eglot-stay-out-of '(flymake)) + ;; (add-hook 'eglot-managed-mode-hook (lambda () (flymake-mode -1))) (when (boundp 'evil-mode) ;; (evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point) (evil-global-set-key 'normal (kbd "SPC li") 'eglot-inlay-hints-mode) @@ -1892,36 +1911,7 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i (popper-close-latest)))))) (add-hook 'compilation-finish-functions 'joe/close-compilation-if-no-warn-err) #+end_src -** Debugging -*** COMMENT DAP -#+begin_src emacs-lisp -(require 'dap-mode) -;; (setq dap-auto-configure-features '(locals breakpoints expressions tooltip)) - -(require 'dap-cpptools) -(dap-cpptools-setup) -(add-hook 'dap-stopped-hook - (lambda (arg) (call-interactively #'dap-hydra))) - -(setq dap-cpptools-extension-version "1.12.1") - -(setq dap-default-terminal-kind "integrated") -(dap-auto-configure-mode +1) -(dap-register-debug-template - "Rust::CppTools Run Configuration" - (list :type "cppdbg" - :request "launch" - :name "Rust::Run" - :MIMode "gdb" - :miDebuggerPath "rust-gdb" - :environment [] - :program "${workspaceFolder}/target/debug/kanban-tui" - :cwd "${workspaceFolder}" - :console "external" - :dap-compilation "cargo build" - :dap-compilation-dir "${workspaceFolder}")) -#+end_src -** Languages +** Programming Languages *** Python #+begin_src emacs-lisp (require 'elpy) @@ -1943,11 +1933,9 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i ;; :host github ;; :repo "serialdev/evcxr-mode")) -(add-hook 'rust-mode-hook (lambda () (electric-pair-local-mode))) - (add-hook 'rust-mode-hook (lambda () - (evcxr-minor-mode) + ;; (evcxr-minor-mode) (electric-pair-local-mode))) (with-eval-after-load 'rustic @@ -2137,6 +2125,35 @@ and there's no need for a middle-man when it's already been implemented. (require 'json-mode) (require 'markdown-mode) #+end_src +** Debugging +*** COMMENT DAP +#+begin_src emacs-lisp +(require 'dap-mode) +;; (setq dap-auto-configure-features '(locals breakpoints expressions tooltip)) + +(require 'dap-cpptools) +(dap-cpptools-setup) +(add-hook 'dap-stopped-hook + (lambda (arg) (call-interactively #'dap-hydra))) + +(setq dap-cpptools-extension-version "1.12.1") + +(setq dap-default-terminal-kind "integrated") +(dap-auto-configure-mode +1) +(dap-register-debug-template + "Rust::CppTools Run Configuration" + (list :type "cppdbg" + :request "launch" + :name "Rust::Run" + :MIMode "gdb" + :miDebuggerPath "rust-gdb" + :environment [] + :program "${workspaceFolder}/target/debug/kanban-tui" + :cwd "${workspaceFolder}" + :console "external" + :dap-compilation "cargo build" + :dap-compilation-dir "${workspaceFolder}")) +#+end_src ** Org Mode #+begin_src emacs-lisp @@ -2185,7 +2202,8 @@ and there's no need for a middle-man when it's already been implemented. #+end_src ** Magit -The best git porcelain/client I've ever used. Also kill stray magit buffers left over as explained [[https://manueluberti.eu/2018/02/17/magit-bury-buffer.html][here]] +The best git porcelain/client I've ever used. Also kill stray magit buffers left +over as explained [[https://manueluberti.eu/2018/02/17/magit-bury-buffer.html][here]] #+begin_src emacs-lisp (require 'magit) @@ -2218,7 +2236,6 @@ The best git porcelain/client I've ever used. Also kill stray magit buffers left (define-key restclient-mode-map (kbd "C-c C-v") #'restclient-http-send-current)) #+end_src - ** Initial Buffer #+begin_src emacs-lisp