Fork me on GitHub
#spacemacs
<
2018-03-09
>
mccraigmccraig10:03:49

is it possible to (straightforwardly) add things to the spacemacs menus ? i'd like to add helm-projectile-ag somewhere, maybe even replace the helm-project-do-ag at SPC s a p

practicalli-johnny11:03:33

@mccraigmccraig Yes, it's really easy. Just find the layer in .emacs.d/layers and edit the packages.el file. In your case I believe it's layers/+completion/helm/packages.el

practicalli-johnny11:03:58

You may want to create a new branch in git for your change. Or you can create a personal package if you have a collection of changes

mccraigmccraig11:03:11

huh, actually i think in this case it's a PR - it's a bit odd that it's using helm-do-ag (rather than helm-projectile-ag) against the projectile-project-root https://github.com/syl20bnr/spacemacs/blob/master/layers/%2Bcompletion/helm/packages.el#L318

mccraigmccraig11:03:42

(the difference being that helm-projectile-ag respects your projectile path exclusions, so search results aren't full of build-artefact junk)

jeff.terrell13:03:43

@mccraigmccraig - You don't need to edit any spacemacs files, and doing so might complicate upgrades later. Spacemacs leaves a gap in the top-level menu, under o, for custom user stuff. Here's a snippet from my dotspacemacs/user-config:

(spacemacs/declare-prefix "o" "jst-bindings")  ; the prefixes are not required; they just label the group
  (spacemacs/declare-prefix "oc" "customize")
  (spacemacs/set-leader-keys "ocg" 'customize-group)
  (spacemacs/set-leader-keys "oco" 'customize-option)
You can also set leader keys under anything else, at the risk of having them conflict with Spacemacs builtins later.

ag22:03:03

you can specify multiple keybinding in set-leader-keys

(spacemacs/set-leader-keys
  "ocg" 'customize-group
  "oco" 'customize-option)