         :desc "Restart & restore Emacs"      "r" #'doom/restart-and-restore
         :desc "Restart Emacs"                "R" #'doom/restart)
 
-      (:prefix ("&" . "snippets")
+      ;;; <leader> & --- snippets
+      (:prefix-map ("&" . "snippets")
         :desc "New snippet"           "n" #'yas-new-snippet
         :desc "Insert snippet"        "i" #'yas-insert-snippet
         :desc "Find global snippet"   "/" #'yas-visit-snippet-file

        :desc "Recent project files"        "R"   #'projectile-recentf
        :desc "Sudo this file"              "s"   #'doom/sudo-this-file
        :desc "Sudo find file"              "S"   #'doom/sudo-find-file
        :desc "Delete this file"            "X"   #'doom/delete-this-file
        :desc "Yank filename"               "y"   #'+default/yank-buffer-filename)

      "o" nil ; we need to unbind it first as Org claims this
      (:prefix ("o". "org")
        (:prefix ("a" . "org agenda")
          :desc "Agenda"                  "a"   #'org-agenda
          :desc "Todo list"               "t"   #'org-todo-list
          :desc "Tags view"               "m"   #'org-tags-view
          :desc "View search"             "v"   #'org-search-view)
        :desc "Switch org buffers"      "b"     #'org-switchb
        :desc "Capture"                 "c"     #'org-capture
        :desc "Goto capture"            "C"     (λ! (require 'org-capture) (call-interactively #'org-capture-goto-target))
        :desc "Link store"              "l"     #'org-store-link
        :desc "Sync org caldav"         "s"     #'org-caldav-sync)

      (:prefix ("q" . "quit/restart")
        :desc "Quit Emacs"                   "q" #'kill-emacs
        :desc "Save and quit Emacs"          "Q" #'save-buffers-kill-terminal
        (:when (featurep! :ui workspaces)

      (:after info
        :map Info-mode-map
        "o" #'ace-link-info)

      ;;; ivy & counsel
      (:when (featurep! :completion ivy)
        (:after ivy
          :map ivy-minibuffer-map
          "TAB" #'ivy-alt-done
          "C-g" #'keyboard-escape-quit)
        (:after counsel
          :map counsel-ag-map
          "C-c C-e"  #'+ivy/wgrep-occur      ; search/replace on results
          [backtab]  #'+ivy/wgrep-occur      ; search/replace on results
          "C-SPC"    #'ivy-call-and-recenter ; preview
          "M-RET"    (+ivy-do-action! #'+ivy-git-grep-other-window-action))
        "C-M-y" #'counsel-yank-pop)

      ;;; neotree
      (:when (featurep! :ui neotree)
        "<f9>"   #'+neotree/open
        "<C-f9>" #'+neotree/find-this-file
        (:after neotree
          :map neotree-mode-map
          "q"       #'neotree-hide
          "RET"     #'neotree-enter
          "SPC"     #'neotree-quick-look
          "v"       #'neotree-enter-vertical-split
          "s"       #'neotree-enter-horizontal-split
          "c"       #'neotree-create-node
          "D"       #'neotree-delete-node
          "g"       #'neotree-refresh
          "r"       #'neotree-rename-node
          "R"       #'neotree-refresh
          "h"       #'+neotree/collapse-or-up
          "l"       #'+neotree/expand-or-open
          "n"       #'neotree-next-line
          "p"       #'neotree-previous-line
          "N"       #'neotree-select-next-sibling-node
          "P"       #'neotree-select-previous-sibling-node))

      ;;; popups
      "C-x p"   #'+popup/other
      "C-`"     #'+popup/toggle
      "C-~"     #'+popup/raise

      ;;; repl
      "C-c C-z" #'+eval/open-repl-other-window

      ;;; smartparens
      (:after smartparens
        :map smartparens-mode-map
        "C-M-a"     #'sp-beginning-of-sexp
        "C-M-e"     #'sp-end-of-sexp
        "C-M-f"     #'sp-forward-sexp
        "C-M-b"     #'sp-backward-sexp
        "C-M-d"     #'sp-splice-sexp
        "C-M-k"     #'sp-kill-sexp
        "C-M-t"     #'sp-transpose-sexp
        "C-<right>" #'sp-forward-slurp-sexp
        "M-<right>" #'sp-forward-barf-sexp
        "C-<left>"  #'sp-backward-slurp-sexp
        "M-<left>"  #'sp-backward-barf-sexp)

      ;;; treemacs
      (:when (featurep! :ui treemacs)
        "<f9>"   #'+treemacs/toggle
        "<C-f9>" #'+treemacs/find-file)

      ;;; yasnippet
      (:after yasnippet
        :map yas-keymap  ; keymap while editing an inserted snippet
        "C-e"           #'+snippets/goto-end-of-field
        "C-a"           #'+snippets/goto-start-of-field
        "<S-tab>"       #'yas-prev-field
        "<M-backspace>" #'+snippets/delete-to-start-of-field
        [backspace]     #'+snippets/delete-backward-char
        [delete]        #'+snippets/delete-forward-char-or-field))
