[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question Regarding Indenting With 'LSP Mode' Vs 'aggressive-indent' On M

From: Samuel Banya
Subject: Question Regarding Indenting With 'LSP Mode' Vs 'aggressive-indent' On Mac OS Using Emacs
Date: Wed, 09 Mar 2022 15:47:24 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-4778-g14fba9972e-fm-20220217.001-g14fba997

Hey there,

LSP Mode works great.

However, the indenting gets a bit weird at times and fights with 'aggressive 

I'm wondering if anyone could help me figure out how to get a better workflow 
that works.

I'm thinking that I might have to just disable aggressive indent, and enable 
LSP everywhere instead to allow it to take precedent.

My major issue is that the indenting gets super weird for any project that has 
LSP Mode enabled.

The one thing I thought of in terms of troubleshooting was to get a list of the 
modes that were enabled while in a TypeScript buffer for example.

*Related Modes Enabled:*
Enabled minor modes: Aggressive-Indent Async-Bytecomp-Package
Auto-Composition Auto-Compression Auto-Encryption Beacon Blink-Cursor
Column-Number Dap Dap-Auto-Configure Dap-Tooltip Dap-Ui
Dap-Ui-Controls Dap-Ui-Many-Windows Display-Time Electric-Indent
Electric-Pair Evil-Collection-Unimpaired File-Name-Shadow Flycheck
Font-Lock Global-Aggressive-Indent Global-Eldoc
Global-Evil-Collection-Unimpaired Global-Flycheck Global-Font-Lock
Global-Hungry-Delete Global-Subword Helm Hl-Line Hungry-Delete
Line-Number Mac-Mouse-Wheel Override-Global Rainbow Rainbow-Delimiters
Recentf Shell-Dirtrack Subword Tooltip Transient-Mark
Treemacs-Filewatch Treemacs-Follow Treemacs-Fringe-Indicator
Treemacs-Git Which-Key
*Here's my related config regarding LSP Mode:*
`*** 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:
    ;; This allows breadcrumb segments to appear in projects
    (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols))

  (use-package lsp-mode
    :ensure t
    :commands (lsp lsp-deferred)
    ;; Taken from this page:
    (setq lsp-keymap-prefix "C-c l")
    (lsp-enable-which-key-integration t)
    ;; Set 'lsp-idle-delay' to 0.5 seconds for quick autocompletion
    (setq lsp-idle-delay 0.5))

*** 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)
    (setq typescript-indent-level 2))
*** Add 'company' Mode for auto-completion in conjunction with 'lsp-mode'
#+begin_src emacs-lisp
  (use-package company
    :ensure t
    :after lsp-mode
    :hook (lsp-mode . company-mode)
    :bind (:map company-active-map
                ("<tab>" . company-complete-selection))
    (:map lsp-mode-map
          ("<tab>" . company-indent-or-complete-common))
    (company-minimum-prefix-length 1)
    (company-idle-delay 0.0))
*** Add 'flycheck' for programming syntax checking on-the-fly
#+BEGIN_SRC emacs-lisp
  (use-package flycheck
    :ensure t
    (global-flycheck-mode t))
`*** Add 'aggressive-indent' to allow to easier indentation for code
#+BEGIN_SRC emacs-lisp
  (use-package aggressive-indent
    :ensure t
    (global-aggressive-indent-mode 1))
 * This was taken from here:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]