Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (add-to-list 'load-path "~/.emacs.d/lisp/")
- (setq TeX-auto-save t)
- (setq TeX-parse-self t)
- (require 'package)
- ;; Add melpa repository to archives
- (add-to-list 'package-archives
- '("melpa" . "http://melpa.milkbox.net/packages/") t)
- ;; Initialize packages
- (package-initialize)
- ;; Enable company globally for all mode
- (global-company-mode)
- ;; Reduce the time after which the company auto completion popup opens
- (setq company-idle-delay 0.2)
- ;; Reduce the number of characters before company kicks in
- (setq company-minimum-prefix-length 1)
- ;; Set path to racer binary
- (setq racer-cmd "/usr/local/bin/racer")
- ;; Set path to rust src directory
- (setq racer-rust-src-path "/home/morten/.rust/src/")
- ;; Load rust-mode when you open `.rs` files
- (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
- ;; Setting up configurations when you load rust-mode
- (add-hook 'rust-mode-hook
- '(lambda ()
- ;; Enable racer
- (racer-activate)
- ;; Hook in racer with eldoc to provide documentation
- (racer-turn-on-eldoc)
- ;; Use flycheck-rust in rust-mode
- (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
- ;; Use company-racer in rust mode
- (set (make-local-variable 'company-backends) '(company-racer))
- ;; Key binding to jump to method definition
- (local-set-key (kbd "M-.") #'racer-find-definition)
- ;; Key binding to auto complete and indent
- (local-set-key (kbd "TAB") #'racer-complete-or-indent)))
- (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.
- '(inhibit-startup-screen t))
- (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.
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement