summaryrefslogtreecommitdiff
path: root/conf/km-python.el
diff options
context:
space:
mode:
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)