Skip to content

Commit

Permalink
Provide useful shortcuts for project
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay committed Oct 9, 2023
1 parent 7a38cef commit d4ffb16
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,11 @@ Set DEBUG=1 in the command line or use --debug-init to enable this.")
:commands (project-find-file
project-switch-to-buffer
project-switch-project
project-forget-zombie-projects)
project-switch-project-open-file)
:bind (:map project-prefix-map
("s" . my-switch-project-and-kill-buffers)
("R" . project-remember-projects-under)
("K" . project-kill-buffers))
:custom
(project-vc-ignores '("#*#" ".#*" "*~" ".*~" "*.*~" "*.elc" "*.pyc" "*.o"
"*.lo" "*.la" "*.sock" "*.zwc" ".DS_Store" "__pycache__" "node_modules"))
Expand All @@ -326,7 +330,12 @@ Set DEBUG=1 in the command line or use --debug-init to enable this.")
(run-at-time "07:00pm" (* 24 60 60) 'project-forget-zombie-projects)
;; Use ripgrep if installed
(when (shell-command-to-string "command rg --version")
(setq xref-search-program 'ripgrep)))
(setq xref-search-program 'ripgrep))
(defun my-switch-project-and-kill-buffers ()
"Kill all buffers of the current project, then switch to a new project."
(interactive)
(project-kill-buffers t)
(call-interactively 'project-switch-project)))

;;;; VCS
(use-package git-modes
Expand Down

0 comments on commit d4ffb16

Please sign in to comment.