From a45a7db579683c5bb45dc4546a24a6e9393c29a1 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 17 Mar 2019 18:11:53 +0100 Subject: [PATCH] Use ccls as C/C++ LSP --- init.el | 1 - modules/em-helm-gtags.el | 65 --------------------------------------- modules/em-programming.el | 22 +++++-------- 3 files changed, 8 insertions(+), 80 deletions(-) delete mode 100644 modules/em-helm-gtags.el diff --git a/init.el b/init.el index 3bd3cdb..ae09cc2 100644 --- a/init.el +++ b/init.el @@ -114,7 +114,6 @@ em-emacs em-files em-helm - em-helm-gtags em-modeline em-org em-parentheses diff --git a/modules/em-helm-gtags.el b/modules/em-helm-gtags.el deleted file mode 100644 index 91bed06..0000000 --- a/modules/em-helm-gtags.el +++ /dev/null @@ -1,65 +0,0 @@ -;;; em-helm-gtags.el --- Module file for GTAGS with Helm configuration. -;; -;; Copyright (C) 2017 Wojciech Kozlowski -;; -;; Author: Wojciech Kozlowski -;; Created: 2 Sep 2017 -;; -;; This file is not part of GNU Emacs. -;; -;;; Commentary: -;; -;; This module sets up configuration for using gtags with helm. -;; -;; To add gtags for system include paths: -;; -;; export GTAGSLIBPATH=$HOME/.gtags/ -;; -;; mkdir ~/.gtags -;; cd ~/.gtags -;; -;; ln -s /usr/include usr-include -;; ln -s /usr/local/include/ usr-local-include -;; -;; gtags -c -;; -;;; License: GPLv3 - -;;; Required packages: - -;;; Code: - -(defvar emodule/em-helm-gtags-packages - - '(helm-gtags) - - ) - -;;; Configuration: - -(defun emodule/em-helm-gtags-init () - "Initialise the `em-helm-gtags' module." - - (use-package helm-gtags - :hook - ((dired-mode eshell-mode c-mode c++-mode asm-mode-hook) . helm-gtags-mode) - :bind - (:map helm-gtags-mode-map - ("C-c g a" . helm-gtags-tags-in-this-function) - ("C-c g h" . helm-gtags-show-stack) - ("C-j" . helm-gtags-select) - ("M-." . helm-gtags-dwim) - ("M-," . helm-gtags-pop-stack) - ("C-c <" . helm-gtags-previous-history) - ("C-c >" . helm-gtags-next-history)) - :init - (setq helm-gtags-ignore-case t - helm-gtags-auto-update t - helm-gtags-use-input-at-cursor t - helm-gtags-pulse-at-cursor t - helm-gtags-prefix-key "\C-cg" - helm-gtags-suggested-key-mapping t)) - ) - -(provide 'em-helm-gtags) -;;; em-helm-gtags.el ends here diff --git a/modules/em-programming.el b/modules/em-programming.el index 17d614a..87733ad 100644 --- a/modules/em-programming.el +++ b/modules/em-programming.el @@ -21,6 +21,7 @@ (defvar emodule/em-programming-packages '(cargo + ccls company company-c-headers company-lsp @@ -67,9 +68,10 @@ (use-package lsp-ui :commands lsp-ui-mode :bind (("C-M-i" . lsp-ui-imenu)) - :config + :init (setq lsp-ui-doc-enable nil) - + (setq lsp-prefer-flymake nil) + :config (define-key lsp-ui-mode-map [remap xref-find-definitions] #'lsp-ui-peek-find-definitions) (define-key lsp-ui-mode-map @@ -316,23 +318,15 @@ (define-key yas-minor-mode-map (kbd "") 'yas-expand)) ;; -------------------------------------------------------------------------- - ;; Configure CEDET. + ;; Configure C/C++. ;; -------------------------------------------------------------------------- (use-package cc-mode :defer t) - ;; To add include paths for semantic to parse, add them to - ;; `semantic-add-system-include'. This includes any local system includes, - ;; such as those in `/usr/local/include'. - (use-package semantic - :config - (global-semanticdb-minor-mode 1) - (global-semantic-idle-scheduler-mode 1) - (semantic-mode 1) - - (use-package stickyfunc-enhance) - (add-to-list 'semantic-default-submodes 'global-semantic-stickyfunc-mode)) + (use-package ccls + :hook ((c-mode c++-mode objc-mode) . + (lambda () (require 'ccls) (lsp)))) ;; For this to work, need to specify project roots in the variable ;; `ede-cpp-root-project', e.g.