Emacs config utilizing prelude as a base
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.1 KiB

  1. ;;; prelude-key-chord.el --- Key chord setup
  2. ;;
  3. ;; Copyright © 2011-2021 Bozhidar Batsov
  4. ;;
  5. ;; Author: Bozhidar Batsov <bozhidar@batsov.com>
  6. ;; URL: https://github.com/bbatsov/prelude
  7. ;; Keywords: convenience
  8. ;; This file is not part of GNU Emacs.
  9. ;;; Commentary:
  10. ;; Configure key-chord key bindings.
  11. ;;; License:
  12. ;; This program is free software; you can redistribute it and/or
  13. ;; modify it under the terms of the GNU General Public License
  14. ;; as published by the Free Software Foundation; either version 3
  15. ;; of the License, or (at your option) any later version.
  16. ;;
  17. ;; This program is distributed in the hope that it will be useful,
  18. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. ;; GNU General Public License for more details.
  21. ;;
  22. ;; You should have received a copy of the GNU General Public License
  23. ;; along with GNU Emacs; see the file COPYING. If not, write to the
  24. ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  25. ;; Boston, MA 02110-1301, USA.
  26. ;;; Code:
  27. (prelude-require-package 'key-chord)
  28. (require 'key-chord)
  29. (key-chord-define-global "jj" 'avy-goto-word-1)
  30. (key-chord-define-global "jl" 'avy-goto-line)
  31. (key-chord-define-global "jk" 'avy-goto-char)
  32. (key-chord-define-global "JJ" 'crux-switch-to-previous-buffer)
  33. (key-chord-define-global "uu" 'undo-tree-visualize)
  34. (key-chord-define-global "xx" 'execute-extended-command)
  35. (key-chord-define-global "yy" 'browse-kill-ring)
  36. (defvar key-chord-tips '("Press <jj> quickly to jump to the beginning of a visible word."
  37. "Press <jl> quickly to jump to a visible line."
  38. "Press <jk> quickly to jump to a visible character."
  39. "Press <JJ> quickly to switch to previous buffer."
  40. "Press <uu> quickly to visualize the undo tree."
  41. "Press <xx> quickly to execute extended command."
  42. "Press <yy> quickly to browse the kill ring."))
  43. (setq prelude-tips (append prelude-tips key-chord-tips))
  44. (key-chord-mode +1)
  45. (provide 'prelude-key-chord)
  46. ;;; prelude-key-chord.el ends here