{"id":15704930,"url":"https://github.com/andyatkinson/dotfiles","last_synced_at":"2025-05-12T13:42:24.267Z","repository":{"id":10299175,"uuid":"12420846","full_name":"andyatkinson/dotfiles","owner":"andyatkinson","description":"Personal dotfiles Mac OS developer setup ","archived":false,"fork":false,"pushed_at":"2025-03-27T03:32:05.000Z","size":354,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T04:27:34.960Z","etag":null,"topics":["terminal","vim"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andyatkinson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-28T00:37:13.000Z","updated_at":"2025-03-27T03:32:09.000Z","dependencies_parsed_at":"2023-01-11T17:49:35.275Z","dependency_job_id":"5527f95d-56a3-4f63-be35-641070f59874","html_url":"https://github.com/andyatkinson/dotfiles","commit_stats":{"total_commits":451,"total_committers":4,"mean_commits":112.75,"dds":"0.011086474501108667","last_synced_commit":"8f91cb7e0585db3db6a22cb352bc9e6cd2dcb36e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andyatkinson%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andyatkinson","download_url":"https://codeload.github.com/andyatkinson/dotfiles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253749430,"owners_count":21958120,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["terminal","vim"],"created_at":"2024-10-03T20:14:19.838Z","updated_at":"2025-05-12T13:42:24.254Z","avatar_url":"https://github.com/andyatkinson.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotfiles\nThis is how I set up Mac OS for development.\n\n## Summary\n * Mac OS \u003ca href='http://en.wikipedia.org/wiki/Defaults_(software)'\u003edefaults\u003c/a\u003e.\n   * Manually remap Caps Lock to Control, for each keyboard!\n   * Manually enable Control with Accessibility + Zoom + Scroll to zoom in\n   * Enable tap to click on touch pad\n   * Other customizations in this file: e.g. key repeat rata\n   * `xcode-select --install` to install compilation tools\n   * Uninstall `Garage Band`, `Pages` etc. on a work machine where they won't be used\n   * Make the bottom dock useful - remove all the content creation apps that aren't used\n * Vim 8 (mac version) with native packages [install](https://gist.github.com/manasthakur/ab4cf8d32a28ea38271ac0d07373bb53)\n * Vim: Attempted coc LSP and removed: \u003chttps://github.com/neoclide/coc.nvim\u003e\n * https://github.com/itchyny/lightline.vim\n   ```\n   mkdir -p ~/.vim/pack/plugins/start/\n\n   cd ~/.vim/pack/plugins/start/\n\n   git clone git@github.com:tpope/vim-rails.git\n   git clone git@github.com:junegunn/fzf.vim.git\n   git clone git@github.com:tpope/vim-fugitive.git\n   git clone git@github.com:vim-ruby/vim-ruby.git\n   git clone git@github.com:tomtom/tcomment_vim.git\n   git clone git@github.com:NLKNguyen/papercolor-theme.git\n   git clone git@github.com:preservim/nerdtree.git\n   ```\n * iTerm\n * tmux\n * [Fish shell](https://fishshell.com/)\n   * \u003chttps://stackoverflow.com/a/70203456/126688\u003e\n   * \u003chttps://github.com/oh-my-fish/oh-my-fish\u003e\n * PostgreSQL installed as [Postgres.app](https://postgresapp.com)\n * Git\n   * Global Git aliases/config in `gitconfig`\n   * Global Git ignore in `gitignore`\n  * Fuzzy Finder \u003chttps://github.com/junegunn/fzf\u003e\n    * \u003chttps://dev.to/iggredible/how-to-search-faster-in-vim-with-fzf-vim-36ko\u003e\n  * ripgrep (rg)\n  * Formatting SQL using `pg_format` (`brew install pgformatter`) from Vim: \u003chttps://www.endpointdev.com/blog/2022/04/formatting-sql-vim-pgformat/\u003e, make selection, then: `!pg_format`\n\n## Installation\nMake sure `ENV['HOME']` points at the home directory.\n\nClone this directory and run one or more installation Rake tasks\n\n```sh\n$ rake -T\nrake dotfiles       # install the dotfiles into home directory\nrake macos_defaults  # replace OS X defaults\n```\n\nOr to run all:\n\n```sh\nrake install\n```\n\n## Fonts\n* [11 Best Programming Fonts](https://itnext.io/11-best-programming-fonts-724283a9ed57)\n  * I'm trying out `Hack`\n\n## Release notes\n2025-02-13 Updates\n2021-11-01\n\nAdded Fonts\n\n2021-10-20\n\nOverhaul of setup for 2021 development on a Mac.\nIntroduction of new things: GH CLI, Fish shell\nRemoved: ctrl-p, ctrl-p funky, tagbar, mustache templating, goyo vim, ack vim\n\n2017-03-24\n`:PluginUpdate` was run to update all plugins. Should convert this setup to native plugin management soon.\n\n2015-04-28\n\nSwitch from git bash completion script to a homebrew version\n\n2016-03-01\n\nLink homebrew openssl explicitly on El Capitan OS X, before installing the eventmachine 1.0.5\n\u003chttps://github.com/eventmachine/eventmachine/issues/602\u003e\n\nPuma 2.9.1 (specify opt-dir or can configure bundler)\n\u003chttps://github.com/puma/puma/issues/783\u003e\n`gem install puma -v '2.9.1' -- --with-opt-dir=/usr/local/opt/openssl`\n\n## Homebrew\n```\n# critcal\nripgrep\nrbenv\nnvm\ngit\nbash-completion\ntmux\nreattach-to-user-namespace\nctags\ngpg\nredis\ntldr\njrnl\nglow\ngh\n\n# less critical\nnginx\npython\nwkhtmltopdf\nwget\nproctools\nfortune\nhtop\nwatch\ngcal\ndos2unix\njq\nmplayer\ntree\nmarkdown\ntig\nhg\nranger\nngrok\nhttpie\npgcli\nical-buddy\nreadline\npyenv # manage python version\nwrk # load testing, use wrk2\npssh # parallel ssh\nlnav # log file viewer\nbrew tap heroku/brew \u0026\u0026 brew install heroku\n\n# cask\nbrew tap homebrew/cask-versions\nbrew update\nbrew tap caskroom/cask\n\n# cask Mac OS apps\ninstall --cask rectangle\ninstall --cask iterm2\ninstall --cask macdown # Mac OS Markdown editor\ninstall --cask dropbox\ninstall --cask lyricsx\nbrew install --cask lunar # adjust brightness of LG display\nbrew install --cask sourcetree\n```\n\n## Extras\n* [OS X shortcuts](http://mattgemmell.com/mac-keyboard-shortcuts/)\n\n## OS X\n* Remap caps lock to control\n\n| Command      | Description |\n| ----------- | ----------- |\n|  softwareupdate --list     | find available things to install |\n|  softwareupdate --install \u003cproduct name\u003e |  update the software you named |\n| ctrl-arrow key  | ctrl-arrow key |\n| command-alt-h | hide other applications' windows, alt is fn+opt |\n\n## vim\nInteresting help:\n`:help opening-window`\n\n\n| Command      | Description |\n| ----------- | ----------- |\n| de | delete to the end of the current word, INCLUDING the last character |\n| ce | change until the end of word |\n| 2dd | delete 2 lines |\n| % | place cursor on character like `(` and press `%` to find match |\n| \"_d | black hole register, e.g. \"_dw to delete a word without storing the result in a register |\n| Ctrl-e      | execute vim-sparkup       |\n| gf | jump to code under cursor, rails.vim adds more\n| jj | insert mode to normal mode\n| jjj | insert mode to normal mode and write buffer\n| leader-z | goyo writing mode\n| Ctrl-n | on top of a word, enable multiple cursors match\n| Ctrl-p | next match with multiple cursors, ctrl-x to skip a match\n| F8 | tagbar :TagbarToggle\n| Ctrl-c | in normal mode, writes to ~/.vimbuffer (copy and paste between instances)\n| Ctrl-v v | paste from ~/.vimbuffer\n| Ctrl-p | normal mode, CtrlP find\n| Ctrl-b | CtrlP MRU buffer list\n| Ctrl-f | CtrlP function matching\n| Ctrl-h/j/k/l | navigate between panes\n| Ctrl-^ | last buffer\n| leader-n | show file in nerdtree\n| Ctrl-p | insert mode, displays autocomplete suggestions\n| s | in nerdtree, \"s\" on a file opens it in a vertical split\n| i | in nerdtree, \"i\" opens in split\n| :A | rails.vim, open alternative file\n| :Rcontroller | rails.vim, open related controller\n| :Rails console | rails.vim, open a console\n| :Rlog | rails.vim, open rails log file in a split window\n| :ctags -R ! | generate tags file for project\n| leader-c | call ctags on project\n| Ctrl-] | navigate via tags to item under cursor\n| Ctrl-t | navigate back after jumping with ctags\n| :AV | rails.vim, edit the alternate file in a vertical split\n| dap | delete around paragraph\n| :ta | navigate list of tags\n| \"*y | copy to OS X clipboard\n| Ctrl-v | in ctrlp buffer list, open buffer in vertical split\n| Ctrl-x | in ctrlp buffer list, open buffer in split\n| leader-w | write buffer\n| leader-q | quit buffer\n| ^ | jump to first character of line\n| leader-s | toggle spellchecking\n| Ctrl-w | toggle panes\n| gU | make uppercase, plus motion (w, k etc.)\n| ~ | swap case\n| Ctrl-o | jump back\n| Ctrl-i | jump forward\n| nG | jump to line n\n| Ctrl-u | in insert mode, delete line before cursor\n| Ctrl-w | in insert mode, delete word before cursor\n| Ctrl-w H/J/K/L | re-configure split panes, cycle the splits layout\n| leader-p F5 | refresh ctrlp buffer list\n| :30winc \u003e | add 30 characters of width to vertical split\n| v | with ack.vim, browsing results, \"v\" to open result in vertical split\n| Ctrl-w _ | maximize a pane vertically\n| Ctrl-w | | maximize a pane horizontally\n| Ctrl-w = | make the pane sizes equal\n| ctrl-w = | resize all panes\n| leader-t | with vimux and turbux, run test in tmux pane\n| leader-T | run focused unit test in tmux pane with vimux and turbux\n| :vs | open the last buffer in a vertical split\n| - | first non-blank character previous line\n| _ | first non-blank character current line\n| Ctrl-w r | rotate/swap/cycle/switch split panes\n| daw | delete around word\n| fx | jump to first x, ; char repeats motion\n| i and a | text objects, select inside, or select everything including delimiter, e.g. cit\n| is | inside sentence\n| ip | inside paragraph\n| t{char} | before the char, f{char} puts cursor on the char\n| mm | set a mark, with char m, m{a-zA-Z}\n| `m | jump to mark m\n| `. | last change\n| g; | similar to `., can be repeated\n| `\u003c | and `\u003e start and end of last visual selection\n| dd | cut the current line, ddp to transpose current next lines\n| yyp | yank yank paste, duplicates line\n| Ctrl-r{register} | e.g. Ctrl-r\" or C-r0\n| \"+p | put from the Plus register, to avoid toggling paste option\n| C-\\s | on top of a method, cscope query, to find caller of a method\n| :so ~/.vimrc | reload the ~/.vimrc\n| visual selection + S (capital \"s\") | type HTML tag like \u003cp\u003e to surround visual selection in \u003cp\u003e tag, depends on surround.vim\n| ctrl-r \" | paste from insert mode\n| d/ | hit enter after typing the selection, delete until the selection\n| f [space] | \";\" will repeat the motion\n| pry [tab] | in a ruby file, will insert a pry binding statement, part of the built-in ruby snippets file\n| y$ | yank until the end of the line without the newline\n| gui | switch to GUI\n| redraw! | redraw the screen when it goes black \u003chttp://stackoverflow.com/a/1117742/126688\u003e\n| e %:h (tab) | expands current directory. supply filename to create a new file at that point on disk.\n| cc | delete entire line and enter insert mode\n| ciB | change inner block (inside of {} braces)\n| comment out | ctrl-slash-slash\n| pgrep -f | -f is to match against full argument list, typically need this for a backgrounded rails console process name\n| ctrl-o-o | open last location \u003chttps://dev.to/jovica/3-little-known-but-useful-vim-tips-1pbg\u003e\n\n\n## bash\n\n| Command      | Description |\n| ----------- | ----------- |\n| ctrl-l | clear line\n| Ctrl-u | cut line\n| ctrl-y | paste line\n| Ctrl-y | restore before delete\n| Ctrl-a | move cursor, front of line\n| Ctrl-e | move cursor, end of line\n| Esc-b  | move cursor, back one word\n| Esc-f  | move cursor, forward one word\n| Ctrl-w | delete one word\n| option-b | back one word (OS X?)\n| option-f | forward one word (OS X?)\n| jobs | list jobs\n| jobs -p | list backgrounded jobs process IDs\n| fg 1 | bring background job 1 to the foreground\n| Ctrl-x Ctrl-e | edit command line command in $EDITOR\n| less +F path/to/log | \"follow\" the log file, ctrl-c to go in to search mode, \"F\" to return to following\n\n## Google Chrome\n\nWorkflow goal: avoid opening duplicate tabs:\n\n* Start typing a URL, use \"Switch to this tab\" when there is a match\n* `cmd-shift-a` open up the built-in tab search, if google calendar is already open, use that tab\n\n  * [Chrome keyboard shortcuts](https://developers.google.com/chrome-developer-tools/docs/shortcuts)\n  * Vimium plugin\n\n\n```sh\ncmd-option-i     # toggle web inspector\noption-command-u # open page source\ncmd-shift-a      # Search open tabs!\n```\n\n## iTerm\n* Use Source Code Pro font\n* Profile \u003e Keys \u003e Left option key acts as \"+Esc\"\n\n```sh\nCmd-/ # show cursor\nCmd-shift-d # split the window horizontally\nCmd-option-arrow # move between the split panes\n```\n\n## tmux\n[Tmux cheat sheet](https://tmuxcheatsheet.com). I use a leader of `Ctrl b`. I also use `screen` which uses `ctrl a`.\n\n| Command| Description|\n| ----------- | ----------- |\n| leader + w | preview sessions, especially helpful for unnamed sessions |\n| tmux new-session -s dev_logs | start a new session named dev_logs |\n| tmux attach-session -t 0 | attach to session 0 |\n| leader + h | terminate a stuck SSH session |\n| leader + $ | rename a session |\n\nOr [rename session from terminal](https://superuser.com/a/428025):\n\n- tmux rename-session [-t current-name] [new-name]\n\n| leader + c | new window |\n| leader + , | rename a window |\n| leader + space | switch to next pane layout |\n\nReload configuration:\ntmux source ~/.tmux.conf\n\nleader + I (capital \"I\") to install plugins\n\n\n## snippets\nSnippets directory `~/.vim/bundle/vim-snippets/snippets`\n\n```sh\n=\u003ctab\u003e # puts in Erb expression tags (requires snipmate)\n%\u003ctab\u003e # puts in Erb expression tags (requires snipmate)\ndef\u003ctab\u003e # start a ruby method\ndiv # can use this for markup too\n```\n\n## [tig](https://github.com/jonas/tig)\n```sh\ngit log | tig\ngit diff master | tig\nh # help\nm # toggle main view (useful to jump back and forth between code details and commit titles)\n```\n\n## [jrnl](http://maebert.github.io/jrnl/)\n* Default config file: `~/.config/jrnl/jrnl.yaml`\n* Configure editor in the config file\n\n```sh\njrnl # enter compose mode\njrnl @tag # list entries that include tag\njrnl -n10 # list last 10 entries\njrnl --edit # edit old entries (unencrypted file)\n```\n\n## [spectacle](http://spectacleapp.com/)\n```sh\noption-command-right arrow # right half\noption-command-f # full screen\n```\n\n## Slack\n```sh\n+:... # plus sign plus \"colon\" to pull up Emoji reactions, will react to most recent post\nup arrow key # edit last message\nCommand-t # jump to another channel\nCommand-1/2/3... # Jump to multiple workspaces in OS X desktop client app\noption-arrow up/down # move up/down between channels\ncommand-left/right bracket # move between channels\n/remind # create a reminder, type date and time naturally\n/leave # leave a channel\n/ # find out more slash options available\n`` # or triple backticks code fence\n```\n\n## Microsoft Teams\n[Keyboard Shortcuts for MS Teams](https://support.microsoft.com/en-us/office/keyboard-shortcuts-for-microsoft-teams-2e8e2a70-e8d8-4a19-949b-4c36dd5292d2?ui=en-us\u0026rs=en-us\u0026ad=us)\n\nI use it on Mac OS but swap \"command\" for \"control\" on Windows.\n\n```sh\ncommand-shift-x # put focus on new message\ncommand-enter  # send message\ncommand-e # search bar on top\ncommand-shift-m # mute/unmute microphone\ncommand-shift-o # toggle video on/off\ncommand-1/2/3 # navigate vertically between activity/chat/teams sections\n\noption-arrow up/down # navigate items vertically under org\n```\n\n## Xcode and simulator\n```sh\ncommand-shift-o # fuzzy find files by name (open quickly), colon line number (e.g. \":42\" to open line 42)\ncommand-b # build\ncommand-1 # etc. to resize the simulator\nctrl-command-left/right # move back and forth between windows\ncommand-click # jump to method definition\nctrl-command-up # switch between header and implementation file\ncommand-shift-j # show file in project navigator\n```\n\n## [Httpie](https://github.com/jakubroztocil/httpie)\n\n* `tldr httpie` (or just use `curl`)\n\n## [showterm](http://showterm.io/)\n\nTerminal screencasting!\n\n```sh\nshowterm [command]\n```\n\n## [lnav](http://lnav.org)\n\nFancy log file viewer with cool features: \u003chttp://lnav.org/features/\u003e\n\n```sh\nbrew install lnav\nlnav path/to/log\n? # help\n```\n\n```sh\nSidekiq.redis { |conn| conn.flushdb }\nredis-cli flushdb # dump everything in redis\n```\n\n## IntelliJ OS X\nIdeaVim action list: \u003chttps://gist.github.com/zchee/9c78f91cc5ad771c1f5d\u003e\n\n```sh\ncommand-shift-t # jump to corresponding test\ncommand-shift-a # action or option name\ncommand-shift-a, type \"select in project view\" # view file in project view\ncommand-shift-o # Enter file name\ncommand-[ or command-] # jump backward and forward in history\n:action Run # run the current file\n:action \"Split Vertically\" # vertical split\n\u003cC-W\u003e + h/j/k/l # move between splits\nCtrl + ww # switch between windows\ncommand-shift-c # copy current filepath to clipboard\ncommand+F12 # file structure popup\ncommand+e # view recent files\nctrl-space # basic code completion\nctrl-shift-space # smart code completion\ncommand-1 # show/hide project view\nopen -a \"IntelliJ IDEA\" # open application when running Docker\n```\n\nPlugin: Key Promoter\n\n## VS Code\n- Marp for VS Code\n- `Shift-command-V` opens preview but in same window\n- `Command-K + V` opens side by side markdown preview for `.md` file\n- Column selection: `shift-option` + mouse\n- Format SQL queries: SQL Tools \u003chttps://stackoverflow.com/a/66873825\u003e\n\n## Zoom\n```sh\ncommand-shift-a # toggle audio\ncommand-shift-v # toggle video\n```\n\n## Man pages\n`tldr` as an improvement or supplement to `man`, with examples, e.g. `tldr curl`\n\n## Maven\n```sh\nmvn -Dtest=com.andy.AwesomeTest test # run specific test\nmvn clean compile exec:java # compile \u0026 boot app\n```\n\n## Go lang\n```sh\ngore # Go lang REPL\n```\n\n## Homebrew\n* `brew list`\n* `brew cask list` # OS X\n* `brew deps --tree --installed`\n\n## pyenv\n* `pyenv versions`\n\n## Windows\n* Windows Terminal. `iTerm` like. `Ctrl-Tab` to switch between tabs.\n* Use WSL 2. Requires a newer Windows build. This link helps debug Windows Update problems via log files and clears a cache. \u003chttps://www.howtogeek.com/416169/how-to-fix-what-needs-your-attention-windows-10-setup-errors/\u003e\n* My preference: Remap Caps to Ctrl. This can be done with Keyboard Manager in PowerToys.\n* Currently using Ubuntu 18.04 with WSL 2\n  * Use `wsl` commands `--set-version` to convert an existing distribution or `--set-default-version` for all new distributions\n* Chrome with Vimium, AdBlock, 1Password\n\n## MacDown\nMarkdown editor for OS X. Workaround for being a unidentified developer:\nhttps://macdown.uranusjr.com/faq/#unidentified\n\n## GitHub CLI\n\u003chttps://cli.github.com/\u003e\n\n- `gh pr create [flags]`\n- `gh browse -b (git branch --show-current)`\n\n## GitHub\n* `T`\n* `Command-K`\n\n## Fish shell\n* `Ctrl-f` - complete a suggestion\n* `fish_config` to launch the web based configuration\n* `omf install boxfish`\n* `cdh` plus letter or number, or `dirh` - list directory history\n* With background `jobs`, use `fg %1` to foreground job 1\n\n## Fuzzy Finder\n* `vim (fzf)`\n* `history | fzf`\n* `:Rg` within Vim to search within files\n* `:Buffers`\n\n## ripgrep\n\u003chttps://mariusschulz.com/blog/fast-searching-with-ripgrep\u003e\n\n* `rg TODO app/models` search the models directory\n* `rg --files-with-matches TODO app/models/` # only files, or `-l`\n* `rg --files-with-matches TODO app/models/ --sort path`\n\n## Rectangle\n\u003chttps://github.com/rxhanson/Rectangle\u003e\n\n## glow\nCommand line Markdown!\n\nSet a config file to set a pager and other stuff\n\n* `glow --config`\n* Edit that file with:\n\n```\n# show local files only; no network (TUI-mode only)\nlocal: true\n# mouse support (TUI-mode only)\nmouse: true\n# use pager to display markdown\npager: true\n# word-wrap at width\nwidth: 80\n```\n\n## `asdf`\nA version manager for lots of things\n\n## SSH\nManually set `/etc/ssh/ssh_config`, this is not automatically installed\n\n## Microphone\n```sh\nosascript -e \"set volume input volume 95\"\n```\n## JSON\n`:% !jq .`\n\n## Shottr\n\u003chttps://shottr.cc\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyatkinson%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandyatkinson%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandyatkinson%2Fdotfiles/lists"}