From 4887d23af38841827b3c9eac686f3628b6186b3d Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Tue, 26 Jul 2022 18:01:17 -0400 Subject: [PATCH] updated --- init.el | 130 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 77 insertions(+), 53 deletions(-) diff --git a/init.el b/init.el index fa43f48..917f800 100644 --- a/init.el +++ b/init.el @@ -78,6 +78,7 @@ ;; set up font ligatures (use-package pragmatapro-lig + :if window-system :straight (pragmatapro-lig :type git :host github :repo "lumiknit/emacs-pragmatapro-ligatures") @@ -251,66 +252,89 @@ :bind (("M-/" . company-complete)) :config (add-hook 'after-init-hook 'global-company-mode)) -(if (equal(system-name) "cult") - (progn +(setq use-lsp (equal (system-name) "cult")) - ;; Posframe is a pop-up tool that must be manually installed for dap-mode - (use-package posframe) +;; when not using lsp use hippie expand +(when (not use-lsp) + ;; hippie expand stuff: M-/ to expand things + (bind-key "M-/" 'hippie-expand) + (defun sanityinc/dabbrev-friend-buffer (other-buffer) + (< (buffer-size other-buffer) (* 1 1024 1024))) + (setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer) + (setq hippie-expand-try-functions-list + '(try-expand-all-abbrevs + try-complete-file-name-partially + try-complete-file-name + try-expand-dabbrev + try-expand-dabbrev-from-kill + try-expand-dabbrev-all-buffers + try-expand-list + try-expand-line + try-complete-lisp-symbol-partially + try-complete-lisp-symbol))) - ;; Use the Debug Adapter Protocol for running tests and debugging - (use-package dap-mode - :hook (lsp-mode . dap-mode) - (lsp-mode . dap-ui-mode)) +;; Posframe is a pop-up tool that must be manually installed for dap-mode +(use-package posframe + :if use-lsp) - (use-package flycheck - :init (global-flycheck-mode)) +;; Use the Debug Adapter Protocol for running tests and debugging +(use-package dap-mode + :if use-lsp + :hook (lsp-mode . dap-mode) + (lsp-mode . dap-ui-mode)) - (use-package lsp-mode - :ensure t - :config (setq lsp-headerline-breadcrumb-enable nil - lsp-keymap-prefix "C-c l" - lsp-enable-symbol-highlighting nil - ;lsp-lens-enable nil - ;lsp-signature-render-documentation nil - lsp-eldoc-enable-hover nil - ;lsp-signature-auto-activate nil - ;lsp-enable-file-watchers nil - read-process-output-max (* 1024 1024) ; 1M - lsp-modeline-diagnostics-enable nil - lsp-prefer-capf t - lsp-completion-provider :capf - lsp-completion-enable t - lsp-prefer-flymake nil) - ;(setf (lsp--client-multi-root (gethash 'iph lsp-clients)) nil) - (define-key lsp-mode-map (kbd "C-c l") lsp-command-map) - :hook (lsp-mode . lsp-lens-mode) - (lsp-mode . lsp-enable-which-key-integration) - (scala-mode . lsp) - (rust-mode . lsp) - (java-mode . lsp)) +(use-package flycheck + :if use-lsp + :init (global-flycheck-mode)) - (use-package lsp-metals - :ensure t - :config (setq lsp-metals-server-args '("-J-Dmetals.allow-multiline-string-formatting=off") - lsp-metals-show-inferred-type nil - lsp-metals-super-method-lenses-enabled nil - lsp-metals-show-implicit-arguments nil - lsp-meatals-show-implicit-conversions-and-classes nil)) +(use-package lsp-mode + :if use-lsp + :ensure t + :config (setq lsp-headerline-breadcrumb-enable nil + lsp-keymap-prefix "C-c l" + lsp-enable-symbol-highlighting nil + ;lsp-lens-enable nil + ;lsp-signature-render-documentation nil + lsp-eldoc-enable-hover nil + ;lsp-signature-auto-activate nil + ;lsp-enable-file-watchers nil + read-process-output-max (* 1024 1024) ; 1M + lsp-modeline-diagnostics-enable nil + lsp-prefer-capf t + lsp-completion-provider :capf + lsp-completion-enable t + lsp-prefer-flymake nil) + ;(setf (lsp--client-multi-root (gethash 'iph lsp-clients)) nil) + (define-key lsp-mode-map (kbd "C-c l") lsp-command-map) + :hook (lsp-mode . lsp-lens-mode) + (lsp-mode . lsp-enable-which-key-integration) + (scala-mode . lsp) + (rust-mode . lsp) + (java-mode . lsp)) - (use-package lsp-ui - :ensure t - :hook (lsp-mode . lsp-ui-mode) - :config (setq lsp-ui-doc-enable nil - lsp-ui-sideline-enable t - ;lsp-ui-sideline-show-code-actions nil - lsp-ui-sideline-diagnostic-max-line-length 60 - lsp-ui-sideline-diagnostic-max-lines 6)) +(use-package lsp-metals + :if use-lsp + :ensure t + :config (setq lsp-metals-server-args '("-J-Dmetals.allow-multiline-string-formatting=off") + lsp-metals-show-inferred-type nil + lsp-metals-super-method-lenses-enabled nil + lsp-metals-show-implicit-arguments nil + lsp-meatals-show-implicit-conversions-and-classes nil)) - (use-package lsp-java - :ensure t - :config (add-hook 'java-mode-hook 'lsp)) +(use-package lsp-ui + :if use-lsp + :ensure t + :hook (lsp-mode . lsp-ui-mode) + :config (setq lsp-ui-doc-enable nil + lsp-ui-sideline-enable t + ;lsp-ui-sideline-show-code-actions nil + lsp-ui-sideline-diagnostic-max-line-length 60 + lsp-ui-sideline-diagnostic-max-lines 6)) -)) +(use-package lsp-java + :if use-lsp + :ensure t + :config (add-hook 'java-mode-hook 'lsp)) ;; projectile (use-package projectile @@ -365,8 +389,8 @@ :bind (("C-x g" . magit-status) ("s-b" . magit-blame))) -;; org roam (use-package org-roam + :if (equal (system-name) "cult") :config (setq org-roam-directory "~/org/") (org-roam-db-autosync-mode))