summaryrefslogtreecommitdiff
path: root/conf/km-python.el
diff options
context:
space:
mode:
authorKyle Meyer <meyerkya@gmail.com>2013-01-09 11:43:10 -0500
committerKyle Meyer <meyerkya@gmail.com>2013-01-09 12:06:26 -0500
commitf5238f044d2f142f1940b93e3761e1f5bfd7ef7c (patch)
treef8891973414827fcd50768c7eefd425f2ac8fae7 /conf/km-python.el
parente4028f83dab75489a0bd8fe0e2a8fa4abf2a95ee (diff)
downloademacs.d-f5238f044d2f142f1940b93e3761e1f5bfd7ef7c.tar.gz
py functions: random assingment, shebang, exit
Diffstat (limited to 'conf/km-python.el')
-rw-r--r--conf/km-python.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/conf/km-python.el b/conf/km-python.el
new file mode 100644
index 0000000..f3d1b08
--- /dev/null
+++ b/conf/km-python.el
@@ -0,0 +1,18 @@
+(defun km/python-sysexit ()
+ (interactive)
+ (insert "sys.exit()"))
+
+(defun km/python-random-assignment ()
+ (interactive)
+ (km/insert-random-string 10)
+ (insert " = None"))
+
+(defun km/python-shebang ()
+ (interactive)
+ (km/shebang "python"))
+
+(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))
+(add-hook 'python-mode-hook 'km/python-hook)