From 324954eb5b4c8eb8f2dd78f042b67d60d7d53e62 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Mon, 19 Dec 2022 17:24:41 +0100 Subject: [PATCH] LSP stuff & gitignore for Emacs --- emacs/.config/emacs/.gitignore | 54 ++++++++++++++++++-- emacs/.config/emacs/init.el | 39 +++++++++++++- emacs/.config/emacs/projectile-bookmarks.eld | 1 - 3 files changed, 89 insertions(+), 5 deletions(-) delete mode 100644 emacs/.config/emacs/projectile-bookmarks.eld diff --git a/emacs/.config/emacs/.gitignore b/emacs/.config/emacs/.gitignore index a3aadb0..fb20d77 100644 --- a/emacs/.config/emacs/.gitignore +++ b/emacs/.config/emacs/.gitignore @@ -1,4 +1,52 @@ -elpa/ -auto-save-list/ -*\~ +# -*- mode: gitignore; -*- +*~ \#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + +# Cache etc +.cache/ +projectile-bookmarks.eld \ No newline at end of file diff --git a/emacs/.config/emacs/init.el b/emacs/.config/emacs/init.el index 634f619..4406834 100644 --- a/emacs/.config/emacs/init.el +++ b/emacs/.config/emacs/init.el @@ -38,7 +38,7 @@ '(custom-safe-themes '("7e377879cbd60c66b88e51fad480b3ab18d60847f31c435f15f5df18bdb18184" default)) '(package-selected-packages - '(treemacs-evil treemacs projectile doom-themes lsp-mode evil))) + '(go-mode rust-mode use-package treemacs-evil treemacs projectile doom-themes lsp-mode evil))) (custom-set-faces ;; custom-set-faces was added by Custom. @@ -47,5 +47,42 @@ ;; If there is more than one, they won't work right. ) +;; LSP +(require 'use-package) +(use-package lsp-mode + :hook ((c-mode ; clangd + c++-mode ; clangd + c-or-c++-mode ; clangd + java-mode ; eclipse-jdtls + js-mode ; ts-ls (tsserver wrapper) + js-jsx-mode ; ts-ls (tsserver wrapper) + typescript-mode ; ts-ls (tsserver wrapper) + python-mode ; pyright + web-mode ; ts-ls/HTML/CSS + haskell-mode ; haskell-language-server + lisp-mode ; + rust-mode ; + go-mode ; + ) . lsp-deferred) + :commands lsp + :config + (setq lsp-auto-guess-root t) + (setq lsp-log-io nil) + (setq lsp-restart 'auto-restart) + (setq lsp-enable-symbol-highlighting nil) + (setq lsp-enable-on-type-formatting nil) + (setq lsp-signature-auto-activate nil) + (setq lsp-signature-render-documentation nil) + (setq lsp-eldoc-hook nil) + (setq lsp-modeline-code-actions-enable nil) + (setq lsp-modeline-diagnostics-enable nil) + (setq lsp-headerline-breadcrumb-enable nil) + (setq lsp-semantic-tokens-enable nil) + (setq lsp-enable-folding nil) + (setq lsp-enable-imenu nil) + (setq lsp-enable-snippet nil) + (setq read-process-output-max (* 1024 1024)) ;; 1MB + (setq lsp-idle-delay 0.5)) + ;; Loading config stuff (load "$HOME/.config/emacs/config.el") diff --git a/emacs/.config/emacs/projectile-bookmarks.eld b/emacs/.config/emacs/projectile-bookmarks.eld deleted file mode 100644 index e57458b..0000000 --- a/emacs/.config/emacs/projectile-bookmarks.eld +++ /dev/null @@ -1 +0,0 @@ -("~/.dotfiles/") \ No newline at end of file