feat(tazjin/emacs): make zoxide project opener work without git
Work projects are not in git, but I still want to fuzzy jump to them. Change-Id: Iced78519da69b6992d253e2a0c9ed485f1347164 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9005 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su>
This commit is contained in:
		
							parent
							
								
									1b84ac5f31
								
							
						
					
					
						commit
						261ae2de95
					
				
					 2 changed files with 9 additions and 5 deletions
				
			
		|  | @ -49,8 +49,8 @@ | |||
| ;; Open the depot | ||||
| (global-set-key (kbd "s-s d") #'tvl-depot-status) | ||||
| 
 | ||||
| ;; Open any repo through zoxide | ||||
| (global-set-key (kbd "s-s r") #'zoxide-open-magit) | ||||
| ;; Open any project through zoxide | ||||
| (global-set-key (kbd "s-s r") #'zoxide-open-project) | ||||
| 
 | ||||
| ;; Add subthread collapsing to notmuch-show. | ||||
| ;; | ||||
|  |  | |||
|  | @ -351,10 +351,14 @@ by looking for a `Cargo.toml' file." | |||
|                     (if-let ((pr (project-current))) | ||||
|                         (project-root pr))))) | ||||
| 
 | ||||
| (defun zoxide-open-magit () | ||||
|   "Query Zoxide for paths and open magit in the result." | ||||
| (defun zoxide-open-project () | ||||
|   "Query Zoxide for paths, and open the result as appropriate (magit or dired)." | ||||
|   (interactive) | ||||
|   (zoxide-open-with nil #'magit-status-setup-buffer)) | ||||
|   (zoxide-open-with | ||||
|    nil | ||||
|    (lambda (path) | ||||
|      (condition-case err (magit-status-setup-buffer path) | ||||
|        (magit-outside-git-repo (dired path)))))) | ||||
| 
 | ||||
| (defun toggle-nix-test-and-exp () | ||||
|   "Switch between the .nix and .exp file in a Tvix/Nix test." | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue