/project-treemacs

Primary LanguageEmacs LispGNU General Public License v3.0GPL-3.0

Project Treemacs


Simple treemacs backend for project.el:

  • Projects in Treemacs map to project.el projects.
  • Workspaces in Treemacs map to project.el projects + their external roots.
  • project-find-file, project-switch-to-buffer, project-find-regexp et al operate on the current treemacs project.
  • project-or-external-find-file, project-or-external-find-regexp operate on the current treemacs workspace.


Installing

Install project-treemacs directly from MELPA

Configuration

Manually:

(with-eval-after-load 'treemacs
  (require 'project-treemacs)
  (project-treemacs-mode))

With use-package:

(use-package project-treemacs
  :demand t
  :after treemacs
  :config
  (project-treemacs-mode))

Usage

Enable the mode by calling project-treemacs-mode.

Use treemacs as you normally would, creating workspaces, projects, etc.

Use project.el commands as you normally would, with your current project.el project defined by the current treemacs project, and your project external roots defined by the current treemacs workspace.

Commands

  • project-treemacs-mode - enables and disables the project-treemacs backend.

User Options

  • project-treemacs-ignores - list of patterns to add to project-ignores.
  • project-treemacs-prefer-backend - Whether or not to prefer the project-treemacs backend over others. See the commentary in project.el for more information, and the documentation for project-find-functions in particular.

Limitations

For the moment, the project-treemacs backend depends on the treemacs side panel being visible.

For the moment, project.el commands are still based on the buffer from which they are called, although the latest version of project.el includes a TODO for allowing the user to "pick the current project for the whole Emacs session, independent of the current directory".

Examples

treemacs-project-search Using project-find-file to search for files within the current treemacs project.


treemacs-workspace-search Using project-or-external-find-file to search for files within the current treemacs workspace.

Links