From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Samuel Banya" Newsgroups: gmane.emacs.help Subject: Looking For Any Emacs Config Examples That Has LSP Mode With 'aggressive-indent' Mode Date: Thu, 28 Apr 2022 12:46:59 -0400 Message-ID: <6f6d11c1-d2f0-48b8-992b-5687804132ea@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20102"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.7.0-alpha0-591-gfe6c3a2700-fm-20220427.001-gfe6c3a27 To: "Emanuel Berg" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 28 18:47:49 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nk7Iz-000532-4u for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Apr 2022 18:47:49 +0200 Original-Received: from localhost ([::1]:52010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nk7Ix-0005yY-Td for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Apr 2022 12:47:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk7IY-0005y6-4P for help-gnu-emacs@gnu.org; Thu, 28 Apr 2022 12:47:22 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nk7IW-0005yl-47 for help-gnu-emacs@gnu.org; Thu, 28 Apr 2022 12:47:21 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 828275C00E0 for ; Thu, 28 Apr 2022 12:47:19 -0400 (EDT) Original-Received: from imap50 ([10.202.2.100]) by compute5.internal (MEProxy); Thu, 28 Apr 2022 12:47:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t= 1651164439; x=1651250839; bh=h7rNMdP2BAR0pS9W+J9ktNf7T6U8nNMltze lYYWujhQ=; b=WYNEVn6KwGxj5JY3Xj48d656ErI3k1mkn8RL7/XKXVY1qEZ+NEq Bg27WFcTtTLM6WkTJFiyAF86pZw5xpWQ/1GpUqRl+K953X4vdCrUO/inSa43ffQ4 yG7oediT1fmepT6iV3X/6Ng9E0e2YhhBALglZ8PQAD1Ev0qX77bhH0gf7qimpPah 5ugHtB/V3/vMnaJcSl7sykH5BPrT+DHG411ke7en5/UH3iiNjR8bOvfg5Asy+zQM 0EcRpoRIkcwTpZZw5jwxMoAIbAGJszZO+jYb7qLTflIKcF476FonKsXLp9B4tAqF 04pxbVGAWe5IrPay8b0Ddd794zpnn+ZLJgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1651164439; x=1651250839; bh=h7rNMdP2BAR0p S9W+J9ktNf7T6U8nNMltzelYYWujhQ=; b=Iz/BCnhh3s3Lz282S46qL6j+0sEDL 5Ct3hswIm4urk+zeqciRyTA8rff3sxsTDrMFVcsilfacvwvkEyY06gw86YiyRfo0 i49YiH6NN5JLOk7OVwfg4x1R2YSsJxSkDM3/T8URat9KLpzIsZn+2hDHCe7Aspgt 2oVdViCDqINloSkmZFcnVRay+4PYgG3DvYyjeGWzBweqnkO6R16bE64p7Wm+onQb A6l9m5kG3XtfoQbUsKDUnThb2o0itCFNQBy52qsvipWI7Ck59Auo8TJ9kyw5zNNi DRf4/SlhkiPtl2hPoeDMdcbmhOnE/iznJdRU6tzdp2euDWk1VdwKhCvIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudejgddutdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsegrtderre erredtnecuhfhrohhmpedfufgrmhhuvghluceurghnhigrfdcuoehssggrnhihrgesfhgr shhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpeelgedvgeevudduiefgjedtve fftdffhfdtudevhffggfegjeejgedugfefgeejjeenucffohhmrghinhepghhithhhuhgs rdgtohhmpdihohhuthhusggvrdgtohhmpdhmrghtthguuhgtkhdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehssggrnhihrgesfhgr shhtmhgrihhlrdgtohhm X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id 638FD1920089; Thu, 28 Apr 2022 12:47:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Received-SPF: pass client-ip=66.111.4.29; envelope-from=sbanya@fastmail.com; helo=out5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137071 Archived-At: Hey there, I'm vamping up my Emacs config so that I can make it handle web dev related projects, specifically anything related to HTML, CSS, JS, Typescript, Python, Ruby, etc. However, I'm not having the best time with automatic indentation for Emacs so far, even after really trying to take some deep dives with my config and some of the 'System Crafters' based LSP mode based videos. I'm wondering if anyone could help me figure out why 'aggressive-indent' and 'LSP Mode' in my config just do not get along with each other, or could offer their config examples to help me figure out how to solve that issue. As much as I despise VS Code and how ironic it is that LSP wouldn't exist without VS Code, I do envy the fact that it 'just works' out of the box when it comes to this indentation stuff. Here's my Emacs config itself: https://github.com/SamuelBanya/dotfiles Here's my config snippets that contain LSP Mode and various web mode stuff: ``` *** Add 'lsp-mode' for better autocompletion for many programming languages (python, ruby, java, C++) #+begin_src emacs-lisp (defun ef/lsp-mode-setup () ;; Taken from this 'System Crafters' video: ;; https://www.youtube.com/watch?v=E-NAM9U5JYE ;; This allows breadcrumb segments to appear in projects (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) (lsp-headerline-breadcrumb-mode)) (use-package lsp-mode :ensure t :commands (lsp lsp-deferred) ;; Taken from this page: ;; https://www.mattduck.com/lsp-python-getting-started.html :init (setq lsp-keymap-prefix "C-c l") :config (lsp-enable-which-key-integration t) ;; Set 'lsp-idle-delay' to 0.5 seconds for quick autocompletion (setq lsp-idle-delay 0.5)) #+end_src *** Add 'typescript-mode' for Typescript support for 'lsp-mode' #+begin_src emacs-lisp (use-package typescript-mode :ensure t :mode ("\\.ts\\'" "\\.tsx\\'") :hook (typescript-mode . lsp-deferred) :config (setq typescript-indent-level 2)) #+end_src *** Add 'web-mode' for support for .html, .ejs, .tsx, and .jsx files #+begin_src emacs-lisp (use-package web-mode :mode "(\\.\\(html?\\|ejs\\|tsx\\|jsx\\)\\'" :config (setq-default web-mode-code-indent-offset 2) (setq-default web-mode-markup-indent-offset 2) (setq-default web-mode-attribute-indent-offset 2)) #+end_src ``` Thanks, Sam