aboutsummaryrefslogtreecommitdiff
path: root/doom/.config/doom/config.org
diff options
context:
space:
mode:
Diffstat (limited to 'doom/.config/doom/config.org')
-rw-r--r--doom/.config/doom/config.org105
1 files changed, 87 insertions, 18 deletions
diff --git a/doom/.config/doom/config.org b/doom/.config/doom/config.org
index e373e3a..daf16a9 100644
--- a/doom/.config/doom/config.org
+++ b/doom/.config/doom/config.org
@@ -1,7 +1,8 @@
#+TITLE: Doom Emacs configuration
#+PROPERTY: header-args:emacs-lisp :tangle config.el
* Foreword
-Hello! This is my literate configuration for Doom Emacs.
+
+"Hello! This is my literate configuration for Doom Emacs."
Why literate? because org is cool!
I use Doom Emacs because it's easy, simple & easy to configure.
This config will be ported into normal Emacs in the future, but im not planning that for now.
@@ -44,9 +45,9 @@ By default, Emacs prompts 2 times when loading a theme, this is annoying so im g
#+end_src
** Font
I use the completely not pirated ~Berkeley Mono~ font. I really like it.
-Sometimes i will use the Commit mono font (sometimes!)
+Sometimes i will use the Commit mono or Cozette! (sometimes!)
#+begin_src emacs-lisp
- (setq doom-font (font-spec :family "Berkeley Mono" :size 12.0))
+ (setq doom-font (font-spec :family "Berkeley Mono" :size 13.0))
#+end_src
Line numbers! And not relative!
@@ -141,21 +142,34 @@ eglot-ensure makes sure that eglot is enabled and working when opening a prog-mo
(prog-mode . eglot-ensure))
#+end_src
-I copied this block from somewhere and have no idea what it does.
+Then we can set up ~eglot-booster~, which adds ~emacs-lsp-booster~ integration into eglot.
+emacs-lsp-booster, well, boosts lsp (with rust!)
#+begin_src emacs-lisp
- (after! eglot
- (cl-defmethod eglot-register-capability
- (server (method (eql workspace/didChangeWatchedFiles)) id &key watchers)
- nil)
+(use-package! eglot-booster
+ :after eglot
+ :config (eglot-booster-mode))
#+end_src
+I copied this block from somewhere and have no idea what it does.
+#+begin_src emacs-lisp
+ (after! eglot
+ (cl-defmethod eglot-register-capability
+ ((_server eglot-lsp-server)
+ (method (eql workspace/didChangeWatchedFiles))
+ _id
+ &key _watchers)
+ nil)
+
+
+#+end_src
Here we add a custom LSP for typescript and javascript mode.
Oxlint is a rewrite of ESLint in Rust, Not sure why oxlsp isnt its own tool, but oh well.
#+begin_src emacs-lisp
- (add-to-list 'eglot-server-programs
- '((typescript-ts-mode javascript-mode)
- . ("oxlint" "--lsp"))))
+(add-to-list 'eglot-server-programs
+ '((typescript-ts-mode javascript-mode)
+ . ("emacs-lsp-booster" "--" "oxlint" "--lsp"))))
+
#+end_src
~eglot-sync-connect~ makes it so that eglot has to catch up and connect before a buffer can be worked on, thats why i set it to nil.
@@ -224,12 +238,8 @@ We can then add a new apheleia formatter, in this case oxfmt.
#+end_src
Here we hook the new oxfmt formatter into:
-+ html-mode
-+ mhtml-mode
-+ web-mode
-+ css-mode
#+begin_src emacs-lisp
- (dolist (mode '(html-mode mhtml-mode web-mode css-mode))
+(dolist (mode '(html-mode mhtml-mode web-mode css-mode))
(setf (alist-get mode apheleia-mode-alist) 'oxfmt)))
#+end_src
@@ -527,6 +537,47 @@ This currently doesnt work.
* Git
~LEAVE Emacs? You gotta be kidding.~
+** TODO vc :: maps
+Mappings for vc.
+By default, vc bindings are under ~C-x v~, but thats annoying, i'll be binding it under ~SPC v~
+I tried my best to match these to the default bindings under ~C-x v~
+
+#+begin_src emacs-lisp
+ (map!
+ :leader
+ :prefix "v"
+ :desc "vc-edit-next-command" "!" #'vc-edit-next-command
+ :desc "diff-hl-show-hunk" "*" #'diff-hl-show-hunk
+ :desc "vc-update" "+" #'vc-update
+ :desc "diff-hl-goto-hunk" "=" #'diff-hl-diff-goto-hunk
+ :desc "vc-revert" "@" #'vc-revert
+ :desc "vc-update-change-log" "a" #'vc-update-change-log
+ ;; ADD b BINDINGS (branch)
+ :desc "vc-dir" "d" #'vc-dir
+ :desc "vc-root-diff" "D" #'vc-root-diff
+ ;; ADD E BINDINGS
+ :desc "annotate" "g" #'vc-annotate
+ :desc "ignore" "G" #'vc-ignore
+ :desc "region history" "h" #'vc-region-history
+ :desc "register" "i" #'vc-register
+ :desc "root log incoming" "I" #'vc-root-log-incoming
+ :desc "print log" "l" #'vc-print-log
+ :desc "print root log" "L" #'vc-print-root-log
+ :desc "merge" "m" #'vc-merge
+ ;; ADD M BINDINGS
+ :desc "diff revert hunk" "n" #'diff-hl-revert-hunk
+ :desc "root log outgoing" "O" #'vc-root-log-outgoing
+ :desc "push" "p" #'vc-push ; originally P
+ :desc "retrieve tag" "r" #'vc-retrieve-tag
+ :desc "rename file" "R" #'vc-rename-file
+ :desc "create tag" "s" #'vc-create-tag
+ :desc "stage dwim (diff hl)" "S" #'diff-hl-stage-dwim
+ ;; ADD T BINDINGS
+ :desc "vc revert" "u" #'vc-revert ; carried over from the original bindings (repeated by @)
+ :desc "vc next action" "v" #'vc-next-action ; run the next logical action
+ ;; ADD w BINDINGS
+ :desc "revision other window" "~" #'vc-revision-other-window)
+#+end_src
** Majutsu
I use the JuJutsu version control system.
I am an old user of ~magit~. Why not use magit for JJ?
@@ -543,6 +594,19 @@ Open the main majutsu buffer.
:desc "Push" "p" #'majutsu-git-push) ; push to git
#+end_src
+** vc-jj
+~vc-jj~ adds jujutsu integration to Emacs's ~vc~!
+#+begin_src emacs-lisp :tangle no
+ ;; required in packages.el
+ ;; (package! vc-jj)
+#+END_SRC
+
+Then, we actually enable it.
+#+begin_src emacs-lisp
+ (use-package! vc-jj)
+#+end_src
+~vc-jj~ configures itself into vc by itself, no further configuration is needed
+
* Org
~Protesting for Org README support.~
Org is Emacs's version of markdown, and is what this file is written in.
@@ -594,6 +658,11 @@ After that, we still need to add Eglot integration.
#+begin_src emacs-lisp
(add-hook 'org-src-mode-hook #'eglot-ensure)
#+end_src
+
+There's a bug that hits org-lint & poly-org & flycheck about org element's cache, so lets just disable it.
+#+begin_src emacs-lisp
+ (setq org-element-use-cache nil)
+#+end_src
** Org UX
This makes org capturing much better.
When capturing a new org note, all windows are deleted, and the capture window is made a dedicated window.
@@ -933,7 +1002,7 @@ These are only bindings as dired is pre-installed on Emacs.
#+begin_src emacs-lisp
(map!
:leader
- :prefix "d"
+ :prefix ("d" . "dired")
:desc "Dired" "d" #'dired
:desc "Dired here" "h" #'dired-jump)
#+end_src
@@ -1048,7 +1117,7 @@ Make ~o~ go right in org mode (previously ~inserted on newline~)
"u" 'evil-forward-word-end
"U" 'evil-forward-WORD-end
"y" 'evil-forward-word-begin
- "Y" 'evil-forward-word-begin)
+ "Y" 'evil-forward-WORD-begin)
(with-eval-after-load 'evil-ex
(define-key evil-ex-completion-map (kbd "C-l") 'left-word)