Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the default directory for treemacs when starting for the first time #1069

Open
sethen opened this issue Nov 13, 2023 · 4 comments
Open

Comments

@sethen
Copy link

sethen commented Nov 13, 2023

If this is documented somewhere I apologize. I am unsure where to set a directory for when treemacs starts for the first time. For instance, if I reinstall treemacs and then issue the treemacs command it asks me to pick a directory. How can I make this automatic?

@Alexander-Miller
Copy link
Owner

It's described here: https://github.com/Alexander-Miller/treemacs#workspace-selection

Basically it depends on where treemacs is started from.

If you really insist you can set treemacs-current-workspace to something appropriate. Loading treemacs with require and then using treemacs-edit-workspaces could also work.

@sethen
Copy link
Author

sethen commented Nov 14, 2023

It's described here: https://github.com/Alexander-Miller/treemacs#workspace-selection

Basically it depends on where treemacs is started from.

If you really insist you can set treemacs-current-workspace to something appropriate. Loading treemacs with require and then using treemacs-edit-workspaces could also work.

I understand I can use the org-mode way to do it... But is there a way to set this on startup? Something like treemacs-edit-workspaces "~/Developer") or something??

Copy link

stale bot commented Jan 13, 2024

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

@stale stale bot added the stale label Jan 13, 2024
@Alexander-Miller
Copy link
Owner

Try something like this:

(progn
  (require 'treemacs)
  (setf
   (treemacs-current-workspace)
   (treemacs-workspace->create!
    :name "Foo Space"
    :projects
    (list
     (treemacs-project->create!
      :name "Downloads"
      :path "~/Downloads"
      :path-status 'local-readable)
     (treemacs-project->create!
      :name "Documents"
      :path "~/Documents"
      :path-status 'local-readable))))
  (treemacs--persist))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants