diff options
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r-- | .config/emacs/init.el | 79 |
1 files changed, 65 insertions, 14 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 74b7592..23883f6 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1,19 +1,70 @@ -(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 '(evil))) -(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. - ) +(defvar elpaca-installer-version 0.3) +(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) +(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) +(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) +(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil + :files (:defaults (:exclude "extensions")) + :build (:not elpaca--activate-package))) +(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) + (build (expand-file-name "elpaca/" elpaca-builds-directory)) + (order (cdr elpaca-order)) + (default-directory repo)) + (add-to-list 'load-path (if (file-exists-p build) build repo)) + (unless (file-exists-p repo) + (make-directory repo t) + (condition-case-unless-debug err + (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (call-process "git" nil buffer t "clone" + (plist-get order :repo) repo))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) + (kill-buffer buffer) + (error "%s" (with-current-buffer buffer (buffer-string)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) + (unless (require 'elpaca-autoloads nil t) + (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (load "./elpaca-autoloads"))) +(add-hook 'after-init-hook #'elpaca-process-queues) +(elpaca `(,@elpaca-order)) + +;; Install use-package support +(elpaca elpaca-use-package + ;; Enable :elpaca use-package keyword. + (elpaca-use-package-mode) + ;; Assume :elpaca t unless otherwise specified. + (setq elpaca-use-package-by-default t)) + +;; Block until current queue processed. +(elpaca-wait) + + +(use-package evil :demand t) +(use-package eglot + :commands (eglot eglot-ensure) + :hook ((python-mode . eglot-ensure) + (csharp-mode . eglot-ensure)) + :config + (progn + (define-key eglot-mode-map (kbd "C-c e r") 'eglot-rename) + (define-key eglot-mode-map (kbd "C-c e f") 'eglot-format) + (define-key eglot-mode-map (kbd "C-c e h") 'eglot-help-at-point) + (add-to-list 'eglot-server-programs + `(csharp-mode . ("omnisharp" "-lsp"))))) + +(use-package company :demand t) + (when (version<= "26.0.50" emacs-version ) (global-display-line-numbers-mode)) (setq backup-directory-alist '(("" . "~/.local/emacs/backup"))) -(if (and (fboundp 'evil-mode) - (not (evil-mode))) - (evil-mode)) + +; (add-hook 'after-init-hook 'global-company-mode) + |