I tried 100 knocks with Python and it took a long time to write various things, so I set the following contents in emacs and improved the development environment.
~/emacs.d/init.el Add the following contents to
;; init.el --- Emacs configuration
;; INSTALL PACKAGES
;; --------------------------------------
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar myPackages
'(better-defaults
material-theme))
(mapc #'(lambda (package)
(unless (package-installed-p package)
(package-install package)))
myPackages)
;; BASIC CUSTOMIZATION
;; --------------------------------------
(setq inhibit-startup-message t)
(load-theme 'material t)
(global-linum-mode t) ;; enable line number globally
;;rectangular selection
(cua-mode t)
(setq cua-enable-cua-keys nil)
;;disable making back-up file
(setq make-backup-files nil)
;;active save history mode and keep 500 history records
(savehist-mode 1)
(setq history-length 500)
;; SETUP PYTHONMODE
;;---------------------------------------
(defvar myPackages
'(better-defaults
elpy ;;add elpy package
material-theme))
;; active auto-complete by jedi
(elpy-enable)
(elpy-use-ipython)
(setq elpy-rpc-backend "jedi")
;; active flycheck instead of flymake
(when (require 'flycheck nil t)
(remove-hook 'elpy-modules 'elpy-module-flymake)
(add-hook 'elpy-mode-hook 'flycheck-mode))
(defvar myPackages
'(better-defaults
smartrep ;;add smartrep package
material-theme))
(define-key elpy-mode-map (kbd "C-c C-v") 'helm-flycheck)
(require 'smartrep)
(smartrep-define-key elpy-mode-map "C-c"
'(("C-n" . flycheck-next-error)
("C-p" . flycheck-previous-error)))
;; setup indent hiright
(set-face-background 'highlight-indentation-face "#313131")
(set-face-background 'highlight-indentation-current-column-face "#777777")
(add-hook 'elpy-mode-hook 'highlight-indentation-current-column-mode)
;;(setq twittering-curl-program "/usr/bin/curl")
;; init.el ends here
Reference material I investigated the Python development environment of Mac and Emacs http://umi-uyura.hatenablog.com/entry/2016/05/09/000613
Personal Emacs settings for Python http://org-technology.com/posts/emacs-elpy.html
Emacs - the Best Python Editor? https://realpython.com/blog/python/emacs-the-best-python-editor/
Wow ... my Emacs is too hard to use? If so ... Castamy's sushi !! http://d.hatena.ne.jp/sandai/20120304/p2
Recommended Posts