Closed yubrshen closed 5 years ago
Thanks looks good to me. The basics of a layer-based configuration are pretty straightforward as you've seen - some layer calls use-package on it, the one that owns it, and other layers can configure before/after the owning layer does its thing.
The challenging part for me was learning when to do the pre/post/use-package-add-hook stuff.
I think the ivy configuration is a good example of working within the framework. The pre
part sets variables that aren't overwritten by the ivy layer. However, Spacemacs has its own value for ivy-height
and the keymaps aren't loaded yet so we have to configure those in the post block.
For the package hook, the Spacemacs layer for ranger ranger/post-init-dired
essentially restarts the keybindings in the ranger map after dired loads. We can't modify the keymap in post-init-ranger
as post-init-dired
might happen afterwards. We can't do it by adding another, this time our own, post-init-dired
, as it may happen before the ranger layer's post-init and our mapping changes will be overwritten.
Thanks for the confirmation and sharing!
I found your latest .spacemacs.d as of Dec. 2018 has much improved and easier to understand. I'm trying to follow your example to add lsp-dart support. In the process, I wrote receipts of adding layers, packages and configure packages. I hope to get your help to review and confirm. The receipts might be part of your repository for future users, once you correct my understanding.
RECEIPTS.zip