<commit_before>;;; evil-collection-rtags.el --- Evil bindings for `rtags'. -*- lexical-binding: t -*-

;; Copyright (C) 2017 <NAME>

;; Author: <NAME> <<EMAIL>>
;; Maintainer: <NAME> <<EMAIL>>
;; <NAME> <<EMAIL>>
;; URL: https://github.com/jojojames/evil-collection
;; Version: 0.0.1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: evil, rtags, 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 <http://www.gnu.org/licenses/>.

;;; Commentary:
;;; Evil bindings for `rtags'.

;;; Code:
(require 'evil)
(require 'rtags nil t)

(defvar rtags-mode-map)
(defvar rtags-dependency-tree-mode-map)
(defvar rtags-references-tree-mode-map)
(defvar rtags-location-stack-visualize-mode-map)

(defun evil-collection-rtags-setup ()
  "Set up `evil' bindings for `rtags'."
  (evil-set-initial-state 'rtags-mode 'normal)
  (evil-set-initial-state 'rtags-dependency-tree-mode 'normal)
  (evil-set-initial-state 'rtags-references-tree-mode 'normal)
  (evil-set-initial-state 'rtags-location-stack-visualize-mode 'normal)

  (evil-define-key 'normal rtags-mode-map
    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
    (kbd "M-<return>") 'rtags-show-in-other-window
    (kbd "go") 'rtags-select-other-window
    (kbd "gO") 'rtags-show-in-other-window
    [mouse-1] 'rtags-select-other-window
    [mouse-2] 'rtags-select-other-window
    "s" 'rtags-show-in-other-window ; TODO: Remove this binding?

    "c" 'rtags-select-caller
    "C" 'rtags-select-caller-other-window
    "x" 'rtags-select-and-remove-rtags-buffer
    "q" 'rtags-call-bury-or-delete)

  (evil-define-key 'normal rtags-dependency-tree-mode-map
    (kbd "TAB") 'rtags-dependency-tree-toggle-current-expanded
    (kbd "E") 'rtags-dependency-tree-expand-all
    (kbd "c") 'rtags-dependency-tree-collapse-all
    (kbd "-") 'rtags-dependency-tree-collapse-current
    (kbd "+") 'rtags-dependency-tree-expand-current
    "P" 'rtags-dependency-tree-find-path
    "gf" 'rtags-dependency-tree-find-path

    "gj" 'rtags-dependency-tree-next-level
    "gk" 'rtags-dependency-tree-previous-level

    (kbd "C-j") 'rtags-dependency-tree-next-level
    (kbd "C-k") 'rtags-dependency-tree-previous-level
    "]" 'rtags-dependency-tree-next-level
    "[" 'rtags-dependency-tree-previous-level

    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
    (kbd "M-<return>") 'rtags-show-in-other-window
    (kbd "go") 'rtags-select-other-window
    (kbd "gO") 'rtags-show-in-other-window
    [mouse-1] 'rtags-select-other-window
    [mouse-2] 'rtags-select-other-window
    "s" 'rtags-show-in-other-window

    "x" 'rtags-select-and-remove-rtags-buffer
    "q" 'rtags-call-bury-or-delete)

  (evil-define-key 'normal rtags-references-tree-mode-map
    (kbd "TAB") 'rtags-references-tree-toggle-current-expanded

    (kbd "E") 'rtags-references-tree-expand-all
    (kbd "c") 'rtags-references-tree-collapse-all
    (kbd "-") 'rtags-references-tree-collapse-current
    (kbd "+") 'rtags-references-tree-expand-current

    "gj" 'rtags-references-tree-next-level
    "gk" 'rtags-references-tree-previous-level

    (kbd "C-j") 'rtags-references-tree-next-level
    (kbd "C-k") 'rtags-references-tree-previous-level

    "]" 'rtags-references-tree-next-level
    "[" 'rtags-references-tree-previous-level

    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
    (kbd "M-<return>") 'rtags-show-in-other-window
    (kbd "go") 'rtags-select-other-window
    (kbd "gO") 'rtags-show-in-other-window
    [mouse-1] 'rtags-select-other-window
    [mouse-2] 'rtags-select-other-window
    "s" 'rtags-show-in-other-window

    "x" 'rtags-select-and-remove-rtags-buffer
    "q" 'rtags-call-bury-or-delete)

  (evil-define-key 'normal rtags-location-stack-visualize-mode-map
    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window<commit_msg>rtags: Normalize binding syntax<commit_after>;;; evil-collection-rtags.el --- Evil bindings for `rtags'. -*- lexical-binding: t -*-

;; Copyright (C) 2017 <NAME>

;; Author: <NAME> <<EMAIL>>
;; Maintainer: <NAME> <<EMAIL>>
;; <NAME> <<EMAIL>>
;; URL: https://github.com/jojojames/evil-collection
;; Version: 0.0.1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: evil, rtags, 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 <http://www.gnu.org/licenses/>.

;;; Commentary:
;;; Evil bindings for `rtags'.

;;; Code:
(require 'evil)
(require 'rtags nil t)

(defvar rtags-mode-map)
(defvar rtags-dependency-tree-mode-map)
(defvar rtags-references-tree-mode-map)
(defvar rtags-location-stack-visualize-mode-map)

(defun evil-collection-rtags-setup ()
  "Set up `evil' bindings for `rtags'."
  (evil-set-initial-state 'rtags-mode 'normal)
  (evil-set-initial-state 'rtags-dependency-tree-mode 'normal)
  (evil-set-initial-state 'rtags-references-tree-mode 'normal)
  (evil-set-initial-state 'rtags-location-stack-visualize-mode 'normal)

  (evil-define-key 'normal rtags-mode-map
    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
    (kbd "M-<return>") 'rtags-show-in-other-window
    (kbd "go") 'rtags-select-other-window
    (kbd "gO") 'rtags-show-in-other-window
    [mouse-1] 'rtags-select-other-window
    [mouse-2] 'rtags-select-other-window
    "s" 'rtags-show-in-other-window ; TODO: Remove this binding?

    "c" 'rtags-select-caller
    "C" 'rtags-select-caller-other-window
    "x" 'rtags-select-and-remove-rtags-buffer
    "q" 'rtags-call-bury-or-delete)

  (evil-define-key 'normal rtags-dependency-tree-mode-map
    (kbd "<tab>") 'rtags-dependency-tree-toggle-current-expanded
    "E" 'rtags-dependency-tree-expand-all
    "c" 'rtags-dependency-tree-collapse-all
    "-" 'rtags-dependency-tree-collapse-current
    "+" 'rtags-dependency-tree-expand-current
    "P" 'rtags-dependency-tree-find-path
    "gf" 'rtags-dependency-tree-find-path

    "gj" 'rtags-dependency-tree-next-level
    "gk" 'rtags-dependency-tree-previous-level

    (kbd "C-j") 'rtags-dependency-tree-next-level
    (kbd "C-k") 'rtags-dependency-tree-previous-level
    "]" 'rtags-dependency-tree-next-level
    "[" 'rtags-dependency-tree-previous-level

    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
    (kbd "M-<return>") 'rtags-show-in-other-window
    "go" 'rtags-select-other-window
    "gO" 'rtags-show-in-other-window
    [mouse-1] 'rtags-select-other-window
    [mouse-2] 'rtags-select-other-window
    "s" 'rtags-show-in-other-window

    "x" 'rtags-select-and-remove-rtags-buffer
    "q" 'rtags-call-bury-or-delete)

  (evil-define-key 'normal rtags-references-tree-mode-map
    (kbd "<tab>") 'rtags-references-tree-toggle-current-expanded

    "E" 'rtags-references-tree-expand-all
    "c" 'rtags-references-tree-collapse-all
    "-" 'rtags-references-tree-collapse-current
    "+" 'rtags-references-tree-expand-current

    "gj" 'rtags-references-tree-next-level
    "gk" 'rtags-references-tree-previous-level

    (kbd "C-j") 'rtags-references-tree-next-level
    (kbd "C-k") 'rtags-references-tree-previous-level

    "]" 'rtags-references-tree-next-level
    "[" 'rtags-references-tree-previous-level

    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
    (kbd "M-<return>") 'rtags-show-in-other-window
    "go" 'rtags-select-other-window
    "gO" 'rtags-show-in-other-window
    [mouse-1] 'rtags-select-other-window
    [mouse-2] 'rtags-select-other-window
    "s" 'rtags-show-in-other-window

    "x" 'rtags-select-and-remove-rtags-buffer
    "q" 'rtags-call-bury-or-delete)

  (evil-define-key 'normal rtags-location-stack-visualize-mode-map
    ;; open
    (kbd "<return>") 'rtags-select
    (kbd "S-<return>") 'rtags-select-other-window
{'fraction_non_alphanumeric': 0.1681188561215371, 'fraction_numerical': 0.0037980339588918675, 'mean_word_length': 3.553916581892167, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1517495', 'n_tokens_mistral': 3377, 'n_tokens_neox': 3266, 'n_words': 648}