Emacs技术文章

Mac 安装 Emacs,配置python,java,go 环境

2018-01-16  本文已影响199人  MicoCube
;; init.el --- Emacs configuration

;;;;;;;;;;;;;;;;;;;;;;;;;;begin python;;;;;;;;;;;;;;;;;;;

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(require 'package)
(add-to-list 'package-archives
             '("elpy" . "https://jorgenschaefer.github.io/packages/"))

(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/"))
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)

(setq elpy-rpc-python-command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3")
(setq python-shell-interpreter "/Library/Frameworks/Python.framework/Versions/3.6/bin/ipython"
      python-shell-interpreter-args "-i --simple-prompt")
(package-initialize)

(when (require 'elpy nil t)
  (elpy-enable))
(setq elpy-rpc-backend "jedi")
(setq inhibit-startup-message t) ;; hide the startup message
(global-linum-mode t) ;; enable line numbers globally

;;;;;;;;;;;;;;;;;;;;;;;;;;end python;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;begin neotree;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/neotree")
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)
(setq neo-smart-open t)
;;;;;;;;;;;;;;;;;;;;;;;;;;end neotree;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;start popup;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/popup-el")
(require 'popup)
;;;;;;;;;;;;;;;;;;;;;;;;;;end popup;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;end auto-complete;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/auto-complete")
(require 'auto-complete-config)
;;;;;;;;;;;;;;;;;;;;;;;;;;end auto-complete;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;begin java config;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;begin flycheck;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/flycheck")
(global-flycheck-mode)
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/exec-path-from-shell")
(exec-path-from-shell-initialize)
;;;;;;;;;;;;;;;;;;;;;;;;;;end flycheck;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;begin memoize;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/emacs-memoize")
(require 'memoize)
;;;;;;;;;;;;;;;;;;;;;;;;;;end memoize;;;;;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;begin dash;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/dash.el")
(require 'dash)
;;;;;;;;;;;;;;;;;;;;;;;;;;end dash;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;begin jdee;;;;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/jdee")
(require 'jdee)
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ajc-tag-file
   "/Users/micocube/.emacs.d/emacs-plugins/auto-java-complete/java_base.tag")
 '(jde-jdk
   (quote
    ("/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home")))
 '(jde-jdk-registry
   (quote
    (("1.8" . "/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"))))
 '(jdee-jdk-registry
   (quote
    (("1.8" . "/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home"))))
 '(jdee-server-dir "/Users/micocube/.emacs.d/emacs-plugins/jdee-server/")
 '(package-selected-packages (quote (## elpy))))
;;;;;;;;;;;;;;;;;;;;;;;;;;end jdee;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;bengin auto-java-complete;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/auto-java-complete")
(require 'ajc-java-complete-config)
(add-hook 'java-mode-hook 'ajc-java-complete-mode)
(add-hook 'find-file-hook 'ajc-4-jsp-find-file-hook)
;;;;;;;;;;;;;;;;;;;;;;;;;;bengin auto-java-complete;;;;;;;;;;;;




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;end java config;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;begin go config;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;begin go-mode;;;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/go-mode.el")
(require 'go-mode)
;;;;;;;;;;;;;;;;;;;;;;;;;;end go-mode;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;begin goflymake;;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/goflymake")
(require 'go-flymake)
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/goflymake")
(require 'go-flycheck)

(add-hook 'flymake-mode-hook
      (lambda()
        (local-set-key (kbd "C-c C-e n") 'flymake-goto-next-error)))
(add-hook 'flymake-mode-hook
      (lambda()
        (local-set-key (kbd "C-c C-e p") 'flymake-goto-prev-error)))
(add-hook 'flymake-mode-hook
      (lambda()
        (local-set-key (kbd "C-c C-e m") 'flymake-popup-current-error-menu)))
;;;;;;;;;;;;;;;;;;;;;;;;;;end goflymake;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;begin gocode;;;;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/gocode/emacs")
(require 'go-autocomplete)
(ac-config-default)

(add-hook 'before-save-hook #'gofmt-before-save)
;;;;;;;;;;;;;;;;;;;;;;;;;;end gocode;;;;;;;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;end go config;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;begin material-theme;;;;;;;;;;;;;;;;;;
(add-to-list 'load-path "/Users/micocube/.emacs.d/emacs-plugins/emacs-material-theme")
(require 'material-theme)
(load-theme 'material t)
;;;;;;;;;;;;;;;;;;;;;;;;;end material-theme;;;;;;;;;;;;;;;;;;;;
;; init.el ends here

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
上一篇下一篇

猜你喜欢

热点阅读