added support for snake

This commit is contained in:
farzin 2021-11-03 19:39:26 -04:00
parent 9e47d61bdf
commit 942369b8fe
2 changed files with 54 additions and 0 deletions

View File

@ -254,6 +254,7 @@ This will bind additional find-* type commands, e.g. usages, assignments, etc.."
telega
(term term ansi-term multi-term)
tetris
snake
,@(when (>= emacs-major-version 27) '(thread))
tide
timer-list

View File

@ -0,0 +1,53 @@
;;; evil-collection-tetris.el --- Bindings for `tetris' -*- lexical-binding: t -*-
;; Copyright (C) 2021 Farzin Firouzi
;; Author: Farzin Firouzi
;; Maintainer: Farzin Firouzi <farzinf@riseup.net>
;; URL: https://github.com/emacs-evil/evil-collection
;; Version: 0.0.1
;; Package-Requires: ((emacs "25.1"))
;; Keywords: evil, emacs, 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:
;; Bindings for `snake'.
;;; Code:
(require 'evil-collection)
(require 'snake nil t)
(defconst evil-collection-tetris-maps '(snake-mode-map))
;;;###autoload
(defun evil-collection-snake-setup ()
"Set up `evil' bindings for `snake'."
(evil-set-initial-state 'snake-mode 'normal)
(evil-collection-define-key 'normal 'snake-mode-map
"h" 'snake-move-left
"j" 'snake-move-down
"k" 'snake-move-up
"l" 'snake-move-right
"gr" 'snake-start-game
"p" 'snake-pause-game
"q" 'quit-window
"ZQ" 'quit-window
"ZZ" 'snake-end-game
(kbd "<escape>") 'quit-window))
(provide 'evil-collection-snake)
;;; evil-collection-snake.el ends here