From cd734d9a27b28ae2ba68ca5acf945c9bc1b94b1d Mon Sep 17 00:00:00 2001 From: Steph Enders Date: Fri, 31 Mar 2023 10:40:22 -0400 Subject: Install lsp packages for IDE support Now I have an IDE!!! Look at: https://emacs-lsp.github.io/lsp-mode/ for information and such - will contain the necessary out-links to anything else I'll need :) --- .emacs.d/init.el | 15 +++++++++------ .emacs.d/packages.el | 7 ++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 116ff79..5192c51 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,7 +1,7 @@ -;; load plugins +;; load any plugins / call boostrapping code (straight) (when (file-exists-p "~/.emacs.d/plugins.el") (load "~/.emacs.d/plugins.el")) - +;; install packages (when (file-exists-p "~/.emacs.d/packages.el") (load "~/.emacs.d/packages.el")) @@ -17,13 +17,16 @@ (setq inhibit-startup-screen t) ;; Mode hooks ;;; show line numbers -;;; (global-display-line-numbers) ; we can set this if we find we want it for all buffers (add-hook 'prog-mode-hook (lambda () (display-line-numbers-mode) - (visual-line-mode) - (visual-fill-column-mode))) + (visual-line-mode))) (add-hook 'text-mode-hook (lambda () (display-line-numbers-mode) (visual-line-mode) (visual-fill-column-mode))) +;; lsp-hooks +(add-hook 'c++-mode-hook (lambda () (lsp)(company-mode)(yas-minor-mode))) +(add-hook 'python-mode-hook (lambda () (lsp)(comapny-mode))) +(add-hook 'java-mode-hook (lambda () (lsp)(comapny-mode))) +(add-hook 'c-mode-hook (lambda () (lsp)(company-mode))) ;; Idiomdrottning and bad-emacs-defaults fixes (global-set-key [(control h)] 'delete-backward-char) @@ -54,4 +57,4 @@ (global-set-key "\C-cl" 'use-light-theme) (global-set-key "\C-cd" 'use-dark-theme) - +(setq lsp-keymap-prefix "C-s-l") diff --git a/.emacs.d/packages.el b/.emacs.d/packages.el index a625f5b..04b7eea 100644 --- a/.emacs.d/packages.el +++ b/.emacs.d/packages.el @@ -1,8 +1,13 @@ +;; file of desired packages +;; for easier evaluation and reading (straight-use-package 'org) (straight-use-package 'elpher) (straight-use-package 'visual-fill-column) (straight-use-package 'markdown-mode) - +(straight-use-package 'lsp-mode) +(straight-use-package 'company) +(straight-use-package 'flycheck) +(straight-use-package 'yasnippet) ;; custom recipes (straight-use-package '(moe-theme :host github :repo "kuanyui/moe-theme.el" -- cgit v1.2.3-54-g00ecf