Compare commits

..

2 Commits

View File

@ -444,8 +444,7 @@ Setup other stuff
(dolist (mode '( dashboard-mode-hook org-mode-hook term-mode-hook eww-mode-hook eat-mode-hook
vterm-mode-hook dirvish-directory-view-mode-hook eshell-mode-hook
dired-mode-hook shell-mode-hook magit-mode-hook compilation-mode-hook
mu4e-headers-mode-hook mu4e-main-mode-hook))
dired-mode-hook org-agenda-mode-hook shell-mode-hook magit-mode-hook compilation-mode-hook mu4e-headers-mode-hook mu4e-main-mode-hook))
(add-hook mode #'joe/disable-line-numbers))
(set-window-margins nil 0)
@ -2382,6 +2381,23 @@ file."
#+end_src
** Programming Languages
*** C
Design some basic functions for compiling. There's also a hook to close the popper window if there
are no warnings or errors. It will check if we are still in the compilation buffer as well as
whether the point hasn't been moved. This way, if I switched to another popper buffer, like vterm,
it doesn't close it.
#+begin_src emacs-lisp
(require 'disaster)
(setq c-default-style "bsd")
(defun joe/c-mode-hook ()
(local-set-key (kbd "C-x c r") (defun joe/make-run () (interactive) (compile "make run")))
(local-set-key (kbd "C-x c c") (defun joe/make () (interactive) (compile "make")))
(electric-pair-local-mode t)
(c-toggle-comment-style -1))
(add-hook 'c-mode-hook #'joe/c-mode-hook)
#+end_src
*** Python
#+begin_src emacs-lisp
(require 'python)
@ -2425,6 +2441,51 @@ file."
;; (setq lsp-rust-analyzer-display-reborrow-hints t)
;; (setq lsp-rust-analyzer-cargo-watch-command "clippy"))
#+end_src
*** 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))
#+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)
@ -2504,24 +2565,7 @@ file."
(add-hook 'sql-login-hook 'joe/sql-login-hook)
#+end_src
*** C
Design some basic functions for compiling. There's also a hook to close the popper window if there
are no warnings or errors. It will check if we are still in the compilation buffer as well as
whether the point hasn't been moved. This way, if I switched to another popper buffer, like vterm,
it doesn't close it.
#+begin_src emacs-lisp
(require 'disaster)
(setq c-default-style "bsd")
(defun joe/c-mode-hook ()
(local-set-key (kbd "C-x c r") (defun joe/make-run () (interactive) (compile "make run")))
(local-set-key (kbd "C-x c c") (defun joe/make () (interactive) (compile "make")))
(electric-pair-local-mode t)
(c-toggle-comment-style -1))
(add-hook 'c-mode-hook #'joe/c-mode-hook)
#+end_src
*** Haskell
*** COMMENT Haskell
#+begin_src emacs-lisp
(require 'haskell-mode)
(setq haskell-interactive-popup-errors nil)
@ -2536,51 +2580,6 @@ it doesn't close it.
(require 'cider)
(setq cider-show-error-buffer 'only-in-repl)
#+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))
#+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 FSharp
#+begin_src emacs-lisp
(require 'fsharp-mode)
@ -2744,7 +2743,7 @@ Org mode buffers have associated files.
#+end_src
*** org-agenda
#+begin_src emacs-lisp
(setq org-agenda-files '("~/Notes/"))
(setq org-agenda-files '("~/Notes/Schedule.org" "~/Notes/Daily.org"))
(setq org-agenda-time-grid '((daily today require-timed)
(700 900 1200 1700 1900 20:30 23:00)
" ═════ "
@ -2923,7 +2922,7 @@ over as explained [[https://manueluberti.eu/2018/02/17/magit-bury-buffer.html][h
#+begin_src emacs-lisp
(require 'magit)
(setq magit-status-margin '(nil age magit-log-margin-width t 18))
(defun joe/magit-kill-buffers (param)
"Restore window configuration and kill all Magit buffers."
(let ((buffers (magit-mode-get-buffers)))