Rudy’s OBTF Rudolf Adamkovič

Home / Emacs


Project

A project managed by Emacs, namely project.el.

Table 1: Global keybindings
Key Description Mnemonic Note
C-x p f find file file like C-x C-f
C-x p g find regexp in files   then r to replace
C-x p r replace regexp in files replace  
C-x p D open root directory    
C-x p d find directory directory like C-x d
C-x p m open Magit    
C-x p t run or switch to terminal terminal new if prefixed C-u
C-x p b switch to buffer buffer like C-x b
C-x p k kill project buffers project like C-x k
C-x p p switch to project project  

Type M-n (the future history) to find file, its content, or a directory, matching the symbol at point.

Discover projects on launch.

(defcustom my-project-dir org-directory
  "The directory containing projects."
  :type '(string)
  :group 'my-project)
(defun my-project-discover-projects ()
  "Re-discover all projects in 'project-dir'."
  (interactive)
  (require 'project)
  (project-forget-zombie-projects)
  (project-forget-projects-under my-project-dir t)
  (project-remember-projects-under my-project-dir t))
(unless (project-known-project-roots)
  (my-project-discover-projects))

Use the entire project-prefix-map, instead of the commands listed in project-switch-commands, when switching the current project with C-x p p.

(with-eval-after-load 'project
  (setopt project-switch-use-entire-map t))

Trust .dir-locals in these projects.

(setopt safe-local-variable-directories
        (list (file-name-concat org-directory "src" "eg")))


© 2025 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and secret alien technologies of yesteryear.