美文网首页
Emacs配置记录

Emacs配置记录

作者: FangHao | 来源:发表于2017-03-25 22:12 被阅读0次

    touch ~./.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
        ;;ein ;;Jupyter
        elpy
        flycheck
        material-theme
        py-autopep8))
    
    (mapc #'(lambda (package)
        (unless (package-installed-p package)
          (package-install package)))
          myPackages)
    
    ;; BASIC CUSTOMIZATION
    ;; --------------------------------------
    
    (setq inhibit-startup-message t) ;; hide the startup message
    (load-theme 'material t) ;; load material theme
    (global-linum-mode t) ;; enable line numbers globally
    
    ;; PYTHON CONFIGURATION
    ;; --------------------------------------
    
    (elpy-enable)
    (elpy-use-ipython)
    
    ;; use flycheck not flymake with elpy
    (when (require 'flycheck nil t)
      (setq elpy-modules (delq 'elpy-module-flymake elpy-modules))
      (add-hook 'elpy-mode-hook 'flycheck-mode))
    
    ;; enable autopep8 formatting on save
    (require 'py-autopep8)
    (add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save)
    
    ;; init.el ends here
    

    相关文章

      网友评论

          本文标题:Emacs配置记录

          本文链接:https://www.haomeiwen.com/subject/oychottx.html