├── .eslintrc ├── vscode ├── User │ ├── locale.json │ ├── snippets │ │ └── snippets.json │ ├── keybindings.json │ └── settings.json └── README.md ├── sublime └── Packages │ └── User │ ├── Git Commit.sublime-settings │ ├── Package Control.sublime-settings │ ├── README.md │ ├── Preferences.sublime-settings │ └── timestamp.py ├── .gitignore ├── .editorconfig ├── README.md ├── bash └── .bash_aliases ├── .gitconfig ├── brew.sh ├── .stylelintrc └── macos.sh /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "happiness" 3 | } 4 | -------------------------------------------------------------------------------- /vscode/User/locale.json: -------------------------------------------------------------------------------- 1 | { 2 | "locale":"en" 3 | } 4 | -------------------------------------------------------------------------------- /sublime/Packages/User/Git Commit.sublime-settings: -------------------------------------------------------------------------------- 1 | // These settings override both User and Default settings for the Git Commit syntax 2 | { 3 | "rulers": [50, 72] 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Node/npm 2 | node_modules/ 3 | npm-debug.log 4 | 5 | # IDE 6 | .idea 7 | *.sublime-project 8 | *.sublime-workspace 9 | .vscode/* 10 | 11 | # OS 12 | ._* 13 | Thumbs.db 14 | .DS_Store 15 | .Trashes 16 | .Spotlight-V100 17 | .AppleDouble 18 | .LSOverride 19 | Desktop.ini 20 | -------------------------------------------------------------------------------- /vscode/User/snippets/snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "html": { 3 | "snippets": { 4 | "viewport": "", 5 | "description": "", 6 | "favicon": "" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = tab 7 | end_of_line = lf 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{json,yaml,yml,toml,md,babelrc,eslintrc,stylelintrc}] 15 | indent_style = space 16 | indent_size = 2 17 | -------------------------------------------------------------------------------- /sublime/Packages/User/Package Control.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "bootstrapped": true, 3 | "in_process_packages": 4 | [ 5 | ], 6 | "installed_packages": 7 | [ 8 | "Autoprefixer", 9 | "BracketHighlighter", 10 | "Color Highlight", 11 | "Emmet", 12 | "ESLint", 13 | "Gulp", 14 | "HTML-CSS-JS Prettify", 15 | "MarkdownEditing", 16 | "Minifier", 17 | "Package Control", 18 | "SublimeLinter", 19 | "SublimeLinter-eslint", 20 | "SublimeLinter-html-tidy" 21 | "SublimeLinter-stylelint", 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /sublime/Packages/User/README.md: -------------------------------------------------------------------------------- 1 | # Sublime Text 3 Preferences 2 | 3 | **Package Control Settings: [Package Control.sublime-settings](https://github.com/vimux/dotfiles/blob/master/sublime/Package%20Control.sublime-settings)** 4 | 5 | A list of the packages installed through [Package Control](https://packagecontrol.io/) 6 | 7 | **User Preferences: [Preferences.sublime-settings](https://github.com/vimux/dotfiles/blob/master/sublime/Preferences.sublime-settings)** 8 | 9 | A list of my personal Sublime Text preferences 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | 3 | My macOS dotfiles 4 | 5 | ## Overview 6 | 7 | | Name | Description | 8 | | --- | --- | 9 | | `sublime` | Sublime Text 3 settings | 10 | | `vscode` | Visual Studio Code settings | 11 | | `.gitconfig` | Git configuration file | 12 | | `.gitignore` | The ignore file that I use | 13 | | `.editorconfig` | Unify code style | 14 | | `.eslintrc` | ESLint settings for linting JS code | 15 | | `.stylelintrc` | Stylelint settings that helps me write consistent stylesheets | 16 | | `macos.sh` | Customize macOS defaults settings | 17 | | `brew.sh` | Install Homebrew formulae | 18 | -------------------------------------------------------------------------------- /vscode/User/keybindings.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "key": "cmd+e", "command": "workbench.action.quickOpenPreviousEditor" }, 3 | { "key": "cmd+g", "command": "workbench.action.gotoLine" }, 4 | { "key": "cmd+y", "command": "editor.action.deleteLines", 5 | "when": "editorTextFocus && !editorReadonly" }, 6 | { "key": "ctrl+g", "command": "editor.action.addSelectionToNextFindMatch", 7 | "when": "editorFocus" }, 8 | { "key": "alt+down", "command": "editor.action.insertCursorBelow", 9 | "when": "editorTextFocus" }, 10 | ] 11 | -------------------------------------------------------------------------------- /sublime/Packages/User/Preferences.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "bold_folder_labels": true, 3 | "default_line_ending": "unix", 4 | "draw_white_space": "all", 5 | "enable_tab_scrolling": false, 6 | "folder_exclude_patterns": 7 | [ 8 | ".svn", 9 | ".git", 10 | ".hg", 11 | ".sass-cache", 12 | "tmp" 13 | ], 14 | "highlight_line": true, 15 | "highlight_modified_tabs": true, 16 | "overlay_scroll_bars": "enabled", 17 | "preview_on_click": false, 18 | "show_encoding": true, 19 | "show_full_path": true, 20 | "show_line_endings": true, 21 | "tab_size": 4, 22 | "theme": "Adaptive.sublime-theme", 23 | "trim_trailing_white_space_on_save": true 24 | } 25 | -------------------------------------------------------------------------------- /vscode/User/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.fontFamily": "Source code Pro, monospace", 3 | "editor.fontSize": 14, 4 | "editor.roundedSelection": false, 5 | "editor.renderWhitespace": "all", 6 | "editor.renderIndentGuides": false, 7 | "editor.renderLineHighlight": "line", 8 | "editor.matchBrackets": false, 9 | "editor.minimap.enabled": false, 10 | "files.eol": "\n", 11 | "telemetry.enableCrashReporter": false, 12 | "telemetry.enableTelemetry": false, 13 | "workbench.colorCustomizations": { 14 | "statusBar.background" : "#1a1a1a", 15 | "statusBar.noFolderBackground" : "#212121", 16 | "statusBar.debuggingBackground": "#263238" 17 | }, 18 | "workbench.statusBar.feedback.visible": false, 19 | "workbench.editor.enablePreview": false, 20 | "workbench.editor.showIcons": false, 21 | "window.openFilesInNewWindow": "off", 22 | "window.openFoldersInNewWindow": "off" 23 | } 24 | -------------------------------------------------------------------------------- /vscode/README.md: -------------------------------------------------------------------------------- 1 | # Visual Studio Code settings 2 | 3 | ## Synchronization 4 | 5 | ```shell 6 | rm -rf ~/Library/Application\ Support/Code/User 7 | ln -s ~/dotfiles/vscode/User ~/Library/Application\ Support/Code/User 8 | ``` 9 | 10 | ## Plugins 11 | 12 | * [GitHub Pull Requests](https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github) 13 | * [EditorConfig for VS Code](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig) 14 | * [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) 15 | * [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) 16 | * [LiveServer](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) 17 | * [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) 18 | * [stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint) 19 | -------------------------------------------------------------------------------- /sublime/Packages/User/timestamp.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import sublime, sublime_plugin 3 | 4 | # Sublime Text 3 plug-in to insert current local and UTC timestamps (ISO 8601) 5 | # Type 'date', 'datetime', 'now', 'utcdate', 'utcdatetime', 'utcnow' and then hit TAB. 6 | 7 | class TimestampCommand(sublime_plugin.EventListener): 8 | def on_query_completions(self, view, prefix, locations): 9 | if prefix in ("date", "datetime", "now"): # 2020-10-30T11:01:33-04:00 10 | # https://stackoverflow.com/questions/2150739/iso-time-iso-8601-in-python/28147286#28147286 11 | # Local to ISO 8601 with TimeZone information 12 | stamp = ( 13 | datetime.datetime.utcnow() 14 | .replace(tzinfo=datetime.timezone.utc) 15 | .astimezone() 16 | .replace(microsecond=0) 17 | .isoformat() 18 | ) 19 | elif prefix in ("utcdate", "utcdatetime", "utcnow"): # 2020-10-30T15:01:33-00:00 20 | # UTC to ISO 8601 with TimeZone information 21 | stamp = ( 22 | datetime.datetime.utcnow() 23 | .replace(tzinfo=datetime.timezone.utc, microsecond=0) 24 | .isoformat() 25 | ) 26 | else: 27 | stamp = None 28 | 29 | return [(prefix, prefix, stamp)] if stamp else [] 30 | -------------------------------------------------------------------------------- /bash/.bash_aliases: -------------------------------------------------------------------------------- 1 | # .bash_aliases - bash shell aliases and functions 2 | 3 | # ALIASES 4 | 5 | # Enable aliases to be sudo’ed 6 | alias sudo="sudo " 7 | 8 | # Navigation 9 | alias ..="cd .." 10 | alias ...="cd ../.." 11 | alias ....="cd ../../.." 12 | alias .....="cd ../../../.." 13 | alias ..2="cd ../.." 14 | alias ..3="cd ../../.." 15 | alias ..4="cd ../../../.." 16 | alias ..5="cd ../../../../.." 17 | 18 | # Shortcuts 19 | alias code="cd ~/code" 20 | alias sites="cd ~/sites" 21 | alias projects="cd ~/projects" 22 | 23 | # Synonyms 24 | alias quit="exit" 25 | alias where="which" 26 | 27 | # Edit hosts file 28 | alias hosts="sudo nano /etc/hosts" 29 | 30 | # OS specific aliases 31 | if [ "$(uname)" == "Darwin" ]; then 32 | # Local IP on en0 network interface 33 | alias iplocal="ipconfig getifaddr en0" 34 | fi 35 | 36 | # FUNCTIONS 37 | 38 | # Create dir and navigate into it 39 | mkcd() { 40 | mkdir -p -- "$1" && 41 | cd -P -- "$1" 42 | } 43 | 44 | # FFmpeg: convert video to webm (2-pass constant quality mode, VP9 + Opus) 45 | # https://trac.ffmpeg.org/wiki/Encode/VP9 46 | webmconv() { 47 | ffmpeg -hide_banner -i $1 -c:v libvpx-vp9 -b:v 0 -crf 30 -pass 1 -an -f webm -y /dev/null && \ 48 | ffmpeg -hide_banner -i $1 -c:v libvpx-vp9 -b:v 0 -crf 30 -pass 2 -c:a libopus $2 49 | } 50 | -------------------------------------------------------------------------------- /.gitconfig: -------------------------------------------------------------------------------- 1 | [core] 2 | # Do not forget to make a symlink to subl 3 | # ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl 4 | editor = subl -n -w 5 | 6 | # Use custom `.gitignore` and `.gitattributes` 7 | excludesfile = ~/.gitignore 8 | attributesfile = ~/.gitattributes 9 | 10 | # Make `git rebase` safer on macOS 11 | # More info: 12 | trustctime = false 13 | 14 | [alias] 15 | # Commit 16 | c = commit 17 | 18 | # Diff 19 | d = diff 20 | 21 | # View the current working tree status using the short format 22 | s = status -s 23 | 24 | # View abbreviated SHA, description, and history graph of the latest 20 commits 25 | l = log --pretty=oneline -n 20 --graph --abbrev-commit 26 | 27 | # Amend to the latest commit 28 | amend = commit --amend 29 | 30 | # Show verbose output about tags, branches, remotes, aliases and contributors 31 | tags = tag -l 32 | branches = branch -a 33 | remotes = remote -v 34 | aliases = config --get-regexp alias 35 | contributors = shortlog --summary --numbered 36 | 37 | [color] 38 | ui = auto 39 | 40 | [color "branch"] 41 | current = yellow reverse 42 | local = yellow 43 | remote = green 44 | 45 | [color "diff"] 46 | meta = yellow bold 47 | frag = magenta bold # line info 48 | old = red # deletions 49 | new = green # additions 50 | 51 | [color "status"] 52 | added = yellow 53 | changed = green 54 | untracked = cyan 55 | 56 | [commit] 57 | # https://help.github.com/articles/signing-commits-using-gpg/ 58 | gpgsign = true 59 | -------------------------------------------------------------------------------- /brew.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Install command-line tools using Homebrew 4 | 5 | # Turn off analytics 6 | # https://docs.brew.sh/Analytics 7 | brew analytics off 8 | 9 | # Make sure we’re using the latest Homebrew 10 | brew update 11 | 12 | # Upgrade any already-installed formulae 13 | brew upgrade 14 | 15 | # Save Homebrew’s installed location 16 | BREW_PREFIX=$(brew --prefix) 17 | 18 | # Install GNU core utilities (those that come with macOS are outdated) 19 | # Don’t forget to add `$(brew --prefix coreutils)/libexec/gnubin` to `$PATH` 20 | brew install coreutils 21 | ln -s "${BREW_PREFIX}/bin/gsha256sum" "${BREW_PREFIX}/bin/sha256sum" 22 | 23 | # Install some other useful utilities like `sponge` 24 | brew install moreutils 25 | # Install GNU `find`, `locate`, `updatedb`, and `xargs`, `g`-prefixed 26 | brew install findutils 27 | # Install GNU `sed`, overwriting the built-in `sed` 28 | brew install gnu-sed 29 | # Install a modern version of Bash 30 | brew install bash 31 | brew install bash-completion@2 32 | 33 | # Switch to using brew-installed bash as default shell 34 | if ! grep -Fq "${BREW_PREFIX}/bin/bash" /etc/shells; then 35 | echo "${BREW_PREFIX}/bin/bash" | sudo tee -a /etc/shells; 36 | chsh -s "${BREW_PREFIX}/bin/bash"; 37 | fi; 38 | 39 | # Install `wget` 40 | brew install wget 41 | 42 | # Install GnuPG to enable PGP-signing commits 43 | brew install gnupg 44 | 45 | # Install more recent versions of some macOS tools 46 | brew install grep 47 | brew install openssh 48 | brew install screen 49 | 50 | # Install other useful binaries 51 | brew install git 52 | brew install git-lfs 53 | brew install node 54 | brew install webp 55 | brew install imagemagick 56 | brew install p7zip 57 | brew install pigz 58 | brew install pv 59 | brew install ssh-copy-id 60 | brew install tree 61 | brew install vbindiff 62 | brew install zopfli 63 | brew install ffmpeg 64 | brew install youtube-dl 65 | 66 | # Remove outdated versions from the cellar 67 | brew cleanup 68 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "at-rule-empty-line-before": [ 4 | "always", 5 | { 6 | "except": [ 7 | "blockless-after-same-name-blockless", 8 | "first-nested" 9 | ], 10 | "ignore": [ 11 | "after-comment" 12 | ] 13 | } 14 | ], 15 | "at-rule-name-case": "lower", 16 | "at-rule-name-space-after": "always-single-line", 17 | "at-rule-semicolon-newline-after": "always", 18 | "block-closing-brace-newline-after": "always", 19 | "block-closing-brace-empty-line-before": "never", 20 | "block-no-empty": true, 21 | "block-opening-brace-newline-after": "always-multi-line", 22 | "color-hex-case": "lower", 23 | "color-hex-length": "short", 24 | "color-no-invalid-hex": true, 25 | "comment-no-empty": true, 26 | "declaration-bang-space-after": "never", 27 | "declaration-bang-space-before": "always", 28 | "declaration-block-no-duplicate-properties": [ 29 | true, 30 | { 31 | "ignore": [ 32 | "consecutive-duplicates-with-different-values" 33 | ] 34 | } 35 | ], 36 | "declaration-block-no-shorthand-property-overrides": true, 37 | "declaration-block-semicolon-newline-after": "always-multi-line", 38 | "declaration-block-semicolon-space-after": "always-single-line", 39 | "declaration-block-semicolon-space-before": "never", 40 | "declaration-block-single-line-max-declarations": 1, 41 | "declaration-block-trailing-semicolon": "always", 42 | "declaration-colon-newline-after": "always-multi-line", 43 | "declaration-colon-space-after": "always-single-line", 44 | "declaration-colon-space-before": "never", 45 | "font-family-no-duplicate-names": true, 46 | "function-calc-no-unspaced-operator": true, 47 | "function-comma-newline-after": "always-multi-line", 48 | "function-comma-space-after": "always-single-line", 49 | "function-comma-space-before": "never", 50 | "function-linear-gradient-no-nonstandard-direction": true, 51 | "function-max-empty-lines": 0, 52 | "function-name-case": "lower", 53 | "function-parentheses-newline-inside": "always-multi-line", 54 | "function-parentheses-space-inside": "never-single-line", 55 | "function-whitespace-after": "always", 56 | "indentation": "tab", 57 | "keyframe-declaration-no-important": true, 58 | "length-zero-no-unit": true, 59 | "max-empty-lines": 1, 60 | "media-feature-colon-space-after": "always", 61 | "media-feature-colon-space-before": "never", 62 | "media-feature-name-case": "lower", 63 | "media-feature-name-no-unknown": true, 64 | "media-feature-parentheses-space-inside": "never", 65 | "media-feature-range-operator-space-after": "always", 66 | "media-feature-range-operator-space-before": "always", 67 | "media-query-list-comma-newline-after": "always-multi-line", 68 | "media-query-list-comma-space-after": "always-single-line", 69 | "media-query-list-comma-space-before": "never", 70 | "no-empty-source": true, 71 | "no-eol-whitespace": true, 72 | "no-extra-semicolons": true, 73 | "no-invalid-double-slash-comments": true, 74 | "no-missing-end-of-source-newline": true, 75 | "number-no-trailing-zeros": true, 76 | "property-case": "lower", 77 | "property-no-unknown": true, 78 | "selector-attribute-brackets-space-inside": "never", 79 | "selector-attribute-operator-space-after": "never", 80 | "selector-attribute-operator-space-before": "never", 81 | "selector-combinator-space-after": "always", 82 | "selector-combinator-space-before": "always", 83 | "selector-descendant-combinator-no-non-space": true, 84 | "selector-list-comma-newline-after": "always", 85 | "selector-list-comma-space-before": "never", 86 | "selector-pseudo-class-case": "lower", 87 | "selector-pseudo-class-no-unknown": true, 88 | "selector-pseudo-class-parentheses-space-inside": "never", 89 | "selector-pseudo-element-case": "lower", 90 | "selector-pseudo-element-colon-notation": "double", 91 | "selector-pseudo-element-no-unknown": true, 92 | "selector-type-case": "lower", 93 | "selector-type-no-unknown": true, 94 | "shorthand-property-no-redundant-values": true, 95 | "string-no-newline": true, 96 | "unit-case": "lower", 97 | "unit-no-unknown": true, 98 | "value-list-comma-newline-after": "always-multi-line", 99 | "value-list-comma-space-after": "always-single-line", 100 | "value-list-comma-space-before": "never", 101 | "value-list-max-empty-lines": 0 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /macos.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Customize macOS defaults settings 4 | 5 | # Ask for the administrator password upfront 6 | sudo -v 7 | 8 | # Keep-alive: update existing `sudo` time stamp until `.macos` has finished 9 | while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & 10 | 11 | # Boot macOS in verbose mode 12 | sudo nvram boot-args="-v" 13 | 14 | ############################################################################### 15 | # General # 16 | ############################################################################### 17 | 18 | # Set highlight color to graphite 19 | defaults write NSGlobalDomain AppleHighlightColor -string "0.847059 0.847059 0.862745" 20 | 21 | # Set sidebar icon size to medium 22 | defaults write NSGlobalDomain NSTableViewDefaultSizeMode -int 2 23 | 24 | # Expand save panel by default 25 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true 26 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true 27 | 28 | # Expand print panel by default 29 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true 30 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true 31 | 32 | # Save to disk (not to iCloud) by default 33 | defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false 34 | 35 | # Disable Notification Center and remove the menu bar icon 36 | launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist 2> /dev/null 37 | 38 | ############################################################################### 39 | # Dock and Hot Corners # 40 | ############################################################################### 41 | 42 | # Enable highlight hover effect for the grid view of a stack (Dock) 43 | defaults write com.apple.dock mouse-over-hilite-stack -bool true 44 | 45 | # Set the icon size of Dock items to 54 pixels 46 | defaults write com.apple.dock tilesize -int 54 47 | 48 | # Change minimize/maximize window effect 49 | defaults write com.apple.dock mineffect -string "scale" 50 | 51 | # Minimize windows into their application’s icon 52 | defaults write com.apple.dock minimize-to-application -bool true 53 | 54 | # Dock orientation: "left", "bottom", "right" 55 | defaults write com.apple.dock "orientation" -string "left" 56 | 57 | # Show indicator lights for open applications in the Dock 58 | defaults write com.apple.dock show-process-indicators -bool true 59 | 60 | # Don’t animate opening applications from the Dock 61 | defaults write com.apple.dock launchanim -bool false 62 | 63 | # Don’t show recent applications in Dock 64 | defaults write com.apple.dock show-recents -bool false 65 | 66 | # Disable Hot corners 67 | # Possible values: 68 | # 0: no-op 69 | # 2: Mission Control 70 | # 3: Show application windows 71 | # 4: Desktop 72 | # 5: Start screen saver 73 | # 6: Disable screen saver 74 | # 7: Dashboard 75 | # 10: Put display to sleep 76 | # 11: Launchpad 77 | # 12: Notification Center 78 | # Top left screen corner 79 | defaults write com.apple.dock wvous-tl-corner -int 0 80 | defaults write com.apple.dock wvous-tl-modifier -int 0 81 | # Top right screen corner 82 | defaults write com.apple.dock wvous-tr-corner -int 0 83 | defaults write com.apple.dock wvous-tr-modifier -int 0 84 | # Bottom left screen corner 85 | defaults write com.apple.dock wvous-bl-corner -int 0 86 | defaults write com.apple.dock wvous-bl-modifier -int 0 87 | # Bottom right screen corner 88 | defaults write com.apple.dock wvous-br-corner -int 0 89 | defaults write com.apple.dock wvous-br-modifier -int 0 90 | 91 | ############################################################################### 92 | # Screen # 93 | ############################################################################### 94 | 95 | # Require password immediately after sleep or screen saver begins 96 | defaults write com.apple.screensaver askForPassword -int 1 97 | defaults write com.apple.screensaver askForPasswordDelay -int 0 98 | 99 | # Save screenshots to the desktop 100 | defaults write com.apple.screencapture location -string "${HOME}/Desktop" 101 | 102 | # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF) 103 | defaults write com.apple.screencapture type -string "png" 104 | 105 | # Disable shadow in screenshots 106 | defaults write com.apple.screencapture disable-shadow -bool true 107 | 108 | ############################################################################### 109 | # Keyboard # 110 | ############################################################################### 111 | 112 | # Set fast keyboard repeat rate 113 | defaults write NSGlobalDomain KeyRepeat -int 2 114 | defaults write NSGlobalDomain InitialKeyRepeat -int 15 115 | 116 | # Disable automatic capitalization as it’s annoying when typing code 117 | defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false 118 | 119 | # Disable smart dashes as they’re annoying when typing code 120 | defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false 121 | 122 | # Disable automatic period substitution as it’s annoying when typing code 123 | defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false 124 | 125 | # Disable smart quotes as they’re annoying when typing code 126 | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false 127 | 128 | # Disable auto-correct 129 | defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false 130 | 131 | ############################################################################### 132 | # Mouse # 133 | ############################################################################### 134 | 135 | # Disable “natural” scrolling 136 | defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false 137 | 138 | ############################################################################### 139 | # Date & Time # 140 | ############################################################################### 141 | 142 | # Show date and time in the menu bar 143 | defaults write com.apple.menuextra.clock "DateFormat" "EEE MMM d H.mm" 144 | 145 | # Set the timezone; see `sudo systemsetup -listtimezones` for other values 146 | sudo systemsetup -settimezone "Europe/Moscow" > /dev/null 147 | 148 | ############################################################################### 149 | # Finder # 150 | ############################################################################### 151 | 152 | # Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons 153 | defaults write com.apple.finder QuitMenuItem -bool true 154 | 155 | # Finder: disable window animations and Get Info animations 156 | defaults write com.apple.finder DisableAllAnimations -bool true 157 | 158 | # Don't show icons for hard drives, servers, and removable media on the desktop 159 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool false 160 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool false 161 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool false 162 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false 163 | 164 | # Finder: show hidden files by default 165 | defaults write com.apple.finder AppleShowAllFiles -bool true 166 | 167 | # Finder: show all filename extensions 168 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 169 | 170 | # Finder: show status bar 171 | defaults write com.apple.finder ShowStatusBar -bool true 172 | 173 | # Finder: show path bar 174 | defaults write com.apple.finder ShowPathbar -bool true 175 | 176 | # Keep folders on top when sorting by name 177 | defaults write com.apple.finder _FXSortFoldersFirst -bool true 178 | 179 | # Disable the warning when changing a file extension 180 | defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false 181 | 182 | # Avoid creating .DS_Store files on network or USB volumes 183 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 184 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true 185 | 186 | # Use list view in all Finder windows by default 187 | # Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv` 188 | defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv" 189 | 190 | # Disable the warning before emptying the Trash 191 | defaults write com.apple.finder WarnOnEmptyTrash -bool false 192 | 193 | # Show the ~/Library folder 194 | chflags nohidden ~/Library 195 | 196 | ############################################################################### 197 | # Safari & WebKit # 198 | ############################################################################### 199 | 200 | # Privacy: don’t send search queries to Apple 201 | defaults write com.apple.Safari UniversalSearchEnabled -bool false 202 | defaults write com.apple.Safari SuppressSearchSuggestions -bool true 203 | 204 | # Press Tab to highlight each item on a web page 205 | # defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true 206 | # defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true 207 | 208 | # Show the full URL in the address bar (note: this still hides the scheme) 209 | defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true 210 | 211 | # Set Safari’s home page to `about:blank` for faster loading 212 | defaults write com.apple.Safari HomePage -string "about:blank" 213 | 214 | # Prevent Safari from opening ‘safe’ files automatically after downloading 215 | defaults write com.apple.Safari AutoOpenSafeDownloads -bool false 216 | 217 | # Make Safari’s search banners default to Contains instead of Starts With 218 | # defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false 219 | 220 | # Enable the Develop menu and the Web Inspector in Safari 221 | defaults write com.apple.Safari IncludeDevelopMenu -bool true 222 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true 223 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true 224 | 225 | # Add a context menu item for showing the Web Inspector in web views 226 | defaults write NSGlobalDomain WebKitDeveloperExtras -bool true 227 | 228 | # Enable continuous spellchecking 229 | defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true 230 | # Disable auto-correct 231 | defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false 232 | 233 | # Disable AutoFill 234 | defaults write com.apple.Safari AutoFillFromAddressBook -bool false 235 | defaults write com.apple.Safari AutoFillPasswords -bool false 236 | defaults write com.apple.Safari AutoFillCreditCardData -bool false 237 | defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false 238 | 239 | # Warn about fraudulent websites 240 | defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true 241 | 242 | # Disable plug-ins 243 | defaults write com.apple.Safari WebKitPluginsEnabled -bool false 244 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false 245 | 246 | # Disable Java 247 | defaults write com.apple.Safari WebKitJavaEnabled -bool false 248 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false 249 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles -bool false 250 | 251 | # Block pop-up windows 252 | defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false 253 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false 254 | 255 | # Enable “Do Not Track” 256 | defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true 257 | 258 | # Update extensions automatically 259 | defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true 260 | 261 | ############################################################################### 262 | # Terminal # 263 | ############################################################################### 264 | 265 | # Only use UTF-8 in Terminal.app 266 | defaults write com.apple.terminal StringEncodings -array 4 267 | 268 | ############################################################################### 269 | # iTerm2 # 270 | ############################################################################### 271 | 272 | # Don’t display the annoying prompt when quitting iTerm 273 | defaults write com.googlecode.iterm2 PromptOnQuit -bool false 274 | 275 | ############################################################################### 276 | # Time Machine # 277 | ############################################################################### 278 | 279 | # Prevent Time Machine from prompting to use new hard drives as backup volume 280 | defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true 281 | 282 | ############################################################################### 283 | # Activity Monitor # 284 | ############################################################################### 285 | 286 | # Show all processes in Activity Monitor 287 | defaults write com.apple.ActivityMonitor ShowCategory -int 0 288 | 289 | # Sort Activity Monitor results by CPU usage 290 | defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage" 291 | defaults write com.apple.ActivityMonitor SortDirection -int 0 292 | 293 | ############################################################################### 294 | # Kill affected applications # 295 | ############################################################################### 296 | 297 | for app in "Activity Monitor" \ 298 | "cfprefsd" \ 299 | "Dock" \ 300 | "Finder" \ 301 | "Safari" \ 302 | "SystemUIServer" \ 303 | "Terminal"; do 304 | killall "${app}" &> /dev/null 305 | done 306 | 307 | echo "Done. Note that some of these changes may require a logout/restart to take effect." 308 | --------------------------------------------------------------------------------