diff --git a/site-start.d/403-python-mode.el b/site-start.d/403-python-mode.el new file mode 100644 index 0000000..b055df3 --- /dev/null +++ b/site-start.d/403-python-mode.el @@ -0,0 +1,49 @@ +;;; 403-python-mode.el --- major mode for python code + +;;; Commentary: + +;;; Code: +(use-package python-mode + :ensure t + :config + (add-hook 'python-mode-hook + (lambda () + (setq indent-tabs-mode nil) ; use only spaces and no tabs + (setq python-indent-offset 4) + ;;(setq indent-tabs-mode t) ; use tabs to indent + ;;(setq tabs-width 4) ; + (add-to-list 'write-file-functions 'whitespace-cleanup))) + + (use-package 'py-autopep8 + :custom + ;; Be complient with PIP 8 -- Style Guide + ;; https://www.python.org/dev/peps/pep-0008/#indentation + ;;(require 'py-autopep8) + (py-autopep8-enable-on-save)) + ) + +;; (autoload 'python-mode "python-mode" +;; "Major mode for the python programming language" t) + +;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) +;; (add-to-list 'interpreter-mode-alist '("python" . python-mode)) + +;; ;; used, if working code is usings tabs (instead of PIP8 encuraged spaces) +;; ;;(add-hook 'python-mode-hook 'guess-style-guess-tabs-mode) +;; ;;(add-hook 'python-mode-hook (lambda () +;; ;; (guess-style-guess-tab-width))) + +;; ;; Be complient with PIP 8 -- Style Guide +;; ;; https://www.python.org/dev/peps/pep-0008/#indentation +;; ;;(require 'py-autopep8) + +;; (add-hook 'python-mode-hook +;; (lambda () +;; (setq indent-tabs-mode nil) ; use only spaces and no tabs +;; (setq python-indent-offset 4) +;; ;;(setq indent-tabs-mode t) ; use tabs to indent +;; ;;(py-autopep8-enable-on-save) +;; (add-to-list 'write-file-functions 'whitespace-cleanup))) + + +;;; 403-python-mode.el ends here