use-package

Summary:
shrug

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
This commit is contained in:
doty 2018-04-30 06:16:38 -07:00
parent 8e76aa51e2
commit 766d75cdb7

View file

@ -271,6 +271,20 @@
(add-hook 'text-mode-hook 'my-text-mode-hook) (add-hook 'text-mode-hook 'my-text-mode-hook)
;; =================================================================
;; LSP-mode. Common configuration for LSP-based systems.
;; =================================================================
(use-package lsp-mode
:ensure
:init
(use-package company-lsp
:ensure
:init (add-to-list 'company-backends 'company-lsp))
(use-package lsp-ui
:ensure
:init (add-hook 'lsp-mode-hook 'lsp-ui-mode)))
;; ================================================================= ;; =================================================================
;; CC-Mode configuration. Stuff that makes working in IDL, C, and ;; CC-Mode configuration. Stuff that makes working in IDL, C, and
;; C++ a whole lot more tolerable. ;; C++ a whole lot more tolerable.
@ -444,22 +458,19 @@
:ensure :ensure
:if :if
(file-exists-p "/bin/cquery") (file-exists-p "/bin/cquery")
:bind :bind
("M-." . xref-find-definitions) ("M-." . xref-find-definitions)
:preface :preface
(defun cquery//enable () (defun cquery//enable ()
(condition-case nil (condition-case nil
(lsp-cquery-enable) (lsp-cquery-enable)
(user-error nil))) (user-error nil)))
:init :init
(use-package lsp-mode :ensure)
(use-package company-lsp
:ensure
:config (add-to-list 'company-backends 'company-lsp))
(use-package lsp-ui
:ensure
:init (add-hook 'lsp-mode-hook 'lsp-ui-mode))
(add-hook 'c-mode-common-hook #'cquery//enable) (add-hook 'c-mode-common-hook #'cquery//enable)
:config :config
(setq (setq
cquery-executable "/bin/cquery" cquery-executable "/bin/cquery"
@ -472,49 +483,44 @@
;; ================================================================= ;; =================================================================
;; C#-Mode configuration. ;; C#-Mode configuration.
;; ================================================================= ;; =================================================================
(use-package csharp-mode
;; zbrad's csharp mode is integrated with cc-mode. :preface
;; (autoload 'csharp-mode "cc-mode") (defun my-csharp-mode-hook ()
"My C# mode hook."
(turn-on-font-lock)
(omnisharp-mode)
(c-set-style "ms-csharp"))
;; Here is another one that is not. :mode "\\.cs\\'"
;;(autoload 'csharp-mode "csharp-mode-0.8.6" "Major mode for editing C# code." t)
;; We're using the one loaded by the package manager, though. :init
(add-hook 'csharp-mode-hook 'my-csharp-mode-hook)
(eval-after-load 'company '(add-to-list 'company-backends 'company-omnisharp))
(c-add-style "ms-csharp" :config
'((c-basic-offset . 4) (c-add-style "ms-csharp"
(c-comment-only-line-offset . (0 . 0)) '((c-basic-offset . 4)
(c-offsets-alist . ((c . c-lineup-C-comments) (c-comment-only-line-offset . (0 . 0))
(inclass . +) (c-offsets-alist . ((c . c-lineup-C-comments)
(namespace-open . 0) (inclass . +)
(namespace-close . 0) (namespace-open . 0)
(innamespace . +) (namespace-close . 0)
(class-open . 0) (innamespace . +)
(class-close . 0) (class-open . 0)
(defun-open . 0) (class-close . 0)
(defun-close . 0) (defun-open . 0)
(defun-block-intro . +) (defun-close . 0)
(inline-open . 0) (defun-block-intro . +)
(statement-block-intro . +) (inline-open . 0)
(brace-list-intro . +) (statement-block-intro . +)
(block-open . -) (brace-list-intro . +)
(substatement-open . 0) (block-open . -)
(arglist-intro . +) (substatement-open . 0)
(arglist-close . 0) (arglist-intro . +)
)))) (arglist-close . 0)
)))))
(defun my-csharp-mode-hook ()
"My C# mode hook."
(turn-on-font-lock)
(omnisharp-mode)
(c-set-style "ms-csharp"))
(add-hook 'csharp-mode-hook 'my-csharp-mode-hook)
(add-to-list 'auto-mode-alist '("\\.cool$" . csharp-mode))
(add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
(eval-after-load 'company '(add-to-list 'company-backends 'company-omnisharp))
;; ================================================================= ;; =================================================================