diff options
author | Kyle Meyer <meyerkya@gmail.com> | 2013-01-11 11:35:32 -0500 |
---|---|---|
committer | Kyle Meyer <meyerkya@gmail.com> | 2013-01-11 11:35:32 -0500 |
commit | 89f8a408e3176961d76370a65f7d12f1f0e7bba2 (patch) | |
tree | 2a8355b7d669cc6c530f2da594f2c641acc9f23d | |
parent | 975d165747f1d7971467bc09e412585bd062b929 (diff) | |
download | emacs.d-89f8a408e3176961d76370a65f7d12f1f0e7bba2.tar.gz |
python: keybinding for common analysis imports
-rw-r--r-- | conf/km-python.el | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/conf/km-python.el b/conf/km-python.el index f3d1b08..ce7aa53 100644 --- a/conf/km-python.el +++ b/conf/km-python.el @@ -11,8 +11,24 @@ (interactive) (km/shebang "python")) +(defconst km/python-analysis-imports + "import sys +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from matplotlib.ticker import MaxNLocator + +from colors import brew, fgry, bgry" + ) + +(defun km/python-insert-analysis-imports () + "Common imports for analysis scripts" + (interactive) + (insert km/python-analysis-imports)) + (defun km/python-hook () (local-set-key (kbd "C-c p r") 'km/python-random-assignment) (local-set-key (kbd "C-c p e") 'km/python-sysexit) - (local-set-key (kbd "C-c p s") 'km/python-shebang)) + (local-set-key (kbd "C-c p s") 'km/python-shebang) + (local-set-key (kbd "C-c p a") 'km/python-insert-analysis-imports)) (add-hook 'python-mode-hook 'km/python-hook) |