Skip to content

Commit 6835940

Browse files
committed
Fix compatibility issue between ccls and aggressive-indent.
Close #161. See emacs-lsp/emacs-ccls#30. 1. Disable lsp-enable-indent. 2. Disable lsp-enable-on-type-formatting.
1 parent 35e6b3e commit 6835940

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

lisp/init-c.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
:ensure nil
3939
:bind (:map c-mode-base-map
4040
("C-c c" . compile))
41-
:hook (c-mode-common . (lambda () (c-set-style "bsd")))
41+
:hook (c-mode-common . (lambda () (c-set-style "stroustrup")))
4242
:init (setq-default c-basic-offset 4)
4343
:config
4444
(use-package modern-cpp-font-lock

lisp/init-company.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
:bind (("M-/" . company-complete)
4141
("C-M-i" . company-complete)
4242
:map company-active-map
43-
;; ("C-p" . company-select-previous)
44-
;; ("C-n" . company-select-next)
43+
("C-p" . company-select-previous)
44+
("C-n" . company-select-next)
4545
("<tab>" . company-complete-common-or-cycle)
4646
("<backtab>" . my-company-yasnippet)
4747
:map company-search-map

lisp/init-ivy.el

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
("C-c h" . counsel-command-history)
6767
("C-c i" . counsel-git)
6868
("C-c j" . counsel-git-grep)
69-
("C-c l" . counsel-locate)
7069
("C-c o" . counsel-outline)
7170
("C-c r" . counsel-rg)
7271
("C-c z" . counsel-fzf)

lisp/init-lsp.el

+7-3
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@
5151
(lsp-enable-which-key-integration)
5252

5353
;; Format and organize imports
54-
(add-hook 'before-save-hook #'lsp-format-buffer t t)
55-
(add-hook 'before-save-hook #'lsp-organize-imports t t))))
54+
(unless (derived-mode-p 'c-mode 'c++-mode)
55+
(add-hook 'before-save-hook #'lsp-format-buffer t t)
56+
(add-hook 'before-save-hook #'lsp-organize-imports t t)))))
5657
:bind (:map lsp-mode-map
5758
("C-c C-d" . lsp-describe-thing-at-point)
5859
([remap xref-find-definitions] . lsp-find-definition)
@@ -62,7 +63,10 @@
6263
(setq read-process-output-max (* 1024 1024)) ;; 1MB
6364

6465
(setq lsp-auto-guess-root t ; Detect project root
65-
lsp-keep-workspace-alive nil) ; Auto-kill LSP server
66+
lsp-keep-workspace-alive nil ; Auto-kill LSP server
67+
lsp-enable-indentation nil
68+
lsp-enable-on-type-formatting nil
69+
lsp-keymap-prefix "C-c l")
6670

6771
;; For `lsp-clients'
6872
(setq lsp-clients-python-library-directories '("/usr/local/" "/usr/"))

0 commit comments

Comments
 (0)