Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.99 KB | None | 0 0
  1. (add-to-list 'load-path "~/.emacs.d/lisp/")
  2.  
  3. (setq TeX-auto-save t)
  4. (setq TeX-parse-self t)
  5.  
  6. (require 'package)
  7.  
  8. ;; Add melpa repository to archives
  9. (add-to-list 'package-archives
  10.     '("melpa" . "http://melpa.milkbox.net/packages/") t)
  11.  
  12. ;; Initialize packages
  13. (package-initialize)
  14.  
  15. ;; Enable company globally for all mode
  16. (global-company-mode)
  17.  
  18. ;; Reduce the time after which the company auto completion popup opens
  19. (setq company-idle-delay 0.2)
  20.  
  21. ;; Reduce the number of characters before company kicks in
  22. (setq company-minimum-prefix-length 1)
  23.  
  24. ;; Set path to racer binary
  25. (setq racer-cmd "/usr/local/bin/racer")
  26.  
  27. ;; Set path to rust src directory
  28. (setq racer-rust-src-path "/home/morten/.rust/src/")
  29.  
  30. ;; Load rust-mode when you open `.rs` files
  31. (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
  32.  
  33. ;; Setting up configurations when you load rust-mode
  34. (add-hook 'rust-mode-hook
  35.  
  36.      '(lambda ()
  37.      ;; Enable racer
  38.      (racer-activate)
  39.  
  40.      ;; Hook in racer with eldoc to provide documentation
  41.      (racer-turn-on-eldoc)
  42.      
  43.      ;; Use flycheck-rust in rust-mode
  44.      (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
  45.      
  46.      ;; Use company-racer in rust mode
  47.      (set (make-local-variable 'company-backends) '(company-racer))
  48.      
  49.      ;; Key binding to jump to method definition
  50.      (local-set-key (kbd "M-.") #'racer-find-definition)
  51.      
  52.      ;; Key binding to auto complete and indent
  53.      (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
  54.  
  55. (custom-set-variables
  56.  ;; custom-set-variables was added by Custom.
  57.  ;; If you edit it by hand, you could mess it up, so be careful.
  58.  ;; Your init file should contain only one such instance.
  59.  ;; If there is more than one, they won't work right.
  60.  '(inhibit-startup-screen t))
  61. (custom-set-faces
  62.  ;; custom-set-faces was added by Custom.
  63.  ;; If you edit it by hand, you could mess it up, so be careful.
  64.  ;; Your init file should contain only one such instance.
  65.  ;; If there is more than one, they won't work right.
  66.  )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement