From 89f8a408e3176961d76370a65f7d12f1f0e7bba2 Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Fri, 11 Jan 2013 11:35:32 -0500 Subject: python: keybinding for common analysis imports --- conf/km-python.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3