Revise SPC f keybinds
- SPC f . -> counsel-file-jump or find-file - SPC f > -> doom/browse-in-other-projects - SPC f / -> projectile-find-file - SPC f ? -> doom/find-file-in-other-project - Moved doom/sudo-find-file to SPC f S This change was made to accommodate the new doom/browse-in-other-projects and doom/find-file-in-other-project commands, which make it easy to jump to files in other known projects.
This commit is contained in:
parent
15dd5870ea
commit
1b43ea50f0
2 changed files with 26 additions and 3 deletions
|
@ -33,6 +33,28 @@ they are absolute."
|
|||
(dolist (fn projectile-project-root-files-functions)
|
||||
(remhash (format "%s-%s" fn default-directory) projectile-project-root-cache)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/find-file-in-other-project (project-root)
|
||||
"Preforms `projectile-find-file' in a known project of your choosing."
|
||||
(interactive
|
||||
(list
|
||||
(completing-read "Find file in project: " (projectile-relevant-known-projects)
|
||||
nil nil nil nil (doom-project-root))))
|
||||
(unless (file-directory-p project-root)
|
||||
(error "Project directory '%s' doesn't exist" project-root))
|
||||
(doom-project-find-file project-root))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/browse-in-other-project (project-root)
|
||||
"Preforms `find-file' in a known project of your choosing."
|
||||
(interactive
|
||||
(list
|
||||
(completing-read "Browse in project: " (projectile-relevant-known-projects)
|
||||
nil nil nil nil (doom-project-root))))
|
||||
(unless (file-directory-p project-root)
|
||||
(error "Project directory '%s' doesn't exist" project-root))
|
||||
(doom-project-browse project-root))
|
||||
|
||||
|
||||
;;
|
||||
;; Library
|
||||
|
|
|
@ -609,10 +609,10 @@
|
|||
:desc "List errors" "x" #'flycheck-list-errors)
|
||||
|
||||
(:prefix ("f" . "file")
|
||||
:desc "Find file" "." #'find-file
|
||||
:desc "Find file from here" "." (if (fboundp 'counsel-file-jump) #'counsel-file-jump #'find-file)
|
||||
:desc "Find file in other project" ">" #'doom/browse-in-other-project
|
||||
:desc "Find file in project" "/" #'projectile-find-file
|
||||
:desc "Sudo find file" ">" #'doom/sudo-find-file
|
||||
:desc "Find file from here" "?" #'counsel-file-jump
|
||||
:desc "Find file in other project" "?" #'doom/find-file-in-other-project
|
||||
:desc "Browse emacs.d" "E" #'+default/browse-emacsd
|
||||
:desc "Browse private config" "P" #'+default/browse-config
|
||||
:desc "Recent project files" "R" #'projectile-recentf
|
||||
|
@ -624,6 +624,7 @@
|
|||
:desc "Find file in private config" "p" #'+default/find-in-config
|
||||
:desc "Recent files" "r" #'recentf-open-files
|
||||
:desc "Save file" "s" #'save-buffer
|
||||
:desc "Sudo find file" "S" #'doom/sudo-find-file
|
||||
:desc "Yank filename" "y" #'+default/yank-buffer-filename)
|
||||
|
||||
(:prefix ("g" . "git")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue