Skip to content

jh-leong/hammerspoon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toward a more useful keyboard

Inspired by jasonrudolph/keyboard. My configuration files for Hammerspoon. It has highly modal-based, vim-style keybindings, provides several interesting features.

Features

Vim-mode

Use hyperKey + v to turn on Vim Mode (use q or escape to exit). Now you can:

  • Use h / j / k / l for left/down/up/right respectively
  • Use H / L for move to the beginning/end of the line
  • Use J / K for move down/up 15 line
  • Use d / u for page down / page up
  • Use b / w or e to move to previous/next word (in most apps)

Window Layout Mode

Quickly arrange and resize windows in common configurations, using keyboard shortcuts that are on or near the home row.

Use hyperKey + w to turn on Window Layout Mode (use q or escape to exit). Now you can:

  • Use h to send window left (left half of screen)
  • Use j to send window down (bottom half of screen)
  • Use k to send window up (top half of screen)
  • Use l to send window right (right half of screen)
  • Use n to send window to upper left quarter of screen
  • Use m to send window to upper right quarter of screen
  • Use , to send window to lower left quarter of screen
  • Use . to send window to lower right quarter of screen
  • Use y to increase the window width
  • Use Y to decrease the window width
  • Use u to increase the window height
  • Use U to decrease the window height
  • Use x to send window to center of screen
  • Use f to resize window to fill the screen
  • Use w to send window to the monitor on the above (if there is one)
  • Use s to send window to the monitor on the below (if there is one)
  • Use d to send window to the monitor on the left (if there is one)
  • Use a to send window to the monitor on the right (if there is one)
  • Use = to expand the window size
  • Use - to shrink the window size
  • Use move the focused window above by on step
  • Use move the focused window below by on step
  • Use move the focused window left by on step
  • Use move the focused window right by on step
  • Use o focus the main display
  • Use i focus the next display

For a couple of features that I use a lot, you can use them without Windows Layout Mode enabled:

  • Use hyperKey + o focus the main display
  • Use hyperKey + i focus the next display
  • Use hyperKey + f to resize window to fill the screen

Markdown Mode

Perform common Markdown-formatting tasks anywhere that you're editing text (e.g. in a GitHub comment, in your editor, in your email client).

Use control + m to turn on Markdown Mode. Then, use any shortcut below to perform an action. For example, to format the selected text as bold in Markdown, hit control + m, and then b.

  • Use b to wrap the currently-selected text in double asterisks ("B" for "Bold")

    Example: **selection**

  • Use 1~6 to print # before the currently-selected text (Heading)

    Example: ### selection

  • Use t to print task list("T" for task list)

    Example: - []

  • Use p to print img wrap("p" for "picture")

    Example: ![]()

  • Use d to print dashes("D" for "Dashes")

    Example: ---

  • Use h to wrap the currently-selected text in = ("H" for "Hight light")

    Example: ==selection==

  • Use c to wrap the currently-selected text in backticks ("C" for "Code")

    Example: `selection`

  • Use i to wrap the currently-selected text in single asterisks ("I" for "Italic")

    Example: *selection*

  • Use s to wrap the currently-selected text in double tildes ("S" for "Strikethrough")

    Example: ~~selection~~

  • Use l to convert the currently-selected text to an inline link, using a URL from the clipboard ("L" for "Link")

    Example: [selection](clipboard)

  • Use control + m to exit Markdown Mode without performing any actions

How to use it

  1. Install Hammerspoon (minimum version required: 0.9.55, which introduced the hs.spoons module)

  2. Clone this repository into your ~/.hammerspoon directory:

    git clone https://github.com/jh-leong/hammerspoon.git ~/.hammerspoon
  3. Run Hammerspoon.

  4. Have fun!

Choose your own keybindings

See init.lua, set your own hyperKey. In default:

hyperKey = {"shift", "alt", "ctrl", "cmd"} -- set your own hyperKey

In my way, I configured Right Command as my HyperKey through Karabiner.

You’re welcome to personalize all keybindings above.

Contribute

Feel free to file issues or open PRs.

Here are some resources that may help you:

About

My configuration files for Hammerspoon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages