8
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Python開発環境のためのemacs設定

Posted at

Pythonで100本ノックをやってみて、いろいろ書くのに時間がかかったので、emacsに以下の内容を設定し、開発環境を改善した。

~/emacs.d/init.el
に以下の内容を追記

;; 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

参考資料
MacとEmacsのPython開発環境について調べてみた
http://umi-uyura.hatenablog.com/entry/2016/05/09/000613

個人的な Python 用の Emacs の設定
http://org-technology.com/posts/emacs-elpy.html

Emacs - the Best Python Editor?
https://realpython.com/blog/python/emacs-the-best-python-editor/

うわっ...私のEmacs、使いにくすぎ?だったら...カスタマイズシヤッセー!!ダァダァシエリイェッスッシェーショーヘイヘイ!!!
http://d.hatena.ne.jp/sandai/20120304/p2

8
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?