If you run a .bash_profile
then you should probably add this:
if [ -f ~/.bashrc ]; then . ~/.bashrc; fi
- Setting up my mac
- Font
- Custom git setup
- Custom Caching setup
- Rust setup
- homebrew
- zsh
- Making symlinks
- Deleting symlinks
- Tmux Setup
- Vim Setup
- FZF setup
- VS Code Setup
- Vrapper Setup
- vifm
- vimium
- Vimium C
- CRKBD Keyboard Layout
- MacOS Keyboard Layout
- Plover
- Emacs
- Remote pbcopy (deprecated)
- Auto Fetch
- Print to ReMarkable
- Touchpad tap to click, keypress repeat time, alt left right to move spaces, don't auto rearrange spaces
- accessibility drag + reduce motion
- screen saver and screen off
- Download chrome - disable third party cookies
- Show on toolbar - full datetime, bluetooth, sound, battery percentage
- Adjust all the finder settings
- Download install packages (see next section)
- Migrate these changes to
.macos
file - system settings -> accessibility -> zoom -> trackpad gestures + advanced (ctrl + option) to zoom
- Install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install tmux, fzf, ripgrep, zsh, git, node, python
- Clone dotfiles repo
git clone [email protected]:ayroblu/dotfiles.git
and depsgit clone [email protected]:ayroblu/deps.git
- Run the run.sh file to symlink:
bash scripts/run.sh
- Install tpm,
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
, open tmux (you might needtmux source ~/.tmux.conf
) and run<prefix> + I
- Install vim plug and run
:PlugInstall
- Install macvim with
brew install --cask macvim --no-binaries
- brew install vldmrkl/formulae/airdrop-cli
- Doesn't work?
- python jq fd gitdelta node neovim fzf ripgrep tmux bat tree chafa coursier exiftool extract_url htop less make rustup-init trash urlview
- charles vimmotion keepingyouawake espanso rectangle raycast dbeaver-community docker dropbox fuwari finestructure/Hummingbird/hummingbird imageoptim keycastr visual-studio-code flipper android-studio macvim
I like Monaco, I think it's a good fixed width font but it doesn't support bold, italics, and nerd fonts. Clone and add to font book: [email protected]:krfantasy/monego.git (based on [email protected]:cseelus/monego.git)
If you need to customise git (email for example), consider using the following gitconfig instead:
# Make sure include is first
[include]
path = ws/dotfiles/.gitconfig
# All other settings
[user]
name = Name Here
email = [email protected]
I have a bespoke caching function here. This adds it to your path
ln -s $(pwd)/scripts/cache_fzf.js ~/bin/cache_fzf.js
# Init
brew install rustup
rustup-init
rmtrash ~/.zprofile
rmtrash ~/.profile
rustup component add rustfmt
# Install racer
rustup toolchain add nightly
cargo +nightly install racer
rustup component add rust-src
racer complete std::io::B
# Install rls (setup in vim)
rustup component add rls
Checkout https://crates.io/crates/cargo-outdated for when your packages go out of date
Install homebrew
Install the packages that are listed in the brew lists
To remove a package with depedencies: https://stackoverflow.com/questions/7323261/uninstall-remove-a-homebrew-package-including-all-its-dependencies
brew tap beeftornado/rmtree
brew rmtree <package>
Sometimes terminal is slow, you can use the preload system to quickly quit and drop into a raw shell with no rcs
mkdir ~/preload
cat <<EOF > ~/preload/.zshrc
ZDOTDIR="$HOME" PRELOAD=t zsh
exit
EOF
I have yet to confirm this is actually useful, may delete if ctrl-c doesn't work as is
bash scripts/run.sh
https://stackoverflow.com/questions/22097130/delete-all-broken-symbolic-links-with-a-line
With zsh
rm -- *(-@D)
This requires TPM:
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
Install vim-plug: https://github.com/junegunn/vim-plug
Run :PlugInstall
in vim
Do the same for neovim
After brew install fzf, make sure you run the key bindings setup
/usr/local/opt/fzf/install
First create symlink to the settings file
# https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations
# ln -s <dest> <link-file-name>
trash "$HOME/Library/Application Support/Code/User/settings.json"
ln -s "$HOME/ws/dotfiles/vscode_settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
~/ws/aiden:$ code --list-extensions
adamwalzer.scss-lint
amatiasq.sort-imports
eamodio.gitlens
eg2.tslint
esbenp.prettier-vscode
GrapeCity.gc-excelviewer
Gruntfuggly.shifter
mechatroner.rainbow-csv
mrmlnc.vscode-scss
ms-python.python
PeterJausovec.vscode-docker
RoscoP.ActiveFileInStatusBar
vscodevim.vim
cp "$HOME/Library/Application Support/Code/User/settings.json" vscode_settings.json
In dbeaver, install vrapper: http://vrapper.sourceforge.net/documentation/?topic=basics
It should automatically take the .vwrapperrc from home dir
brew install vifm
ln -s ~/ws/dotfiles/vifmrc ~/.config/vifm/vifmrc
ln -s ~/ws/dotfiles/solarized-light.vifm ~/.config/vifm/colors/solarized-light.vifm
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb?hl=en
- vimiumrc
- vimiumsearch
Because you can trigger bookmarks with b
, you can trigger these js bookmarks really easily. To make a change to them use:
decodeURIComponent(`(function()%7B(function%20()%20%7Bvar%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7Bif%20(%5B'fixed'%2C%20'sticky'%5D.includes(getComputedStyle(elements%5Bi%5D).position))%20%7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)()`)
const a = encodeURIComponent(`(function(){(function () {var i, elements = document.querySelectorAll('body *');for (i = 0; i < elements.length; i++) {if (['fixed', 'sticky'].includes(getComputedStyle(elements[i]).position)) {elements[i].parentNode.removeChild(elements[i]);}}})()})()`);
console.log(`javascript:${a}`);
This works better than vimium because of it's better support for jumping in and out of insert mode, better support in GMail.
- Disable smooth scrolling
- set link hints as home row
.LH {font-size: 1.2rem}
This is for the Corne keyboard, you need qmk_firmware (github), and QMK Toolbox (cask) to flash it.
After cloning qmk_firmware, run: make crkbd:default
to build the default firmware, run through the steps provided to download dependencies etc.
To play around with the layout, consider using this tool: https://config.qmk.fm/#/crkbd/rev1/common/LAYOUT_split_3x6_3
See the qmk fork for my keymap
Convert the json file to a keymap and install it with make crkbd:ayroblu
.
- Terminal requires disabling the numpad emulation
- Function keys need to be normal function (not media) (done with karabiner)
Note to generate these, take a full screen snapshot with chrome, then run this script to get the cropped version for dotfiles:
convert ayroblu-corne-layout-tmp.png -crop 1387x4312+745+782 ayroblu-corne-layout.png
# Make side by side
convert ayroblu-corne-layout-tmp.png -crop 1387x2156+745+782 ayroblu-corne-layout-cropped-0-3.png
convert ayroblu-corne-layout-tmp.png -crop 1387x2156+745+2938 ayroblu-corne-layout-cropped-4-7.png
convert +append ayroblu-corne-layout-cropped-* ayroblu-corne-layout-side.png
cd ~/ws/dotfiles
mv ~/Downloads/crkbd_rev1_common_layout_split_3x6_3_mine.json .
qmk json2c crkbd_rev1_common_layout_split_3x6_3_mine.json | pbcopy
cd ~/ws/qmk_firmware
vi keyboards/crkbd/keymaps/ayroblu/keymap.c
make crkbd:ayroblu:dfu
I wrote my own custom keyboard layout (ayro). Checkout workman's keyboard for more info and thoughts, but my reasoning was that COLEMAK has an extremely terrible vim (hjkl) layout, (dvorak is fine, but all the symbols are messed up), and I was annoyed at the seemingly useless key moves. My goal was to keep as many keys in the same place as possible while keeping similar performance numbers as colemak and workman. Another reason for this was that I hypothesised that I was likely to use a qwerty layout quite a lot so it would be good to maintain the skills.
Consider: http://patorjk.com/keyboard-layout-analyzer/ as a way to test out a keyboard layout + project gutenburg raw text
Theoretically I want to keylog my computer in the future.
cp -a ayrokeyboard/ayro.bundle '/Library/Keyboard Layouts/'
In setting up plover, point at the dictionaries in the plover folder. Note that specifically, UK order must go first, others do not matter as much
I followed the doom emacs setup docs. Check there for the latest instructions:
brew cask install emacs
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
# y to envvar and fonts
# Add ~/.emacs.d/bin to path
doom sync
Doom emacs files are in the .doom.d
directory
Add to your root dir like so (you may need to delete your existing one generated automatically)
# cp -a ~/.doom.d .doom.d
# rmtrash ~/.doom.d
ln -s ~/ws/dotfiles/.doom.d ~/.doom.d
Deprecated in favour of bin/pbcopy
From https://gist.github.com/burke/5960455
macOS opens inetd which pipes socket info to pbcopy and pbpaste and relies on netcat on the remote
set -x ln -s "$(pwd)/remote-pbcopy/pbcopy.plist" ~/Library/LaunchAgents/pbcopy.plist ln -s "$(pwd)/remote-pbcopy/pbpaste.plist" ~/Library/LaunchAgents/pbpaste.plist launchctl load ~/Library/LaunchAgents/pbcopy.plist launchctl load ~/Library/LaunchAgents/pbpaste.plistExample ssh config, probably want to use
sshpb
alias to pass through ports by connectionHost myhost HostName 192.168.1.123 User myname RemoteForward 2324 127.0.0.1:2324 RemoteForward 2325 127.0.0.1:2325
Regularly update your git repos with this launchctl command.
ln -s "$(pwd)/auto-fetch.plist" ~/Library/LaunchAgents/auto-fetch.plist
launchctl load ~/Library/LaunchAgents/auto-fetch.plist
(thanks to this comment which was super helpful) https://stackoverflow.com/questions/47582989/launchd-not-able-to-access-mac-os-keychains#comment117557839_49288984
Note that you can view the logs of the runs defined in the StandardOutPath etc in the plist
Then your ~/bin/auto-fetch.sh
might look something like:
#!/bin/bash
set -euxo pipefail
echo "============"
date
sourcerepos=(
~/ws/source
)
for i in "${sourcerepos[@]}"; do
cd "$i"
git fetch origin
done
You can run it manually with
launchctl start local.autoFetch
https://github.com/juruen/rmapi/blob/master/docs/tutorial-print-macosx.md
See the ~/Library/PDF Services
directory for the workflow. Note I couldn't make any logs
- Download and setup rmapi
- Automator
- PDF Plugin
- Code and save ⌘s
cd ws
mkdir rmapi
cd rmapi
curl -L https://github.com/juruen/rmapi/releases/download/v0.0.24/rmapi-macosx.zip -o rmapi.zip -o rmapi.zip
unzip rmapi.zip
./rmapi
Script to go in automator
for f in "$@"
do
/Users/blu/ws/rmapi/rmapi put "$f" "To read"
done