emacs-hacker-typer icon indicating copy to clipboard operation
emacs-hacker-typer copied to clipboard

A customizable implementation of http://hackertyper.com in emacs.

  • emacs-hacker-typer [[https://melpa.org/#/hacker-typer][file:https://melpa.org/packages/hacker-typer-badge.svg]] [[https://stable.melpa.org/#/hacker-typer][file:https://stable.melpa.org/packages/hacker-typer-badge.svg]] [[https://www.gnu.org/licenses/gpl-3.0.txt][file:https://img.shields.io/badge/license-GPL_3-green.svg]]

A customizable implementation of [[http://hackertyper.com][hackertyper.com]] in emacs.

[[file:hackerman.png]]

** Usage

  • Type ~M-x hacker-typer~ and get hacking! Or use ~C-u M-x hacker-typer~ to be prompted about the file to use.

  • Type ~M-x hackerman~ if you'd just like a hacker companion, or ~C-u M-x hackerman~ for single-window.

  • If you'd like to see hackerman when invoking ~M-x hacker-typer~, set ~hacker-typer-show-hackerman~ to ~t~. See more [[#customization][customization options]] below.

  • You can quit with your ~keyboard-quit~ binding or ~M-x hacker-typer-quit~.

  • You can clear downloaded data with ~M-x hacker-typer-clear-cache~.

NOTE: None of your files are altered.

** Installation This package is on Melpa. To install using [[https://github.com/jwiegley/use-package][use-package]]: #+begin_src emacs-lisp (use-package hacker-typer :ensure t) #+end_src

Alternatively, using [[https://github.com/quelpa/quelpa-use-package][quelpa-use-package]]: #+begin_src emacs-lisp (use-package hacker-typer :quelpa (hacker-typer :fetcher github :repo "therockmandolinist/emacs-hacker-typer" :files (:defaults "hackerman.png"))) #+end_src

Or [[https://github.com/quelpa/quelpa][quelpa]]: #+begin_src emacs-lisp (quelpa '(hacker-typer :fetcher github :repo "therockmandolinist/emacs-hacker-typer" :files (:defaults "hackerman.png"))) #+end_src

Otherwise, download the files to somewhere on your load path, and enable hacker-typer: #+begin_src emacs-lisp (require 'hacker-typer) #+end_src

** How it works

~M-x hacker-typer~ randomly selects a file from ~hacker-typer-files~ (or prompts for one if given a prefix argument) downloading it if necessary, and creates a blank buffer with the name of that file (with random characers prepended). It then creates a local map in which all insert, delete, and enter commands are rebound to insert pieces of the file according to ~hacker-typer-type-rate~.

~M-x hackerman~ displays a humorous image of Rami Malek as "hackerman," by inserting the file path into a temporary buffer and calling ~iimage-mode~.

NOTE: Modes that get could get in the way are turned off if bound, so let me know if you have more suggestions for these. The current list:

  • agressive-indent-mode
  • smartparens-mode
  • evil-smartparens-mode
  • whitespace-mode

** Customization Type ~M-x customize-group hacker-typer RET~ to view all customization options.

They are the following:

*** ~hacker-typer-files~ A list of files to randomly select from. Defaults to 5 emacs C source code files.

Can be web urls that point directly to files, or local files of the form: file:///absolute/path/to/file.

*** ~hacker-typer-remove-comments~ If set to ~t~, remove comments from files.

*** ~hacker-typer-show-hackerman~ If set to ~t~, shaw hackerman when calling ~M-x hacker-typer~.

*** ~hacker-typer-type-rate~ How many characters to type out per keystroke. Can be set to:

  • ~random~ (default): each keystroke inserts N characters, where N is randomly selected from ~hacker-typer-random-range~.
  • integer: types out this many characters per keystroke.

*** ~hacker-typer-random-range~ Range from which to choose chararcters to type per keystroke if ~hacker-typer-type-rate~ is set to ~'random~.

*** ~hacker-typer-data-dir~ The directory in which to store data for hacker-typer. If [[https://github.com/tarsius/no-littering][no-littering]] is installed, it defaults to ~hacker-typer/~ under ~no-littering-var-directory~, otherwise placing the folder under ~user-emacs-directory~.

** Todo

  • It's possible I should use ~image-mode~ to directly open the hackerman file instead, but I'm not sure how to do that with a temporary buffer and I like that temp buffers quit easily (at least, with evil-mode).

  • Somewhat relatedly, it would be nice to resize the hackerman image to fit the window, though this might take away from the humor of the immediacy by having to wait for the resize.