summaryrefslogtreecommitdiff
path: root/modes/xwidget
diff options
context:
space:
mode:
authorRuslan Kamashev <rynffoll@gmail.com>2020-01-22 23:34:42 +0300
committerJames N <james@jojojames.com>2020-01-23 17:25:46 -0800
commite9a592e5ee293e18ffe7d4e16cfebcd57ed1c6a5 (patch)
tree7622bfa8dd4f67c04385c89c85dbb1a6d3741167 /modes/xwidget
parent67c27119d954589092bf050ed04fbad933571841 (diff)
Add xwidget
Diffstat (limited to 'modes/xwidget')
-rw-r--r--modes/xwidget/evil-collection-xwidget.el67
1 files changed, 67 insertions, 0 deletions
diff --git a/modes/xwidget/evil-collection-xwidget.el b/modes/xwidget/evil-collection-xwidget.el
new file mode 100644
index 0000000..6ed2f9b
--- /dev/null
+++ b/modes/xwidget/evil-collection-xwidget.el
@@ -0,0 +1,67 @@
+;;; evil-collection-xwidget.el --- Evil bindings for Xwidget -*- lexical-binding: t -*-
+
+;; Copyright (C) 2020 Ruslan Kamashev
+
+;; Author: Ruslan Kamashev <rynffoll@gmail.com>
+;; Maintainer: James Nguyen <james@jojojames.com>
+;; Pierre Neidhardt <mail@ambrevar.xyz>
+;; URL: https://github.com/emacs-evil/evil-collection
+;; Version: 0.0.1
+;; Package-Requires: ((emacs "25.1"))
+;; Keywords: evil, xwidget, tools
+
+;; This file 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, or (at your
+;; option) any later version.
+;;
+;; This file 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.
+;;
+;; For a full copy of the GNU General Public License
+;; see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;; Evil bindings for Xwidget.
+
+;;; Code:
+(require 'xwidget)
+(require 'evil-collection)
+
+(defvar evil-collection-xwidget-maps '(xwidget-webkit-mode-map))
+
+;;;###autoload
+(defun evil-collection-xwidget-setup ()
+ "Set up `evil' bindings for `xwidget'."
+ (evil-collection-define-key 'normal 'xwidget-webkit-mode-map
+ "q" 'quit-window
+ "k" 'xwidget-webkit-scroll-down-line
+ "j" 'xwidget-webkit-scroll-up-line
+ "h" 'xwidget-webkit-scroll-backward
+ "l" 'xwidget-webkit-scroll-forward
+ (kbd "C-f") 'xwidget-webkit-scroll-up
+ (kbd "C-b") 'xwidget-webkit-scroll-down
+ "+" 'xwidget-webkit-zoom-in
+ "=" 'xwidget-webkit-zoom-in
+ "-" 'xwidget-webkit-zoom-out
+ "R" 'xwidget-webkit-reload
+ "gr" 'xwidget-webkit-reload
+ "H" 'xwidget-webkit-back
+ "L" 'xwidget-webkit-forward
+ "gu" 'xwidget-webkit-browse-url
+ "gg" 'xwidget-webkit-scroll-top
+ "G" 'xwidget-webkit-scroll-bottom
+ "y" 'xwidget-webkit-copy-selection-as-kill)
+
+ (when evil-want-C-d-scroll
+ (evil-collection-define-key 'normal 'xwidget-webkit-mode-map
+ (kbd "C-d") 'xwidget-webkit-scroll-up))
+ (when evil-want-C-u-scroll
+ (evil-collection-define-key 'normal 'xwidget-webkit-mode-map
+ (kbd "C-u") 'xwidget-webkit-scroll-down))
+ )
+
+(provide 'evil-collection-xwidget)
+;;; evil-collection-xwidget.el ends here