Categories
macOS

Setting up Spacemacs on macOS Big Sur

1. Install Emacs

Spacemacs is actually just a premade set of configurations for Emacs, thus the first step on installing Spacemacs is to install Emacs. An easy way to install Emacs on a Mac is to use Homebrew:

brew install --cask emacs

2. Install Source Code Pro font

Source Code Pro is the suggested font for Spacemacs. You can of course change the font later on, but to make things simple, install the free & open source font from GitHub.

3. Clone Spacemacs configuration

To install the actual Spac part of Spacemacs, git clone the repository either directly to ~/.emacs.d if you don’t have an existing Emacs installation, or to some other place and then copy/merge things over:

git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d

4. Run the wizard

Start Emacs and the Spacemacs wizard should pop up, prompting you for your preferences regarding some of the most common options.

5. Bump up the font size

The default font size of Spacemacs is painfully small 10. To bump it up, hit SPC f e d, search for dotspacemacs-default-font and increase the :size prop to a more comfortable one. It should be possible to reload the config by hitting SPC f e R, but for me setting the font side required restarting Emacs.

6. Draw the rest of the owl

Navigate to your preferred search engine and search for Spacemacs tutorials to continue your journey!

Categories
macOS

Installing Zoom without running the installer

Zoom is popular and does video & audio streaming very well, but everything else about it stinks big time.

@zachary on Twitter found a way to install Zoom on the Mac without running the installer:

Categories
Gear Keyboards macOS

Mapping Ctrl-hjkl to arrow keys on macOS

After mapping my Caps Lock key to work double duties as both Esc and Control I soon wondered how it would be like if I could have Control-hjkl act as arrow keys, full Vim style. Turns out it’s not that hard:

  1. Install Hammerspoon
  2. Open it’s config file and add the following setup:
local function pressFn(mods, key)
	if key == nil then
		key = mods
		mods = {}
	end

	return function() hs.eventtap.keyStroke(mods, key, 1000) end
end

local function remap(mods, key, pressFn)
	hs.hotkey.bind(mods, key, pressFn, nil, pressFn)	
end


remap({'ctrl'}, 'h', pressFn('left'))
remap({'ctrl'}, 'j', pressFn('down'))
remap({'ctrl'}, 'k', pressFn('up'))
remap({'ctrl'}, 'l', pressFn('right'))

remap({'ctrl', 'shift'}, 'h', pressFn({'shift'}, 'left'))
remap({'ctrl', 'shift'}, 'j', pressFn({'shift'}, 'down'))
remap({'ctrl', 'shift'}, 'k', pressFn({'shift'}, 'up'))
remap({'ctrl', 'shift'}, 'l', pressFn({'shift'}, 'right'))

remap({'ctrl', 'cmd'}, 'h', pressFn({'cmd'}, 'left'))
remap({'ctrl', 'cmd'}, 'j', pressFn({'cmd'}, 'down'))
remap({'ctrl', 'cmd'}, 'k', pressFn({'cmd'}, 'up'))
remap({'ctrl', 'cmd'}, 'l', pressFn({'cmd'}, 'right'))

remap({'ctrl', 'alt'}, 'h', pressFn({'alt'}, 'left'))
remap({'ctrl', 'alt'}, 'j', pressFn({'alt'}, 'down'))
remap({'ctrl', 'alt'}, 'k', pressFn({'alt'}, 'up'))
remap({'ctrl', 'alt'}, 'l', pressFn({'alt'}, 'right'))

remap({'ctrl', 'shift', 'cmd'}, 'h', pressFn({'shift', 'cmd'}, 'left'))
remap({'ctrl', 'shift', 'cmd'}, 'j', pressFn({'shift', 'cmd'}, 'down'))
remap({'ctrl', 'shift', 'cmd'}, 'k', pressFn({'shift', 'cmd'}, 'up'))
remap({'ctrl', 'shift', 'cmd'}, 'l', pressFn({'shift', 'cmd'}, 'right'))

remap({'ctrl', 'shift', 'alt'}, 'h', pressFn({'shift', 'alt'}, 'left'))
remap({'ctrl', 'shift', 'alt'}, 'j', pressFn({'shift', 'alt'}, 'down'))
remap({'ctrl', 'shift', 'alt'}, 'k', pressFn({'shift', 'alt'}, 'up'))
remap({'ctrl', 'shift', 'alt'}, 'l', pressFn({'shift', 'alt'}, 'right'))

remap({'ctrl', 'cmd', 'alt'}, 'h', pressFn({'cmd', 'alt'}, 'left'))
remap({'ctrl', 'cmd', 'alt'}, 'j', pressFn({'cmd', 'alt'}, 'down'))
remap({'ctrl', 'cmd', 'alt'}, 'k', pressFn({'cmd', 'alt'}, 'up'))
remap({'ctrl', 'cmd', 'alt'}, 'l', pressFn({'cmd', 'alt'}, 'right'))

remap({'ctrl', 'cmd', 'alt', 'shift'}, 'h', pressFn({'cmd', 'alt', 'shift'}, 'left'))
remap({'ctrl', 'cmd', 'alt', 'shift'}, 'j', pressFn({'cmd', 'alt', 'shift'}, 'down'))
remap({'ctrl', 'cmd', 'alt', 'shift'}, 'k', pressFn({'cmd', 'alt', 'shift'}, 'up'))
remap({'ctrl', 'cmd', 'alt', 'shift'}, 'l', pressFn({'cmd', 'alt', 'shift'}, 'right'))

Source: kkamdooong/hammerspoon-control-hjkl-to-arrow

(I copied and pasted it here mainly for myself so I have it available the next time I need it.)