From 6e2fb64ec837837c26af619de495a05966c027c5 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Tue, 13 Nov 2018 23:32:06 +0100 Subject: [PATCH 01/10] lsp-experiment: - call lsp-clangd-enable + flycheck-mode to have IDE like stuff --- config.org | 78 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 20 deletions(-) diff --git a/config.org b/config.org index 607d860..f431fec 100644 --- a/config.org +++ b/config.org @@ -869,6 +869,43 @@ On-the-fly syntax checking. (add-hook 'prog-mode-hook 'company-mode) #+END_SRC +** LSP + +#+BEGIN_SRC emacs-lisp +(use-package company-lsp + :ensure t + :config + (require 'company-lsp) + (push 'company-lsp company-backends) + (add-hook 'after-init-hook 'global-company-mode) +) + +(use-package lsp-mode + :ensure t + :config + (add-hook 'prog-mode-hook lsp-mode) +) + + (use-package lsp-ui + :ensure t + :config + (require 'lsp-mode) + (add-hook 'lsp-mode-hook 'lsp-ui-mode) +) + +(use-package lsp-clangd + :ensure t + :config + (add-hook 'c-mode-hook #'lsp-clangd-c-enable) + (lsp-define-stdio-client lsp-clangd-c + "c" + #'projectile-project-root + '("/usr/bin/clangd")) + (add-hook 'c-mode-hook 'lsp-clangd-c-enable) +) + +#+END_SRC + ** (Relative) Line numbers #+BEGIN_SRC emacs-lisp @@ -896,12 +933,12 @@ https://github.com/Sarcasm/flycheck-irony (require 'flycheck-clang-analyzer) (flycheck-clang-analyzer-setup))) -(use-package flycheck-irony - :ensure t - :config - (eval-after-load 'flycheck - '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)) -) +;; (use-package flycheck-irony +;; :ensure t +;; :config +;; (eval-after-load 'flycheck +;; '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)) +;; ) #+END_SRC *** Company @@ -912,21 +949,21 @@ https://github.com/ikirill/irony-eldoc (use-package company-c-headers :ensure t) -(use-package company-irony - :ensure t - :config - (setq company-backends '((company-c-headers -;; company-dabbrev-code ;; not sure what this is - company-irony)))) +;; (use-package company-irony +;; :ensure t +;; :config +;; (setq company-backends '((company-c-headers +;; ;; company-dabbrev-code ;; not sure what this is +;; company-irony)))) -(use-package irony - :ensure t - :config - (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) - (add-hook 'c++-mode-hook 'irony-mode) - (add-hook 'c-mode-hook 'irony-mode) - (add-hook 'objc-mode-hook 'irony-mode) -) +;; (use-package irony +;; :ensure t +;; :config +;; (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) +;; (add-hook 'c++-mode-hook 'irony-mode) +;; (add-hook 'c-mode-hook 'irony-mode) +;; (add-hook 'objc-mode-hook 'irony-mode) +;; ) (use-package irony-eldoc :ensure t @@ -1257,6 +1294,7 @@ https://github.com/Malabarba/paradox :config (paradox-enable) ) + #+END_SRC * EXWM From fb94a22ec9cba5bf6daa42c47d2c3ae58713fb7c Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Tue, 20 Nov 2018 22:29:50 +0100 Subject: [PATCH 02/10] working lsp with clangd --- config.org | 86 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 17 deletions(-) diff --git a/config.org b/config.org index f431fec..37122b9 100644 --- a/config.org +++ b/config.org @@ -872,40 +872,92 @@ On-the-fly syntax checking. ** LSP #+BEGIN_SRC emacs-lisp +;; (use-package company-lsp +;; :ensure t +;; :config +;; (push 'company-lsp company-backends) +;; (add-hook 'after-init-hook 'global-company-mode) +;; ) + +;; (use-package lsp-mode +;; :ensure t +;; :config +;; (add-hook 'prog-mode-hook lsp-mode) +;; ) + +;; (use-package lsp-ui +;; :ensure t +;; :config +;; (require 'lsp-mode) +;; (add-hook 'lsp-mode-hook 'lsp-ui-mode) +;; ) + +;; (defun cquery//enable () +;; (condition-case nil +;; (lsp-cquery-enable) +;; (user-error nil))) + +;; (use-package cquery +;; :init +;; (setq cquery-executable "/usr/bin/cquery") +;; (add-hook 'c-mode-hook #'cquery//enable) +;; (add-hook 'c++-mode-hook #'cquery//enable)) + +;; (use-package ccls +;; :ensure t +;; :init +;; (setq ccls-executable "/usr/bin/ccls") +;; ) + +;; (use-package eglot +;; :ensure t +;; :config +;; (add-hook 'c-mode-hook 'eglot-ensure) +;; ) + +;; (use-package lsp-mode +;; :ensure t +;; :preface (setq lsp-enable-flycheck nil +;; lsp-enable-indentation nil +;; lsp-highlight-symbol-at-point nil) +;; ) + +(use-package lsp-ui + :ensure t + :init (add-hook 'lsp-after-open-hook #'lsp-ui-mode) + :config + (setq lsp-ui-doc-enable t + lsp-ui-doc-header t + lsp-ui-doc-include-signature t + ;; lsp-ui-doc-position 'at-point + ) + ) + (use-package company-lsp :ensure t :config - (require 'company-lsp) (push 'company-lsp company-backends) - (add-hook 'after-init-hook 'global-company-mode) -) - -(use-package lsp-mode - :ensure t - :config - (add-hook 'prog-mode-hook lsp-mode) -) - - (use-package lsp-ui - :ensure t - :config - (require 'lsp-mode) - (add-hook 'lsp-mode-hook 'lsp-ui-mode) + (setq company-lsp-enable-recompletion t + company-lsp-enable-snippet t + company-lsp-cache-candidates t + company-lsp-async t) ) (use-package lsp-clangd :ensure t :config - (add-hook 'c-mode-hook #'lsp-clangd-c-enable) (lsp-define-stdio-client lsp-clangd-c "c" #'projectile-project-root '("/usr/bin/clangd")) - (add-hook 'c-mode-hook 'lsp-clangd-c-enable) + (add-hook 'c-mode-hook #'lsp-clangd-c-enable) ) #+END_SRC +#+RESULTS: +: t + ** (Relative) Line numbers #+BEGIN_SRC emacs-lisp From 57c09274482cf39c1b7d04a1ffb6d6e2e9ffe709 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Tue, 20 Nov 2018 22:48:54 +0100 Subject: [PATCH 03/10] working lsp with cquery --- config.org | 63 ++++++++++-------------------------------------------- 1 file changed, 11 insertions(+), 52 deletions(-) diff --git a/config.org b/config.org index 37122b9..818f70c 100644 --- a/config.org +++ b/config.org @@ -872,36 +872,18 @@ On-the-fly syntax checking. ** LSP #+BEGIN_SRC emacs-lisp -;; (use-package company-lsp -;; :ensure t -;; :config -;; (push 'company-lsp company-backends) -;; (add-hook 'after-init-hook 'global-company-mode) -;; ) +(defun cquery//enable () + (condition-case nil + (lsp-cquery-enable) + (user-error nil))) -;; (use-package lsp-mode -;; :ensure t -;; :config -;; (add-hook 'prog-mode-hook lsp-mode) -;; ) - -;; (use-package lsp-ui -;; :ensure t -;; :config -;; (require 'lsp-mode) -;; (add-hook 'lsp-mode-hook 'lsp-ui-mode) -;; ) - -;; (defun cquery//enable () -;; (condition-case nil -;; (lsp-cquery-enable) -;; (user-error nil))) - -;; (use-package cquery -;; :init -;; (setq cquery-executable "/usr/bin/cquery") -;; (add-hook 'c-mode-hook #'cquery//enable) -;; (add-hook 'c++-mode-hook #'cquery//enable)) +(use-package cquery + :ensure t + :init + (setq cquery-executable "/usr/bin/cquery") + (add-hook 'c-mode-hook #'cquery//enable) + (add-hook 'c++-mode-hook #'cquery//enable) +) ;; (use-package ccls ;; :ensure t @@ -909,19 +891,6 @@ On-the-fly syntax checking. ;; (setq ccls-executable "/usr/bin/ccls") ;; ) -;; (use-package eglot -;; :ensure t -;; :config -;; (add-hook 'c-mode-hook 'eglot-ensure) -;; ) - -;; (use-package lsp-mode -;; :ensure t -;; :preface (setq lsp-enable-flycheck nil -;; lsp-enable-indentation nil -;; lsp-highlight-symbol-at-point nil) -;; ) - (use-package lsp-ui :ensure t :init (add-hook 'lsp-after-open-hook #'lsp-ui-mode) @@ -943,16 +912,6 @@ On-the-fly syntax checking. company-lsp-async t) ) -(use-package lsp-clangd - :ensure t - :config - (lsp-define-stdio-client lsp-clangd-c - "c" - #'projectile-project-root - '("/usr/bin/clangd")) - (add-hook 'c-mode-hook #'lsp-clangd-c-enable) -) - #+END_SRC #+RESULTS: From 348b36dafd6752043b2e4fd0c88c9b2136e298b4 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Tue, 20 Nov 2018 23:12:52 +0100 Subject: [PATCH 04/10] Cleanup --- config.org | 78 ++++++++---------------------------------------------- 1 file changed, 11 insertions(+), 67 deletions(-) diff --git a/config.org b/config.org index 818f70c..f173587 100644 --- a/config.org +++ b/config.org @@ -15,15 +15,12 @@ My personal emacs configuration This configuration requires the installation of : - the GNU =global= package (for gtags) - - =clang= (for ivory) - - =cmake= (for ivory) + - ccls language server (for LSP functionality) - =llvm-libs= (for cmake, somehow not a dependency on Manjaro when installing cmake) - Use python-pip to install requirements for elpy: =pip install jedi flake8 importmagic autopep8 yapf= - =ditaa= (for ascii to image generation in org-mode) -When first checking out this config, run =irony-install-server= to make and install the irony-server. - * Utils ** Custom command line arguments @@ -871,26 +868,20 @@ On-the-fly syntax checking. ** LSP -#+BEGIN_SRC emacs-lisp -(defun cquery//enable () - (condition-case nil - (lsp-cquery-enable) - (user-error nil))) +Just awesome IDE features: +https://github.com/MaskRay/ccls +https://github.com/MaskRay/emacs-ccls +https://github.com/emacs-lsp/lsp-mode +https://github.com/emacs-lsp/lsp-ui +https://github.com/tigersoldier/company-lsp -(use-package cquery +#+BEGIN_SRC emacs-lisp +(use-package ccls :ensure t :init - (setq cquery-executable "/usr/bin/cquery") - (add-hook 'c-mode-hook #'cquery//enable) - (add-hook 'c++-mode-hook #'cquery//enable) + (setq ccls-executable "/usr/bin/ccls") ) -;; (use-package ccls -;; :ensure t -;; :init -;; (setq ccls-executable "/usr/bin/ccls") -;; ) - (use-package lsp-ui :ensure t :init (add-hook 'lsp-after-open-hook #'lsp-ui-mode) @@ -911,12 +902,8 @@ On-the-fly syntax checking. company-lsp-cache-candidates t company-lsp-async t) ) - #+END_SRC -#+RESULTS: -: t - ** (Relative) Line numbers #+BEGIN_SRC emacs-lisp @@ -931,56 +918,13 @@ On-the-fly syntax checking. *** Flycheck -Clang static analyzer with flycheck - -https://github.com/alexmurray/flycheck-clang-analyzer -https://github.com/Sarcasm/flycheck-irony - -#+BEGIN_SRC emacs-lisp -(use-package flycheck-clang-analyzer - :ensure t - :config - (with-eval-after-load 'flycheck - (require 'flycheck-clang-analyzer) - (flycheck-clang-analyzer-setup))) - -;; (use-package flycheck-irony -;; :ensure t -;; :config -;; (eval-after-load 'flycheck -;; '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)) -;; ) -#+END_SRC +Functionality provided by LSP and flycheck combination. *** Company -https://github.com/ikirill/irony-eldoc - #+BEGIN_SRC emacs-lisp (use-package company-c-headers :ensure t) - -;; (use-package company-irony -;; :ensure t -;; :config -;; (setq company-backends '((company-c-headers -;; ;; company-dabbrev-code ;; not sure what this is -;; company-irony)))) - -;; (use-package irony -;; :ensure t -;; :config -;; (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) -;; (add-hook 'c++-mode-hook 'irony-mode) -;; (add-hook 'c-mode-hook 'irony-mode) -;; (add-hook 'objc-mode-hook 'irony-mode) -;; ) - -(use-package irony-eldoc - :ensure t - :config - (add-hook 'irony-mode-hook 'irony-eldoc) -) #+END_SRC ** Python mode From e411693eb06d372bd66881d5aabf73a133ce02ea Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Tue, 20 Nov 2018 23:19:39 +0100 Subject: [PATCH 05/10] Enable ccls for c-mode --- config.org | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config.org b/config.org index f173587..d86c3f5 100644 --- a/config.org +++ b/config.org @@ -876,10 +876,15 @@ https://github.com/emacs-lsp/lsp-ui https://github.com/tigersoldier/company-lsp #+BEGIN_SRC emacs-lisp +(defun +ccls/enable () + (condition-case nil + (lsp-ccls-enable) + (user-error nil))) + (use-package ccls - :ensure t + :commands lsp-ccls-enable :init - (setq ccls-executable "/usr/bin/ccls") + (add-hook 'c-mode-hook #'+ccls/enable) ) (use-package lsp-ui From 5559316d09504369c0cadc3539091bda3b28dbb0 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Wed, 21 Nov 2018 11:07:21 +0100 Subject: [PATCH 06/10] Ensure ccls package is installed --- config.org | 1 + 1 file changed, 1 insertion(+) diff --git a/config.org b/config.org index d86c3f5..cbf5baa 100644 --- a/config.org +++ b/config.org @@ -882,6 +882,7 @@ https://github.com/tigersoldier/company-lsp (user-error nil))) (use-package ccls + :ensure t :commands lsp-ccls-enable :init (add-hook 'c-mode-hook #'+ccls/enable) From 593de2293df36d7068ee11d306a4cce97053f368 Mon Sep 17 00:00:00 2001 From: laurensmiers Date: Thu, 21 Mar 2019 15:34:05 +0100 Subject: [PATCH 07/10] ensure eglot package + add prog-mode-hook - TODO: don't add it to prog-mode-hook, add it to c-mode-hook and others supporting LSP --- config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.org b/config.org index cbf5baa..549846e 100644 --- a/config.org +++ b/config.org @@ -874,6 +874,7 @@ https://github.com/MaskRay/emacs-ccls https://github.com/emacs-lsp/lsp-mode https://github.com/emacs-lsp/lsp-ui https://github.com/tigersoldier/company-lsp +https://github.com/joaotavora/eglot #+BEGIN_SRC emacs-lisp (defun +ccls/enable () @@ -908,6 +909,12 @@ https://github.com/tigersoldier/company-lsp company-lsp-cache-candidates t company-lsp-async t) ) + +(use-package eglot + :ensure t + :init + (add-hook 'prog-mode-hook 'eglot-ensure) +) #+END_SRC ** (Relative) Line numbers From 71b5e34a9e299e471bfdf03753013df4c4a21ca4 Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 9 May 2019 16:53:50 +0200 Subject: [PATCH 08/10] Add Multi-term and Helm-mt --- config.org | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/config.org b/config.org index 549846e..6a19379 100644 --- a/config.org +++ b/config.org @@ -757,6 +757,20 @@ https://github.com/bbatsov/helm-projectile ) #+END_SRC +** Helm-mt + +Helm frontend for [[Multi-term]] +https://github.com/dfdeshom/helm-mt + +#+BEGIN_SRC emacs-lisp +(use-package multi-term + :ensure t + :bind (("C-x t") . helm-mt) + :config + (helm-mt/reroute-terminal-functions t) +) +#+END_SRC + * Mutliple cursors https://github.com/magnars/multiple-cursors.el @@ -1195,6 +1209,20 @@ https://github.com/myrjola/diminish.el ) #+END_SRC +* Shell +** Multi-term +<> + +Manage multiple terminals. + +https://www.emacswiki.org/emacs/MultiTerm + +#+BEGIN_SRC emacs-lisp +(use-package multi-term + :ensure t +) +#+END_SRC + * Shell-pop https://github.com/kyagi/shell-pop-el From 5792beb9eea70aaa60d13fa068a7201dc5b9726d Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 9 May 2019 17:18:06 +0200 Subject: [PATCH 09/10] Remove helm-mt for now --- config.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.org b/config.org index 6a19379..1f6ae3e 100644 --- a/config.org +++ b/config.org @@ -763,12 +763,12 @@ Helm frontend for [[Multi-term]] https://github.com/dfdeshom/helm-mt #+BEGIN_SRC emacs-lisp -(use-package multi-term - :ensure t - :bind (("C-x t") . helm-mt) - :config - (helm-mt/reroute-terminal-functions t) -) +;; (use-package helm-mt +;; :ensure t +;; :bind (("C-x t") . helm-mt) +;; :config +;; (helm-mt/reroute-terminal-functions t) +;; ) #+END_SRC * Mutliple cursors From 6c169b230e757003e61fa199cdfc1c4a4c12b200 Mon Sep 17 00:00:00 2001 From: Laurens Miers Date: Thu, 9 May 2019 17:23:48 +0200 Subject: [PATCH 10/10] Re-add helm-mt --- config.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config.org b/config.org index 1f6ae3e..fb7ef3d 100644 --- a/config.org +++ b/config.org @@ -763,12 +763,12 @@ Helm frontend for [[Multi-term]] https://github.com/dfdeshom/helm-mt #+BEGIN_SRC emacs-lisp -;; (use-package helm-mt -;; :ensure t -;; :bind (("C-x t") . helm-mt) -;; :config -;; (helm-mt/reroute-terminal-functions t) -;; ) +(use-package helm-mt + :ensure t + :bind ("C-x t" . helm-mt) + :config + (helm-mt/reroute-terminal-functions t) +) #+END_SRC * Mutliple cursors