From 0d354b0887d7209089f8db805a6d6d0d8c0b4457 Mon Sep 17 00:00:00 2001 From: Gabriel Simmer Date: Tue, 31 Aug 2021 22:12:10 +0100 Subject: [PATCH] LSP and ivy for emacs. --- london/.emacs.d/init.el | 44 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/london/.emacs.d/init.el b/london/.emacs.d/init.el index 09b81d0..060eb91 100644 --- a/london/.emacs.d/init.el +++ b/london/.emacs.d/init.el @@ -15,8 +15,8 @@ (require 'package) (setq package-archives '(("melpa" . "https://melpa.org/packages/") - ("org" . "https://orgmode.org/elpa") - ("elpa" . "https://elpa.gnu.org/packages"))) + ("org" . "https://orgmode.org/elpa/") + ("elpa" . "https://elpa.gnu.org/packages/"))) (package-initialize) (unless package-archive-contents @@ -28,6 +28,7 @@ (require 'use-package) (setq use-package-always-ensure t) +;; I like Monokai Pro, sue me ;) (use-package monokai-pro-theme :ensure t :config @@ -40,12 +41,49 @@ :bind (:map global-map ("M-0" . treemacs-select-window) ("C-x t t" . treemacs))) + +;; LSP config. +(use-package spinner) +(use-package lsp-mode + :init + (setq lsp-keymap-prefix "C-c l") + :hook ((rust-mode . lsp) + (lsp-mode . lsp-enable-which-key-integration)) + :commands lsp) + +(use-package lsp-ui :commands lsp-ui-mode) +(use-package lsp-ivy :commands lsp-ivy-workspace-symbol) +(use-package lsp-treemacs :commands lsp-treemacs-errors-list) + +(use-package rust-mode) + +;; Ivy/Swiper/Counsel config. +(use-package swiper) +(use-package counsel) +(use-package ivy + :diminish + :bind (("C-s" . swiper) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-switch-buffer-kill) + :map ivy-reverse-i-search-map + ("C-k" . ivy-previous-line) + ("C-d" . ivy-reverse-i-search-kill)) + :config + (ivy-mode 1)) (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. - '(package-selected-packages '(treemacs use-package monokai-pro-theme))) + '(package-selected-packages + '(rust-mode swipe spinner lsp-treemacs lsp-ivy lsp-ui lsp-mode counsel swiper ivy treemacs use-package monokai-pro-theme))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful.