-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.macos
executable file
·56 lines (41 loc) · 1.54 KB
/
.macos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/zsh
# Override some of the vscode settings for macOS
function __set_vscode_settings() {
set -e
# Copy settings files
if [ -d "$HOME/Library/Application Support/Code/User" ]; then
rsync -avh init/vscode/ "$HOME/Library/Application Support/Code/User"
fi
# Disable Press and Hold
defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
}
# Set additional git configs for macOS
function __set_gitconfig() {
# Setup the credential helper
git config --global credential.helper osxkeychain
}
# Set the defaults for macOS finder
function __set_macos_defaults() {
# Disable Press and Hold
defaults write com.google.Chrome ApplePressAndHoldEnabled -bool false
# Finder: show path bar
defaults write com.apple.finder ShowPathbar -bool true
# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true
# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true
# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write com.apple.finder _FXSortFoldersFirstOnDesktop -bool true
# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
}
# Run the functions in order
function main() {
__set_macos_defaults
__set_gitconfig
__set_vscode_settings
return 0
}
main "${@}"