(define-key global-map [(meta G)] (lambda () (interactive)
(ff/goto-function-definition t)))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; (setq python-indent-offset 4)
+
+;; (define-key python-mode-map [(shift right)] 'python-indent-shift-right)
+;; (define-key python-mode-map [(shift left)] 'python-indent-shift-left)
+;; (define-key python-mode-map [(shift right)] 'indent-rigidly-right-to-tab-stop)
+;; (define-key python-mode-map [(shift left)] 'indent-rigidly-left-to-tab-stop)
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The big stuff (bbdb, mailcrypt, etc.)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Automagically add the frame numbers in comments in a beamer file
-(defun number-beamer-frames ()
+(defun ff/number-beamer-frames ()
"Add the frame numbers as comments after each \begin{frame}"
(interactive)
require 'torch'
require 'nn'
-require 'nnx'
-require 'optim'
require 'image'
-require 'pl'
-require 'paths'
-require 'ffmpeg'
+require 'optim'
")
(lua-mode)
)
+(defun ff/start-python ()
+ "Adds all the stuff to start a new python file"
+ (interactive)
+ (goto-char (point-min))
+ (insert "#!/usr/bin/env python
+
+import torch
+import math
+
+from torch import nn
+from torch.nn import functional as fn
+
+from torch import Tensor
+from torch.autograd import Variable
+from torch.nn.parameter import Parameter
+from torch.nn import Module
+
+")
+ (python-mode)
+ )
+
(defun ff/start-html ()
"Adds all that stuff to start a new HTML file."
(ff/start-lua)
)
+ (when (string-match "\\.py$" filename)
+ (python-mode)
+ (ff/start-python)
+ )
+
(when (string-match "\\.html$" filename)
(html-mode)
(ff/start-html)
(define-key ff/map [(control m)] 'woman)
(define-key ff/map "b" 'bookmark-jump)
(define-key ff/map [(control =)] 'calc)
-(define-key ff/map "=" 'number-beamer-frames)
+(define-key ff/map "=" 'ff/number-beamer-frames)
(define-key ff/map [(control shift b)]
(lambda () (interactive)
(bookmark-set)