From b4ff40b941672764121ceac236f7086c20d82396 Mon Sep 17 00:00:00 2001 From: Zach Pearson Date: Mon, 14 Oct 2019 14:36:21 -0500 Subject: [PATCH] Add conda layer (to work with anaconda environments) --- layers/+lang/conda/README.org | 22 +++++++++++++++++++++ layers/+lang/conda/packages.el | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 layers/+lang/conda/README.org create mode 100644 layers/+lang/conda/packages.el diff --git a/layers/+lang/conda/README.org b/layers/+lang/conda/README.org new file mode 100644 index 000000000..c1c605727 --- /dev/null +++ b/layers/+lang/conda/README.org @@ -0,0 +1,22 @@ +#+TITLE: Conda Layer + +#+TAGS: layer|programming|util + +* Description +This layer integrates [[https://github.com/necaris/conda.el][conda.el]] with Spacemacs's UI, placing shortcuts to its +functions under =SPC a= (applications). =conda.el= allows users to interact with +Anaconda and Miniconda environments from Emacs -- this is not the same +as =anaconda-mode=, which provides IDE-like features for Python. + +* Install +To add this layer to Spacemacs, add =conda= to your +=dotspacemacs-configuration-layers= list, then set the variable =conda-anaconda-home= to +the path to your installation of anaconda. + +* Keybindings +| Key Binding | Description | +| ~SPC a e A~ | Toggle automatic activation of environments | +| ~SPC a e a~ | Open a =helm= buffer to select an environment | +| ~SPC a e b~ | Activate environment for buffer based on =conda-project-env-name= | +| ~SPC a e d~ | Deactivate current environment | +| ~SPC a e l~ | Open a help buffer that lists envs | diff --git a/layers/+lang/conda/packages.el b/layers/+lang/conda/packages.el new file mode 100644 index 000000000..68c47f930 --- /dev/null +++ b/layers/+lang/conda/packages.el @@ -0,0 +1,35 @@ +;;; packages.el --- Conda Layer packages File for Spacemacs +;; +;; Copyright (C) 2012-2019 Sylvain Benner & Contributors +;; +;; Author: Zach Pearson +;; URL: https://github.com/syl20bnr/spacemacs +;; +;; This file is not part of GNU Emacs. +;; +;;; License: GPLv3 + +(setq conda-packages + '( + conda + )) + +(defun conda/init-conda () + (use-package conda + :defer t + :commands ( + conda-env-list + conda-env-activate + conda-env-deactivate + conda-env-autoactivate-mode + conda-env-activate-for-buffer + ) + :init + (progn + (spacemacs/set-leader-keys + "ael" 'conda-env-list + "aea" 'conda-env-activate + "aed" 'conda-env-deactivate + "aeA" 'conda-env-autoactivate-mode + "aeb" 'conda-env-activate-for-buffer) + (spacemacs/declare-prefix "ae" "Python conda environments"))))