You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to have something within Spacemacs to enable me to have a common base configuration and then a machine or profile specific configurations that can be loaded as well. I have something that accomplishes this for machine specific configurations in my ~/.spacemacs.d/init.el that loads an Elisp file corresponding to the host name it is running on. This way, I can have a standard, common configuration. And then on my work machine, I can load the configuration for the different layers that apply only to work. Or I can set things that are private to work, as far as directories to look for git repos, etc.
Currently, I have the following in my ~/.spacemacs.d/init.el:
;; Load system specific config, if it exists
(let ((tbh-system-specific-config
(expand-file-name
(concat tbh-hostname ".el") tbh-spacemacs-d-dir)))
(if (file-readable-p tbh-system-specific-config)
(load-file tbh-system-specific-config)))
Where tbh are my initials, and tbh-hostname and tbh-spacemacs-d-dir are constants set above this, but elided for brevity.
Then, here's the outline of the rest of my ~/.spacemacs.d/init.el:
(defundotspacemacs/layers ()
;; Standard dotspacemacs/layers function elided for example brevity;; ...;; If a system-specific layers configuration function exist, call it
(if (fboundp'tbh/dotspacemacs/layers)
(tbh/dotspacemacs/layers))
(defundotspacemacs/init ()
;; Standard dotspacemacs/init function elided for example brevity;; ...;; If a system-specific init function exist, call it
(if (fboundp'tbh/dotspacemacs/init)
(tbh/dotspacemacs/init))
)
(defundotspacemacs/user-init ()
;; Standard dotspacemacs/user-init function elided for example brevity;; ...;; If a system-specific user-init function exist, call it
(if (fboundp'tbh/dotspacemacs/user-init)
(tbh/dotspacemacs/user-init))
)
(defundotspacemacs/user-config ()
;; Standard dotspacemacs/user-config function elided for example brevity;; ...;; If a system specific user-config function exists, call it
(if (fboundp'tbh/dotspacemacs/user-config)
(tbh/dotspacemacs/user-config))
)
Then, for example in an abbreviated version, on my desktop, named shedemei, I have ~/.spacemacs.d/shedemei.el:
;; Local configuration only for shedemei.
(defuntbh/dotspacemacs/layers ()
"Local configuration layers declaration"
(let ((local-configuration-layers
'(
(c-c++ :variables
c-c++-enable-clang-support t)
erlang
)))
(dolist (layer local-configuration-layers)
(add-to-list'dotspacemacs-configuration-layers layer)))
(let ((local-additional-packages '(visual-fill-column w3m)))
(dolist (package local-additional-packages)
(add-to-list'dotspacemacs-additional-packagespackage))))
(defuntbh/dotspacemacs/user-config ()
"Local configuration function.This function is called at the very end of Spacemacs initialization afterlayers configuration, after the general dotspacemacs/user-config."
(add-hook'visual-line-mode-hook'visual-fill-column-mode))
I'd love for a similar mechanism to be built into Spacemacs so I don't have to modify the functions in my ~/.spacemacs.d/init.el that shouldn't be modified. I've also wanted to have profile specific configurations -- like if I have multiple Emacs processes, have processes dedicated to gnus, so it wouldn't need all of the other layers other than my basic layers installed.
I'm not sure how to integrate this sort of thing into Spacemacs, but I can see how it would be useful. I'm certainly not the only one who uses the same configuration on multiple machines and don't need the same configuration on each. How to best do this?
The text was updated successfully, but these errors were encountered:
My first proposal is something that is an application of what you are doing:
define a list of profile symbols
for each declared profile, spacemacs will load the default function as well as the profile functions in the order of profile declaration.
Default functions are the functions we have currently in the dotfile.
Profile functions are constructed like this (to match the construct for user specific functions):
dotspacemacs/<profile-symbol>-<default function suffix>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
I would like to have something within Spacemacs to enable me to have a common base configuration and then a machine or profile specific configurations that can be loaded as well. I have something that accomplishes this for machine specific configurations in my
~/.spacemacs.d/init.el
that loads an Elisp file corresponding to the host name it is running on. This way, I can have a standard, common configuration. And then on my work machine, I can load the configuration for the different layers that apply only to work. Or I can set things that are private to work, as far as directories to look for git repos, etc.Currently, I have the following in my
~/.spacemacs.d/init.el
:Where
tbh
are my initials, andtbh-hostname
andtbh-spacemacs-d-dir
are constants set above this, but elided for brevity.Then, here's the outline of the rest of my
~/.spacemacs.d/init.el
:Then, for example in an abbreviated version, on my desktop, named
shedemei
, I have~/.spacemacs.d/shedemei.el
:I'd love for a similar mechanism to be built into Spacemacs so I don't have to modify the functions in my
~/.spacemacs.d/init.el
that shouldn't be modified. I've also wanted to have profile specific configurations -- like if I have multiple Emacs processes, have processes dedicated to gnus, so it wouldn't need all of the other layers other than my basic layers installed.I'm not sure how to integrate this sort of thing into Spacemacs, but I can see how it would be useful. I'm certainly not the only one who uses the same configuration on multiple machines and don't need the same configuration on each. How to best do this?
The text was updated successfully, but these errors were encountered: