Skip to content

Commit

Permalink
Fix compatibility issue between ccls and aggressive-indent.
Browse files Browse the repository at this point in the history
Close #161.
See emacs-lsp/emacs-ccls#30.

1. Disable lsp-enable-indent.
2. Disable lsp-enable-on-type-formatting.
  • Loading branch information
seagle0128 committed Feb 18, 2020
1 parent 35e6b3e commit 6835940
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lisp/init-c.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
:ensure nil
:bind (:map c-mode-base-map
("C-c c" . compile))
:hook (c-mode-common . (lambda () (c-set-style "bsd")))
:hook (c-mode-common . (lambda () (c-set-style "stroustrup")))
:init (setq-default c-basic-offset 4)
:config
(use-package modern-cpp-font-lock
Expand Down
4 changes: 2 additions & 2 deletions lisp/init-company.el
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
:bind (("M-/" . company-complete)
("C-M-i" . company-complete)
:map company-active-map
;; ("C-p" . company-select-previous)
;; ("C-n" . company-select-next)
("C-p" . company-select-previous)
("C-n" . company-select-next)
("<tab>" . company-complete-common-or-cycle)
("<backtab>" . my-company-yasnippet)
:map company-search-map
Expand Down
1 change: 0 additions & 1 deletion lisp/init-ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
("C-c h" . counsel-command-history)
("C-c i" . counsel-git)
("C-c j" . counsel-git-grep)
("C-c l" . counsel-locate)
("C-c o" . counsel-outline)
("C-c r" . counsel-rg)
("C-c z" . counsel-fzf)
Expand Down
10 changes: 7 additions & 3 deletions lisp/init-lsp.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@
(lsp-enable-which-key-integration)

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

(setq lsp-auto-guess-root t ; Detect project root
lsp-keep-workspace-alive nil) ; Auto-kill LSP server
lsp-keep-workspace-alive nil ; Auto-kill LSP server
lsp-enable-indentation nil
lsp-enable-on-type-formatting nil
lsp-keymap-prefix "C-c l")

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

0 comments on commit 6835940

Please sign in to comment.