unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Question Regarding Indenting With 'LSP Mode' Vs 'aggressive-indent' On Mac OS Using Emacs
@ 2022-03-09 20:47 Samuel Banya
  0 siblings, 0 replies; only message in thread
From: Samuel Banya @ 2022-03-09 20:47 UTC (permalink / raw)
  To: Emanuel Berg

Hey there,

LSP Mode works great.

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

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:
    ;; 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 '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))
    :custom
    (company-minimum-prefix-length 1)
    (company-idle-delay 0.0))
#+end_src
*** Add 'flycheck' for programming syntax checking on-the-fly
#+BEGIN_SRC emacs-lisp
  (use-package flycheck
    :ensure t
    :init
    (global-flycheck-mode t))
#+END_SRC`
`*** Add 'aggressive-indent' to allow to easier indentation for code
#+BEGIN_SRC emacs-lisp
  (use-package aggressive-indent
    :ensure t
    :config
    (global-aggressive-indent-mode 1))
#+END_SRC`
*
*
*CONTINUED:*
 * This was taken from here:
 * https://git.musimatic.xyz/dotfiles/tree/emacs/.emacs.d/configuration.org

Thanks!


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-09 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-09 20:47 Question Regarding Indenting With 'LSP Mode' Vs 'aggressive-indent' On Mac OS Using Emacs Samuel Banya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).