码迷,mamicode.com
首页 > 系统相关 > 详细

clojure-emacs-autocomplete

时间:2015-06-20 00:16:37      阅读:597      评论:0      收藏:0      [点我收藏+]

标签:

1. https://github.com/clojure-emacs/cider#keyboard-shortcuts

2. install emacs 24.5

3. http://clojure-doc.org/articles/tutorials/emacs.html

4. http://stackoverflow.com/questions/23233470/how-to-use-ciders-built-in-autocompletion-in-clojure/28249313#28249313

5. edit .lein project.clj

  

{:user
{
:java-cmd "C:\\Program Files\\Java\\jdk1.8.0\\bin\\java.exe"
:plugins [
[cider/cider-nrepl "0.9.0-SNAPSHOT"]
]
:dependencies [[org.clojure/tools.nrepl "0.2.7"]]
}
}

 

6. edit project‘s project.clj

    :profiles {:dev {:plugins [[cider/cider-nrepl "0.9.0"]]}}

 

7. the .emacs

 

 

(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.
 ‘(text-mode-hook (quote (turn-on-auto-fill text-mode-hook-identify))))
(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.
 )

(require ‘cl)
(require ‘package) 
(add-to-list ‘package-archives ‘("melpa" . "http://melpa.org/packages/") t) 

(let ((default-directory "~/.emacs.d/elpa/"))  
(normal-top-level-add-to-load-path ‘("."))  
(normal-top-level-add-subdirs-to-load-path))  
  
(require ‘color-theme)  
(color-theme-initialize)  
(color-theme-bharadwaj-slate)


(require ‘auto-complete-config)
(add-to-list ‘ac-dictionary-directories "~/.emacs.d/elpa/auto-complete-20150615.34/dict")

(require ‘clojure-mode)
(require ‘cider-mode)
(require ‘ac-cider)

(ac-config-default)
(add-hook ‘cider-repl-mode-hook ‘ac-cider-setup)                                                                                                              

                               
(add-hook ‘cider-mode-hook ‘ac-cider-setup)
(eval-after-load "auto-complete"
  ‘(add-to-list ‘ac-modes ‘cider-repl-mode))

(add-hook ‘clojure-mode-hook ‘paredit-mode)
(add-hook ‘clojurescript-mode-hook ‘paredit-mode)                                                                                                             

                               
(add-hook ‘clojure-mode-hook ‘rainbow-delimiters-mode)
(setq cider-repl-pop-to-buffer-on-connect nil)

(require ‘highlight-parentheses)
(add-hook ‘clojure-mode-hook
          (lambda ()
            (highlight-parentheses-mode t)))

(defun set-auto-complete-as-completion-at-point-function ()
  (setq completion-at-point-functions ‘(auto-complete)))
(add-hook ‘auto-complete-mode-hook ‘set-auto-complete-as-completion-at-point-function)
(add-hook ‘cider-repl-mode-hook ‘set-auto-complete-as-completion-at-point-function)                                                                           

                               
(add-hook ‘cider-mode-hook ‘set-auto-complete-as-completion-at-point-function)
(eval-after-load "cider"
  ‘(define-key cider-mode-map (kbd "C-c C-d") ‘ac-cider-popup-doc))


(package-initialize)

  

clojure-emacs-autocomplete

标签:

原文地址:http://www.cnblogs.com/rexy/p/4589917.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!