can i do without an lsp?

This commit is contained in:
Levi 2024-09-05 14:35:21 +02:00
parent fd22ded673
commit faaa64b0bc
1 changed files with 9 additions and 78 deletions

View File

@ -200,20 +200,6 @@
(global-set-key (kbd "C-x E n f") #'narrow-to-defun)
(global-set-key (kbd "C-x E n r") #'narrow-to-region)
(global-set-key (kbd "C-x E w") #'widen)
(with-eval-after-load 'lsp-mode
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration)
;; (setq lsp-idle-delay 0.500)
;; (setq lsp-log-io nil)
;; (setq lsp-completion-provider :capf)
(add-hook 'prog-mode-hook 'lsp-deferred)
(add-hook 'before-save-hook #'lsp-format-buffer)
(setq lsp-file-watch-threshold nil)
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]plz-out\\'"))
(when (file-exists-p custom-file)
(load custom-file)))
@ -371,39 +357,6 @@
(use-package fic-mode :ensure t :defer t)
(use-package flycheck :ensure t :defer t)
(use-package eglot
:ensure t
:hook ((python-mode . eglot-ensure)
(rust-mode . eglot-ensure)
(c-mode . eglot-ensure)
(c++-mode . eglot-ensure)
(js-mode . eglot-ensure)
(typescript-mode . eglot-ensure)
(eglot-managed-mode . (lambda ()
(setq-local completion-at-point-functions
(list (cape-super-capf
#'eglot-completion-at-point
#'cape-file))))))
:config
(setq eglot-autoshutdown t)
(setq eglot-sync-connect 1)
(setq eglot-connect-timeout 10)
(setq eglot-confirm-server-initiated-edits nil)
(setq eglot-autoreconnect t)
(setq completion-category-defaults nil)
(setq completion-category-overrides '((eglot (styles orderless))))
(setq eglot-completion-style 'orderless)
(setq eglot-completion-provider :company)
(with-eval-after-load 'orderless
(setq orderless-matching-styles '(orderless-literal orderless-regexp orderless-initialism orderless-flex)))
:bind (:map eglot-mode-map
("s-l a" . eglot-code-actions)
("s-l r" . eglot-rename)
("s-l f" . eglot-format)
("s-l d" . eglot-find-declaration)
("s-l i" . eglot-find-implementation)
("s-l t" . eglot-find-typeDefinition)))
;; navigation
;; ===
@ -682,28 +635,8 @@
(define-key dired-mode-map (kbd "C-c d") 'my/dired-duplicate-file)
(use-package lsp-mode :ensure t
:commands lsp
:custom
(lsp-completion-provider :none) ;; we use Corfu!
:init
(defun my/lsp-mode-setup-completion ()
(lsp-enable-which-key-integration)
(setf
(alist-get 'styles
(alist-get 'lsp-capf completion-category-defaults))
'(orderless)))
:config
(setq lsp-prefer-flymake nil)
:hook
(lsp-completion-mode . my/lsp-mode-setup-completion))
(add-to-list 'auto-mode-alist '("BUILD\\'" . python-mode))
;; Less chatty for unsupported modes
(setq lsp-warn-no-matched-clients nil)
(setq lsp-file-watch-threshold nil)
(use-package org-journal
:ensure t
@ -714,16 +647,14 @@
(setq org-journal-file-format "%Y%m%d.org")
(setq org-journal-enable-agenda-integration t))
(global-set-key (kbd "C-c j") 'org-journal-new-entry)
(global-set-key (kbd "C-x O j") 'org-journal-new-entry)
;; (use-package lmtf
;; :straight (lmtf :type git :host github :repo "lneely/lmtf")
;; :bind (:map emacs-lisp-mode-map
;; ("C-c t !" . lmtf-run-all-tests)
;; ("C-c t r" . lmtf-show-results)))
(add-to-list 'load-path "~/src/my/lmtf")
(require 'lmtf)
(define-key emacs-lisp-mode-map (kbd "C-c t !") #'lmtf-run-all-tests)
(define-key emacs-lisp-mode-map (kbd "C-c t r") #'lmtf-show-results)
(defun copy-file-path-to-clipboard ()
"Copy the current buffer's file path to the clipboard."
(interactive)
(let ((filepath (buffer-file-name)))
(when filepath
(kill-new filepath)
(message "Copied file path: %s" filepath))))
(global-set-key (kbd "C-x y b p") 'copy-file-path-to-clipboard)