From 3e0c92fd94a816e7824bbce1f4bcb708579c70e5 Mon Sep 17 00:00:00 2001 From: jgart Date: Wed, 5 Oct 2022 17:14:16 -0500 Subject: [PATCH] Add lsp-mode --- evil-collection.el | 1 + modes/lsp-mode/evil-collection-lsp-mode.el | 46 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 modes/lsp-mode/evil-collection-lsp-mode.el diff --git a/evil-collection.el b/evil-collection.el index e2a6372..1794a97 100644 --- a/evil-collection.el +++ b/evil-collection.el @@ -237,6 +237,7 @@ See `evil-collection-init' and `evil-collection--modes-with-delayed-setup'." lispy log-edit log-view + lsp-mode lsp-ui-imenu lua-mode kotlin-mode diff --git a/modes/lsp-mode/evil-collection-lsp-mode.el b/modes/lsp-mode/evil-collection-lsp-mode.el new file mode 100644 index 0000000..77a5162 --- /dev/null +++ b/modes/lsp-mode/evil-collection-lsp-mode.el @@ -0,0 +1,46 @@ +;;; evil-collection-lsp-mode.el --- Bindings for `lsp-mode' -*- lexical-binding: t -*- + +;; Copyright (C) 2018 James Nguyen + +;; Author: James Nguyen +;; Maintainer: jgart +;; URL: https://github.com/emacs-evil/evil-collection +;; Version: 0.0.1 +;; Package-Requires: ((emacs "26.3")) +;; Keywords: evil, lsp-mode, tools + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;;; Bindings for `lsp-mode'. + +;;; Code: +(require 'lsp-mode nil t) +(require 'evil-collection) + +(defconst evil-collection-lsp-mode-maps '(lsp-mode-map)) + +;;;###autoload +(defun evil-collection-lsp-mode-setup () + "Set up `evil' bindings for `lsp-mode'." + (evil-collection-define-key 'normal 'lsp-mode-map + "gd" 'xref-find-definitions + (kbd "C-t") 'xref-pop-marker-stack) + + (when evil-collection-want-find-usages-bindings + (evil-collection-define-key 'normal 'lsp-mode-map + "gr" 'xref-find-references))) + +(provide 'evil-collection-lsp-mode) +;;; evil-collection-lsp-mode.el ends here