     (which-key-mode))
   ;; chri/proglang branch:
 
-  ;; LSP mode.
-  (use-package lsp-mode
-    :init
-    (setq lsp-keymap-prefix "s-l")
-    :hook ((python-mode . lsp)
-           (c++-mode . lsp)
-           (c-mode .lsp)
-           (go-mode . lsp))
-    ;; rebind C-M-.
-    :bind (:map lsp-mode-map ("C-M-." . lsp-find-references))
-    :commands lsp)
-  (use-package lsp-ivy
-    :after lsp-mode)
-  (use-package lsp-ui
-    :commands lsp-ui-mode
-    :after lsp-mode)
-  (use-package lsp-treemacs
-    :after lsp-mode
-    :commands lsp-treemacs-errors-list
-    :bind (:map lsp-mode-map
-                ("s-t s" . lsp-treemacs-symbols)
-                ("s-t r" . lsp-treemacs-references)))
-  (use-package dap-mode
-    :defer t
-    :after lsp-mode
-    :init
-    (require 'dap-python))
+  (if chri/prefer-eglot
+      ;; eglot mode.
+      (use-package eglot
+        :commands (eglot eglot-ensure)
+        :hook ((swift-mode . eglot-ensure)
+               (rust-mode . eglot-ensure)
+               (c-mode . eglot-ensure)
+               (c++-mode . eglot-ensure)
+               (python-mode . eglot-ensure)
+               (js2-mode . eglot-ensure)
+               (go-mode . eglot-ensure)
+               (obc-c-mode . eglot-ensure))
+        :config
+        (when chri/enable-tabnine
+          (add-to-list 'eglot-stay-out-of 'company))
+        (define-key eglot-mode-map (kbd "s-e r") 'eglot-rename)
+        (define-key eglot-mode-map (kbd "s-e f") 'eglot-format)
+        (define-key eglot-mode-map (kbd "s-e G") 'eglot-format-buffer)
+        (define-key eglot-mode-map (kbd "s-e o") 'eglot-code-action-organize-imports)
+        (define-key eglot-mode-map (kbd "s-e a") 'eglot-code-actions)
+        (define-key eglot-mode-map (kbd "s-e q") 'eglot-code-action-quickfix)
+        (define-key eglot-mode-map (kbd "s-e h") 'eldoc)
+        (define-key eglot-mode-map (kbd "s-e x") 'xref-find-references)
+        (define-key eglot-mode-map (kbd "C-M-.") 'xref-find-references)
+        (define-key eglot-mode-map (kbd "s-e t") 'eglot-find-typeDefinition)
+        (define-key eglot-mode-map (kbd "s-e i") 'eglot-find-implementation)
+        (define-key eglot-mode-map (kbd "s-e d") 'eglot-find-declaration)
+        (define-key eglot-mode-map (kbd "s-e R") 'eglot-reconnect)
+        (define-key eglot-mode-map (kbd "s-e S") 'eglot-shutdown-all))
+
+    ;; LSP mode.
+    (use-package lsp-mode
+      :init
+      (setq lsp-keymap-prefix "s-l")
+      :hook ((python-mode . lsp)
+             (c++-mode . lsp)
+             (c-mode .lsp)
+             (go-mode . lsp))
+      ;; rebind C-M-.
+      :bind (:map lsp-mode-map ("C-M-." . lsp-find-references))
+      :commands lsp)
+    (use-package lsp-ivy
+      :after lsp-mode)
+    (use-package lsp-ui
+      :commands lsp-ui-mode
+      :after lsp-mode)
+    (use-package lsp-treemacs
+      :after lsp-mode
+      :commands lsp-treemacs-errors-list
+      :bind (:map lsp-mode-map
+                  ("s-t s" . lsp-treemacs-symbols)
+                  ("s-t r" . lsp-treemacs-references)))
+    (use-package dap-mode
+      :defer t
+      :after lsp-mode
+      :init
+      (require 'dap-python)))
 
   ;; Enable which-key for learing new keybindings:
   (use-package which-key

 '(mouse-yank-at-point t)
 '(org-startup-folded nil)
 '(package-selected-packages
   '(company-tabnine rainbow-mode rainbow-delimiters rg ag dts-mode ucs-utils font-utils persistent-soft unicode-fonts ivy-yasnippet yasnippet-snippets lsp coq js-mode notmuch coq-mode go-playground javascript-mode diminish yaml-imenu ws-butler which-key-posframe wanderlust use-package typescript-mode tree-mode toml-mode toml smex simpleclip rustic rust-mode proof-general projectile-speedbar menu-bar+ markdown-preview-mode magit-gh-pulls lsp-ui lsp-pyright lsp-jedi lsp-ivy lsp-dart kotlin-mode jsonrpc jedi ivy-rich ipython-shell-send iedit ido-completing-read+ haskell-mode go-projectile go-autocomplete ghub+ forge flymake flycheck-yamllint flycheck-pyflakes flycheck-posframe flycheck-ocaml flycheck-mypy flycheck-kotlin flx-ido find-file-in-project elpy elpher ein dash-functional counsel company-posframe company-lua company-lsp company-coq ccls cargo browse-kill-ring+ bpftrace-mode bazel async android-mode))
 '(projectile-tags-command "make_TAGS \"%s\" %s")
 '(rustic-display-spinner nil)
 '(rustic-format-trigger 'on-save)

    :init
    (setq ccls-executable "/usr/bin/ccls")
    :hook ((c-mode c++-mode objc-mode) .
           (lambda ()
             (require 'ccls)
             (unless chri/prefer-eglot
               (lsp)))))

  ;; bpftrace mode
  (use-package bpftrace-mode
