about summary refs log tree commit diff
path: root/users/tazjin
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin')
-rw-r--r--users/tazjin/emacs/config/bindings.el6
-rw-r--r--users/tazjin/emacs/config/functions.el7
2 files changed, 10 insertions, 3 deletions
diff --git a/users/tazjin/emacs/config/bindings.el b/users/tazjin/emacs/config/bindings.el
index f66a6ab551c1..a2f7369348ea 100644
--- a/users/tazjin/emacs/config/bindings.el
+++ b/users/tazjin/emacs/config/bindings.el
@@ -32,12 +32,12 @@
 (global-set-key (kbd "C-x r q") 'save-buffers-kill-terminal)
 (global-set-key (kbd "C-x C-c") 'ignore)
 
-;; Open Fefes Blog
-(global-set-key (kbd "C-c C-f") 'fefes-blog)
-
 ;; Open a file in project:
 (global-set-key (kbd "C-c f") 'project-find-file)
 
+;; Open a file via magit:
+(global-set-key (kbd "C-c C-f") #'magit-find-file-worktree)
+
 ;; Insert TODO comments
 (global-set-key (kbd "C-c t") 'insert-todo-comment)
 
diff --git a/users/tazjin/emacs/config/functions.el b/users/tazjin/emacs/config/functions.el
index df5b1c1239f0..d4d0c0d603e0 100644
--- a/users/tazjin/emacs/config/functions.el
+++ b/users/tazjin/emacs/config/functions.el
@@ -289,4 +289,11 @@
 
 (add-to-list 'project-find-functions #'find-depot-project)
 
+(defun magit-find-file-worktree ()
+  (interactive)
+  "Find a file in the current (ma)git worktree."
+  (magit-find-file--internal "{worktree}"
+                             (magit-read-file-from-rev "HEAD" "Find file")
+                             #'pop-to-buffer-same-window))
+
 (provide 'functions)