{"id":15319049,"url":"https://github.com/appleboy/macbook","last_synced_at":"2025-04-14T03:50:55.250Z","repository":{"id":66187517,"uuid":"160912858","full_name":"appleboy/macbook","owner":"appleboy","description":"Some tips and command for my MacOS.","archived":false,"fork":false,"pushed_at":"2024-11-27T00:35:38.000Z","size":8908,"stargazers_count":64,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T08:21:11.718Z","etag":null,"topics":["macbook","macbook-configuration","macbook-pro"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appleboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-12-08T06:55:30.000Z","updated_at":"2024-11-29T00:40:47.000Z","dependencies_parsed_at":"2023-02-22T17:30:16.404Z","dependency_job_id":"73e0101a-a428-47d4-8ac4-75a836108e37","html_url":"https://github.com/appleboy/macbook","commit_stats":{"total_commits":55,"total_committers":1,"mean_commits":55.0,"dds":0.0,"last_synced_commit":"2bb8957569e4ad27d3748f9746ecd8300a7a414b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmacbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmacbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmacbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appleboy%2Fmacbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appleboy","download_url":"https://codeload.github.com/appleboy/macbook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248819351,"owners_count":21166472,"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":["macbook","macbook-configuration","macbook-pro"],"created_at":"2024-10-01T09:03:13.755Z","updated_at":"2025-04-14T03:50:55.231Z","avatar_url":"https://github.com/appleboy.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Macbook tips\n\nSome tips and command for MacOS.\n\n![macos](./images/apple_mac_m1.png)\n\n## Command\n\n### Install Homebrew First\n\nSee the [homepage](https://brew.sh/).\n\n```sh\n/bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n```\n\n### [Install Bash git completion](https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion)\n\n```bash\nbrew install git bash-completion\n```\n\nAdd bash-completion to your `~/.bash_profile` or `.extra`\n\n```bash\n[ -f /usr/local/etc/bash_completion ] \u0026\u0026 . /usr/local/etc/bash_completion\n```\n\n### [How to Change Screenshot Save Location](https://discussions.apple.com/docs/DOC-9081)\n\ncreate new folder in `Desktop`\n\n```bash\nmkdir ~/Desktop/screenshots/\n```\n\nCopy and paste this command to the terminal window:\n\n```bash\ndefaults write com.apple.screencapture location ~/Desktop/screenshots/\n```\n\n### Monospaced font with programming ligatures: [FiraCode](https://github.com/tonsky/FiraCode)\n\nUse [brew](http://brew.sh/) and [cask](https://caskroom.github.io/): Not officially supported, might install outdated version\n\n```bash\nbrew tap homebrew/cask-fonts\nbrew install font-fira-code --cask\n```\n\nscreenshot: see the `!=` symbol\n\n![firacode](./images/firacode.png)\n\n### Setting the Mac hostname or computer name from the terminal\n\nSee the [reference](https://knowledge.autodesk.com/support/smoke/learn-explore/caas/sfdcarticles/sfdcarticles/Setting-the-Mac-hostname-or-computer-name-from-the-terminal.html). change the primary hostname of your Mac:\n\n```bash\nscutil --set HostName \u003cnew host name\u003e\n```\n\n### Main font-bundle for sketch icon-font plugin\n\n- FontAwesome\n- Material Design Icons\n- Ion Icons\n- Simple Line Icons (@bohn002)\n- Ant Design Icons\n\nSee the [detail](https://github.com/keremciu/font-bundles)\n\n![font](./images/font.png)\n\n### [Install jq command](https://stedolan.github.io/jq/)\n\njq is a lightweight and flexible command-line JSON processor. [Try it online](https://jqplay.org/).\n\n![jq_command](./images/jq_command.png)\n\n## IDE\n\n- [GraphQL IDE for better development workflows](https://github.com/prisma/graphql-playground)\n- [Visual Studio Code](https://code.visualstudio.com)\n- [SSH Tunnel Manager](https://www.tynsoe.org/stm/)\n- [Elegant Facebook Messenger desktop app](https://github.com/sindresorhus/caprine)\n- [Discord App](https://discordapp.com/)\n- [Gitter is a chat and networking platform](https://gitter.im/)\n- [Docker for Mac](https://docs.docker.com/docker-for-mac/install/)\n- [Wechat in China](https://www.wechat.com/en/)\n- [Google Chrome](https://www.google.com/chrome/)\n- [Telegram Desktop Messenger](https://github.com/telegramdesktop/tdesktop)\n- [iTerm2 is a replacement for Terminal and the successor to iTerm](https://www.iterm2.com/downloads.html)\n- [Evernote skitch](https://evernote.com/intl/en/products/skitch)\n- [MPlayer OSX Extended video player](https://github.com/sttz/MPlayer-OSX-Extended)\n- [Universal Database Tool: DBeaver Community](https://dbeaver.io/)\n- [Phiewer is the easiest and fastest way to view your images](https://phiewer.com/)\n- [FileZilla Client not only supports FTP, but also FTP over TLS (FTPS) and SFTP](https://filezilla-project.org/)\n- [Project discussions: Slack](https://slack.com/)\n- [Postman](https://www.getpostman.com/downloads/)\n- [TablePlus - native app which helps you easily edit database data and structure](https://github.com/TablePlus/TablePlus)\n- [Keka - the macOS file archiver](https://www.keka.io)\n- [Elmedia Player - Best media player for macOS](https://www.elmedia-video-player.com/)\n- [Robo 3T - Mongodb Client](https://robomongo.org/download)\n- [Microsoft Remote Desktop](https://apps.apple.com/tw/app/microsoft-remote-desktop/id1295203466?mt=12)\n- [Security-first diagramming for teams.](https://www.diagrams.net/)\n- [Mipony - Mipony, your download manager](https://www.mipony.net/en/)\n- [IINA - The modern media player for macOS](https://iina.io/)\n- [Fig adds IDE-style autocomplete to your existing terminal. Move faster with Fig.](https://fig.io/)\n- [AppCleaner is a small application which allows you to thoroughly uninstall unwanted apps.](https://freemacsoft.net/appcleaner/)\n- [MacWhisper - Quickly and easily transcribe audio files into text with OpenAI's state-of-the-art transcription technology Whisper](https://goodsnooze.gumroad.com/l/macwhisper)\n\n## Tips\n\n### Show all filename extensions in `Finder`\n\nSee the following screenshots:\n\n![finder](./images/finder.png)\n\n### How to change the ScreenShot Keyboard Shortcut\n\nYou can see the [reference](https://www.wikihow.com/Change-the-Keyboard-Shortcut-for-a-Mac-Screenshot).\n\n![shortcut_001](./images/shortcut_001.png)\n\n![shortcut_002](./images/shortcut_002.png)\n\n### Change the Shell in Mac OS X Terminal\n\nYou can see the [reference](http://osxdaily.com/2012/03/21/change-shell-mac-os-x/).\n\nopen the `terminal` app and select the `preferences`\n\n![terminal_001](./images/terminal_001.png)\n\n![terminal_002](./images/terminal_002.png)\n\n### Using a Windows PC Keyboard on Mac with Remapped Windows \u0026 ALT Keys\n\nSee the [reference](http://osxdaily.com/2018/01/31/use-windows-pc-keyboard-mac-remap-option-command-keys/)\n\n![keyboard_01](./images/keyboard_01.png)\n\n1. Select your windows keyboard.\n2. Click the dropdown next to `OPTION Key` and select `Command`\n3. Click the dropdown next to `COMMAND Key` and select `Option`\n\n![keyboard_02](./images/keyboard_02.png)\n\n### Change default shell in terminal (iTerm2)\n\n![iterm2](./images/iterm2-command.png)\n\n```sh\nchsh -s /bin/bash\n```\n\nSee [Use zsh as the default shell on your Mac](https://support.apple.com/en-us/HT208050)\n\n### Tmux scrollback in terminal (iTerm2)\n\nYou can copy my [.tmux.conf](https://github.com/appleboy/dotfiles/blob/5c6bd88915b6ba97c50ff9f6f7627d9ad1ff31d9/.tmux.conf#L1) config file and [update the profile of iTerm2](https://stackoverflow.com/questions/12865559/leaving-tmux-scrollback-in-terminal-iterm2) as following screenshot:\n\n![iterm2](./images/iterm2.png)\n\n### Native Sierra-tabs on VSCode\n\nSee the [issue comment](https://github.com/microsoft/vscode/issues/76537#issuecomment-510070135)\n\n![vscode 01](./images/vscode_01.png)\n\n![vscode 02](./images/vscode_02.png)\n\nSee [Use tabs in windows on Mac](https://support.apple.com/guide/mac-help/use-tabs-in-windows-mchla4695cce/mac)\n\n![native tab](./images/native_tab.png)\n\n### Change keyboard mapping for windows keyboard\n\nSee the [solution](https://superuser.com/questions/158561/how-can-i-remap-windows-and-alt-keys-in-os-x/158568).\n\n![keyboard](./images/window_keyboard.png)\n\n### Change Hot keys in iTerm2\n\nGo to iTerm Preferences → Profiles, select your profile, then the Keys tab. Click Presets... and choose `Natural Text Editing`. See tbe [reference](https://apple.stackexchange.com/questions/136928/using-alt-cmd-right-left-arrow-in-iterm).\n\n![keyboard](./images/iterm2_hot_key.png)\n\n### Turn on three finger drag for your Mac trackpad\n\n![drag01](./images/three-finger-drag-01.png)\n![drag02](./images/three-finger-drag-02.png)\n\n### Change Spodlight shortcut key\n\n![spotlight](./images/spotlight.png)\n\n### Jump between words in a bash command\n\nIn iTerm2, if you want to use `Option + Right Arrow` to jump between words in a bash command, you can set it up as follows:\n\n1. Open iTerm2.\n2. In the top menu, select `iTerm2` -\u003e `Preferences`.\n3. In the Preferences window, select the `Profiles` tab.\n4. On the left side, select the profile you are using (usually `Default`).\n5. Select the `Keys` sub-tab.\n6. Click the `+` button at the bottom right to add a new key binding.\n7. In the pop-up window, set it as follows:\n   - `Keyboard Shortcut`: Press `Option + Right Arrow`.\n   - `Action`: Select `Send Escape Sequence`.\n   - `Esc+`: Enter `f`.\n\nThis way, when you press `Option + Right Arrow`, iTerm2 will send `Esc+f`, which in bash will move to the beginning of the next word.\n\nSimilarly, you can set `Option + Left Arrow` to jump to the beginning of the previous word:\n\n1. Repeat the above steps, click the `+` button to add a new key binding.\n2. In the pop-up window, set it as follows:\n   - `Keyboard Shortcut`: Press `Option + Left Arrow`.\n   - `Action`: Select `Send Escape Sequence`.\n   - `Esc+`: Enter `b`.\n\nThis way, when you press `Option + Left Arrow`, iTerm2 will send `Esc+b`, which in bash will move to the beginning of the previous word.\n\nAfter completing these settings, you should be able to use `Option + Right Arrow` and `Option + Left Arrow` to jump between words in bash commands in iTerm2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fmacbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappleboy%2Fmacbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappleboy%2Fmacbook/lists"}