Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (require 'package)
- (setq package-enable-at-startup nil)
- (add-to-list 'package-archives
- '("melpa" . "https://melpa.org/packages/"))
- (package-initialize)
- (unless (package-installed-p 'evil)
- (package-refresh-contents)
- (package-install 'evil))
- (require 'evil)
- (evil-mode 1)
- (unless (package-installed-p 'use-package)
- (package-refresh-contents)
- (package-install 'use-package))
- (unless (package-installed-p 'gruvbox-theme)
- (package-refresh-contents)
- (package-install 'use-package))
- (unless (package-installed-p 'flymake-python-pyflakes)
- (package-refresh-contents)
- (package-install 'use-package))
- (unless (package-installed-p 'auctex)
- (package-refresh-contents)
- (package-install 'use-package))
- (unless (package-installed-p 'auctex-latexmk)
- (package-refresh-contents)
- (package-install 'use-package))
- (unless (package-installed-p 'company)
- (package-refresh-contents)
- (package-install 'company))
- (unless (package-installed-p 'company-jedi)
- (package-refresh-contents)
- (package-install 'company-jedi))
- (unless (package-installed-p 'highlight)
- (package-refresh-contents)
- (package-install 'highlight))
- (unless (package-installed-p 'flycheck)
- (package-refresh-contents)
- (package-install 'flycheck))
- (unless (package-installed-p 'rust-mode)
- (package-refresh-contents)
- (package-install 'rust-mode))
- (unless (package-installed-p 'cargo)
- (package-refresh-contents)
- (package-install 'cargo))
- (unless (package-installed-p 'lsp-mode)
- (package-refresh-contents)
- (package-install 'lsp-mode))
- (unless (package-installed-p 'lsp-rust)
- (package-refresh-contents)
- (package-install 'lsp-rust))
- (defalias 'yes-or-no-p 'y-or-n-p)
- (global-set-key (kbd "<s-return>") 'term)
- (setq scroll-conservatively 100)
- (setq ring-bell-function 'ignore)
- (use-package which-key
- :ensure t
- :init
- (which-key-mode))
- (use-package ycmd
- :ensure t
- :init)
- (use-package flymake-python-pyflakes
- :ensure t
- :init)
- (use-package auctex
- :defer t
- :ensure t
- :init)
- (use-package auctex-latexmk
- :ensure t
- :init)
- (auctex-latexmk-setup)
- (use-package company
- :ensure t
- :init)
- (use-package company-jedi
- :ensure t
- :init)
- (use-package company-lsp
- :ensure t
- :init)
- (add-to-list 'company-backends 'company-jedi)
- (use-package highlight
- :ensure t
- :init)
- (use-package rust-mode
- :ensure t
- :init
- (setq rust-format-on-save t))
- (use-package lsp-mode
- :init)
- (use-package lsp-rust
- :after lsp-mode)
- (use-package cargo
- :ensure t
- :init)
- (with-eval-after-load 'lsp-mode
- (setq lsp-rust-rls-command '("rustup" "run" "nightly" "rls"))
- (require 'lsp-rust))
- (add-to-list 'load-path "/home/jordan/Documents/lsp-mode")
- (require 'lsp-mode)
- (lsp-define-stdio-client
- ;; This can be a symbol of your choosing. It will be used as a the
- ;; prefix for a dynamically generated function "-enable"; in this
- ;; case: lsp-prog-major-mode-enable
- lsp-prog-major-mode
- "rust"
- ;; This will be used to report a project's root directory to the LSP
- ;; server.
- (lambda () default-directory)
- ;; This is the command to start the LSP server. It may either be a
- ;; string containing the path of the command, or a list wherein the
- ;; car is a string containing the path of the command, and the cdr
- ;; are arguments to that command.
- '("rustup" "run" "nightly" "rls"))
- ;; Here we'll add the function that was dynamically generated by the
- ;; call to lsp-define-stdio-client to the major-mode hook of the
- ;; language we want to run it under.
- ;;
- ;; This function will turn lsp-mode on and call the command given to
- ;; start the LSP server.
- (add-hook 'prog-major-mode #'lsp-prog-major-mode-enable)
- (lsp-define-stdio-client lsp-rust "rust" #'lsp-rust--get-root nil
- :command-fn #'lsp-rust--rls-command
- :initialize #'lsp-rust--initialize-client)
- (require 'company-lsp)
- (push 'company-lsp company-backends)
- (require 'lsp-ui)
- (add-hook 'lsp-mode-hook 'lsp-ui-mode)
- (add-hook 'rust-mode-hook 'flycheck-mode)
- (add-hook 'rust-mode-hook 'cargo-minor-mode)
- (setq racer-cmd "/home/jordan/.cargo/bin/racer")
- (setq racer-rust-src-path "/home/jordan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src")
- ;(add-hook 'rust-mode-hook 'racer-mode)
- (add-hook 'rust-mode-hook 'eldoc-mode)
- (add-hook 'rust-mode-hook 'company-mode)
- (add-hook 'rust-mode-hook 'lsp-mode)
- (add-hook 'rust-mode-hook #'lsp-rust-enable)
- (add-hook 'latex-mode-hook 'flyspell-mode)
- (add-hook 'after-init-hook 'global-company-mode)
- (add-hook 'python-mode-hook 'flymake-python-pyflakes-load)
- (setq flymake-python-pyflakes-executable "flake8")
- (setq company-idle-delay 0)
- (setq company-minimum-prefix-length 1)
- (setq company-selection-wrap-around 1)
- (setq completion-show-help 1)
- (setq company-tooltip-idle-delay 1)
- (tool-bar-mode -1)
- (menu-bar-mode -1)
- (scroll-bar-mode -1)
- (setq inhibit-startup-message t)
- (global-linum-mode t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement