summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doom/.config/doom/config.el39
-rw-r--r--doom/.config/doom/config.org66
-rw-r--r--fish/.config/fish/fish_variables2
-rw-r--r--jj/.config/jj/repos/9e33453f54e7089b84ce/config.toml2
4 files changed, 73 insertions, 36 deletions
diff --git a/doom/.config/doom/config.el b/doom/.config/doom/config.el
index cad7dd4..d80b253 100644
--- a/doom/.config/doom/config.el
+++ b/doom/.config/doom/config.el
@@ -301,16 +301,39 @@ emms-cache-file (concat doom-cache-dir "emms-cache"))
;; ADD w BINDINGS
:desc "revision other window" "~" #'vc-revision-other-window)
-(map!
- :leader
- :prefix "g m"
- :desc "Status" "m" #'majutsu ; default majutsu buffer
- :desc "Describe" "d" #'majutsu-describe ; equivalent of 'jj describe'
- :desc "New" "n" #'majutsu-new ; new jj rev
- :desc "Push" "p" #'majutsu-git-push) ; push to git
-
(use-package! vc-jj)
+(after! vc-jj
+ (defvar my/vc-jj-advance-to nil)
+
+ (defun my/vc-jj-bookmark-advance (&optional names)
+ "Advance the closest bookmarks (or just NAMES) forward."
+ (interactive
+ (when current-prefix-arg
+ (list (completing-read-multiple
+ "Advance bookmarks: "
+ (vc-jj--process-lines
+ nil "bookmark" "list"
+ "-T" "if(!self.remote(), self.name() ++ '\n')")))))
+ (with-temp-buffer
+ (let ((status (apply #'vc-jj--call nil t "bookmark" "advance"
+ (append (when my/vc-jj-advance-to
+ (list "--to" my/vc-jj-advance-to))
+ names))))
+ (message "vc-jj: %s" (string-trim (buffer-string)))
+ status)))
+
+ (defun my/vc-jj--advance-before-push (&rest _)
+ (my/vc-jj-bookmark-advance))
+ (advice-add 'vc-jj-push :before #'my/vc-jj--advance-before-push)
+
+ (defun my/vc-jj-checkin (files comment &optional _rev)
+ "Describe @, then push. FILES is ignored: jj has no partial checkin."
+ (let ((default-directory (vc-jj-root (car files))))
+ (vc-jj-modify-change-comment nil "@" comment)
+ (vc-jj-push nil)))
+ (advice-add 'vc-jj-checkin :override #'my/vc-jj-checkin))
+
(setq org-directory "~/org/")
(after! org
diff --git a/doom/.config/doom/config.org b/doom/.config/doom/config.org
index 9fe5e64..96ef07d 100644
--- a/doom/.config/doom/config.org
+++ b/doom/.config/doom/config.org
@@ -1,12 +1,5 @@
-#+TITLE: Doom Emacs configuration
-#+PROPERTY: header-args:emacs-lisp :tangle config.el
-* Foreword
-
-"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.
-yea
+#+TITLE: Literate DOOM Emacs configuration
+
* Splash screen
This is my custom splash screen for Emacs.
#+begin_src emacs-lisp
@@ -536,7 +529,7 @@ This currently doesnt work.
:n "RET" #'emms-browser-add-tracks-and-play))
#+end_src
-* Git
+* vc
~LEAVE Emacs? You gotta be kidding.~
** TODO vc :: maps
Mappings for vc.
@@ -579,22 +572,6 @@ I tried my best to match these to the default bindings under ~C-x v~
;; 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?
-
-Define mappings for the already-installed ~majutsu~
-Open the main majutsu buffer.
-#+begin_src emacs-lisp
- (map!
- :leader
- :prefix "g m"
- :desc "Status" "m" #'majutsu ; default majutsu buffer
- :desc "Describe" "d" #'majutsu-describe ; equivalent of 'jj describe'
- :desc "New" "n" #'majutsu-new ; new jj rev
- :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
@@ -606,7 +583,42 @@ 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
+vc-jj has a bit of a... weird flow, it runs ~jj commit~ instead of ~jj describe~, and doesnt advance bookmarks the way i usually do in my flow.
+
+Here we fix it!
+#+begin_src emacs-lisp
+(after! vc-jj
+ (defvar my/vc-jj-advance-to nil)
+
+ (defun my/vc-jj-bookmark-advance (&optional names)
+ "Advance the closest bookmarks (or just NAMES) forward."
+ (interactive
+ (when current-prefix-arg
+ (list (completing-read-multiple
+ "Advance bookmarks: "
+ (vc-jj--process-lines
+ nil "bookmark" "list"
+ "-T" "if(!self.remote(), self.name() ++ '\n')")))))
+ (with-temp-buffer
+ (let ((status (apply #'vc-jj--call nil t "bookmark" "advance"
+ (append (when my/vc-jj-advance-to
+ (list "--to" my/vc-jj-advance-to))
+ names))))
+ (message "vc-jj: %s" (string-trim (buffer-string)))
+ status)))
+
+ (defun my/vc-jj--advance-before-push (&rest _)
+ (my/vc-jj-bookmark-advance))
+ (advice-add 'vc-jj-push :before #'my/vc-jj--advance-before-push)
+
+ (defun my/vc-jj-checkin (files comment &optional _rev)
+ "Describe @, then push. FILES is ignored: jj has no partial checkin."
+ (let ((default-directory (vc-jj-root (car files))))
+ (vc-jj-modify-change-comment nil "@" comment)
+ (vc-jj-push nil)))
+ (advice-add 'vc-jj-checkin :override #'my/vc-jj-checkin))
+#+end_src
+
* Org
~Protesting for Org README support.~
diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables
index bab0bbf..a6edd72 100644
--- a/fish/.config/fish/fish_variables
+++ b/fish/.config/fish/fish_variables
@@ -9,5 +9,5 @@ SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fish
SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish
SETUVAR _fisher_upgraded_to_4_4:\x1d
-SETUVAR --export fish_user_paths:/home/hi/\x2elocal/share\x1e/home/hi/\x2econfig/emacs/bin\x1e/home/hi/\x2elocal/bin\x1e/usr/sbin\x1e/sbin\x1e/home/hi/go/bin/\x1e/home/hi/\x2eyarn/bin
+SETUVAR --export fish_user_paths:/home/hi/\x2ebun/bin\x1e/home/hi/\x2ebun\x1e/home/hi/\x2elocal/share\x1e/home/hi/\x2econfig/emacs/bin\x1e/home/hi/\x2elocal/bin\x1e/usr/sbin\x1e/sbin\x1e/home/hi/go/bin/\x1e/home/hi/\x2eyarn/bin
SETUVAR --export nvm_default_version:26\x2e9\x2e0
diff --git a/jj/.config/jj/repos/9e33453f54e7089b84ce/config.toml b/jj/.config/jj/repos/9e33453f54e7089b84ce/config.toml
new file mode 100644
index 0000000..5cc7bd0
--- /dev/null
+++ b/jj/.config/jj/repos/9e33453f54e7089b84ce/config.toml
@@ -0,0 +1,2 @@
+#:schema https://docs.jj-vcs.dev/latest/config-schema.json
+