From c15812be7ab99b4ced9c9a91d3f0c65f991bd5fb Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:51:08 +0400 Subject: [PATCH] what did i do here --- config/emacs/emacs.org | 43 ++++++++++++++++++++++++++++++++++++------ config/emacs/init.el | 29 +++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 7 deletions(-) diff --git a/config/emacs/emacs.org b/config/emacs/emacs.org index c11983bf..d6e43efd 100644 --- a/config/emacs/emacs.org +++ b/config/emacs/emacs.org @@ -368,14 +368,29 @@ make sure to setup authinfo (setq auth-sources '("~/.authinfo")) #+end_src *** Lsp-mode +**** Lsp-Mode hook +#+begin_src emacs-lisp + (defun efs/lsp-mode-setup () + (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) + (lsp-headerline-breadcrumb-mode)) + + :hook (lsp-mode . efs/lsp-mode-setup) +#+end_src **** Language Servers #+begin_src emacs-lisp -(use-package lsp-mode - :commands (lsp lsp-deferred) - :init - (setq lsp-keymap-prefix "C-c l") - :config - (lsp-enable-which-key-integration t)) + (defun sakomacs/lsp-mode-setup () + (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) + (lsp-headerline-breadcrumb-mode)) + + :hook (lsp-mode . sakomacs/lsp-mode-setup) + + (use-package lsp-mode + :commands (lsp lsp-deferred) + :hook (lsp-mode . sakomacs/lsp-mode-setup) + :init + (setq lsp-keymap-prefix "C-c l") + :config + (lsp-enable-which-key-integration t)) #+end_src **** Languages ***** Typescript @@ -384,6 +399,22 @@ make sure to setup authinfo :mode "\\.js\\'" :hook (js2-mode . lsp-deferred)) #+end_src +*** Company Mode (Better Autocompletion) +#+begin_src emacs-lisp +(use-package company + :after lsp-mode + :hook (lsp-mode . company-mode) + :bind (:map company-active-map + ("" . company-complete-selection)) + (:map lsp-mode-map + ("" . company-indent-or-complete-common)) + :custom + (company-minimum-prefix-length 1) + (company-idle-delay 0.0)) + +(use-package company-box + :hook (company-mode . company-box-mode)) +#+end_src * Org Mode Configuration Setup ** Babel Languages #+begin_src emacs-lisp diff --git a/config/emacs/init.el b/config/emacs/init.el index 756e7470..6e746a57 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -88,7 +88,7 @@ (setq doom-themes-enable-bold t ; if nil, bold is universally disabled doom-themes-enable-italic t) ; if nil, italics is universally disabled ;; load the theme -(load-theme 'doom-monokai-pro t) +(load-theme 'doom-challenger-deep t) ;; Enable flashing mode-line on errors (doom-themes-visual-bell-config)) @@ -306,8 +306,21 @@ :after magit) (setq auth-sources '("~/.authinfo")) +(defun efs/lsp-mode-setup () +(setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) +(lsp-headerline-breadcrumb-mode)) + +:hook (lsp-mode . efs/lsp-mode-setup) + +(defun sakomacs/lsp-mode-setup () +(setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) +(lsp-headerline-breadcrumb-mode)) + +:hook (lsp-mode . sakomacs/lsp-mode-setup) + (use-package lsp-mode :commands (lsp lsp-deferred) + :hook (lsp-mode . sakomacs/lsp-mode-setup) :init (setq lsp-keymap-prefix "C-c l") :config @@ -317,6 +330,20 @@ :mode "\\.js\\'" :hook (js2-mode . lsp-deferred)) +(use-package company + :after lsp-mode + :hook (lsp-mode . company-mode) + :bind (:map company-active-map + ("" . company-complete-selection)) + (:map lsp-mode-map + ("" . company-indent-or-complete-common)) + :custom + (company-minimum-prefix-length 1) + (company-idle-delay 0.0)) + +(use-package company-box + :hook (company-mode . company-box-mode)) + (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t)