From 696d2d5a2932d129d518beef35d00744404a0346 Mon Sep 17 00:00:00 2001 From: Emmet Date: Mon, 27 May 2024 14:22:21 -0500 Subject: [PATCH] Trying local emacs crdt server for collaboration --- user/app/doom-emacs/config.el | 34 +++++++++++++++++++++++++++++++++ user/app/doom-emacs/doom.org | 36 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/user/app/doom-emacs/config.el b/user/app/doom-emacs/config.el index 913818e..5f6c1f6 100644 --- a/user/app/doom-emacs/config.el +++ b/user/app/doom-emacs/config.el @@ -626,6 +626,40 @@ If the path from LINK does not exist, nil is returned." "e" #'org-jekyll-rename-post ) +(require 'crdt) +(setq crdt-default-tls nil) +(setq crdt-default-name "Emmet") +(if (file-exists-p "~/.emacs.d/crdt-private.el") (load! "~/.emacs.d/crdt-private.el")) +(defun crdt-connect-default () + (interactive) + (crdt-connect crdt-default-server-address crdt-default-name) +) +(map! :leader + :desc "crdt" + :prefix ("C") + + :desc "Connect to a crdt server" + "c" #'crdt-connect-default + + :desc "Connect to default crdt server" + "C" #'crdt-connect-default + + :desc "Disconnect from a crdt server" + "d" #'crdt-disconnect + + :desc "Add buffer to a session" + "a" #'crdt-share-buffer + + :desc "Stop sharing buffer to session" + "s" #'crdt-stop-share-buffer + + :desc "List crdt buffers in a session" + "l" #'crdt-list-buffers + + :desc "List crdt users in a session" + "u" #'crdt-list-users +) + ;;;------ Org roam configuration ------;;; (require 'org-roam) (require 'org-roam-dailies) diff --git a/user/app/doom-emacs/doom.org b/user/app/doom-emacs/doom.org index bb328a3..ada60e2 100644 --- a/user/app/doom-emacs/doom.org +++ b/user/app/doom-emacs/doom.org @@ -756,6 +756,42 @@ exit "e" #'org-jekyll-rename-post ) +#+end_src +*** Crdt +#+begin_src emacs-lisp :tangle config.el +(require 'crdt) +(setq crdt-default-tls nil) +(setq crdt-default-name "Emmet") +(if (file-exists-p "~/.emacs.d/crdt-private.el") (load! "~/.emacs.d/crdt-private.el")) +(defun crdt-connect-default () + (interactive) + (crdt-connect crdt-default-server-address crdt-default-name) +) +(map! :leader + :desc "crdt" + :prefix ("C") + + :desc "Connect to a crdt server" + "c" #'crdt-connect-default + + :desc "Connect to default crdt server" + "C" #'crdt-connect-default + + :desc "Disconnect from a crdt server" + "d" #'crdt-disconnect + + :desc "Add buffer to a session" + "a" #'crdt-share-buffer + + :desc "Stop sharing buffer to session" + "s" #'crdt-stop-share-buffer + + :desc "List crdt buffers in a session" + "l" #'crdt-list-buffers + + :desc "List crdt users in a session" + "u" #'crdt-list-users +) #+end_src ** Org Roam Configuration *** Standard Org Roam Configuration