├── .gitignore ├── README.md ├── kitty ├── github_dark.conf └── kitty.conf ├── setup-mac.sh ├── skhd └── skhdrc ├── tmux └── tmux.conf ├── yabai └── yabairc └── zsh └── zshrc /.gitignore: -------------------------------------------------------------------------------- 1 | .oh-my-zsh 2 | private_configs/* 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Dotfiles 2 | 3 | Dotfiles setup for MacOS 4 | 5 | ## Installation 6 | 7 | Make sure XDG_CONFIG_HOME variable is set. 8 | Make zsh to source our `zshrc`: 9 | 10 | ``` shell 11 | echo "source $XDG_CONFIG_HOME/zsh/zshrc" > ~/.zshrc 12 | ``` 13 | 14 | Run the setup file. Read through the script before running, because it contains installation of applications & utils that I use. You may comment out some steps if you don't need them. 15 | 16 | ``` shell 17 | bash setup-mac.sh 18 | ``` 19 | 20 | ## Apps 21 | 22 | Terminal: Kitty 23 | -------------------------------------------------------------------------------- /kitty/github_dark.conf: -------------------------------------------------------------------------------- 1 | # vim:ft=kitty 2 | 3 | ## name: GitHub Dark 4 | ## author: GitHub 5 | ## license: MIT 6 | 7 | #: The basic colors 8 | 9 | foreground #c9d1d9 10 | background #0d1117 11 | selection_foreground #0d1117 12 | selection_background #58a6ff 13 | 14 | 15 | #: Cursor colors 16 | 17 | cursor #58a6ff 18 | 19 | 20 | #: Tab bar colors 21 | 22 | tab_bar_background #010409 23 | active_tab_foreground #c9d1d9 24 | active_tab_background #0d1117 25 | inactive_tab_foreground #8b949e 26 | inactive_tab_background #010409 27 | 28 | 29 | #: The basic 16 colors 30 | 31 | #: black 32 | color0 #484f58 33 | color8 #6e7681 34 | 35 | #: red 36 | color1 #ff7b72 37 | color9 #ffa198 38 | 39 | #: green 40 | color2 #3fb950 41 | color10 #56d364 42 | 43 | #: yellow 44 | color3 #d29922 45 | color11 #e3b341 46 | 47 | #: blue 48 | color4 #58a6ff 49 | color12 #79c0ff 50 | 51 | #: magenta 52 | color5 #bc8cff 53 | color13 #d2a8ff 54 | 55 | #: cyan 56 | color6 #39c5cf 57 | color14 #56d4dd 58 | 59 | #: white 60 | color7 #b1bac4 61 | color15 #ffffff -------------------------------------------------------------------------------- /kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | include github_dark.conf 2 | 3 | hide_window_decorations titlebar-only 4 | window_margin_width 10 5 | 6 | macos_option_as_alt yes -------------------------------------------------------------------------------- /setup-mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o errexit 4 | set -o nounset 5 | set -o pipefail 6 | 7 | if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then 8 | echo "Usage: ./${0} 9 | 10 | A script to setup a new Mac 11 | First, ensure you have set XDG_CONFIG_HOME properly 12 | Refer: https://stackoverflow.com/questions/55648312/mac-os-x-mojave-set-environment-variable-permanently 13 | " 14 | exit 15 | fi 16 | 17 | cd "$(dirname "$0")" 18 | 19 | check_requirements() { 20 | if [[ -z XDG_CONFIG_HOME ]]; then 21 | echo "Variable XDG_CONFIG_HOME not set!!!" 22 | exit 1 23 | fi 24 | } 25 | 26 | install_apps() { 27 | brew install --cask brave-browser 28 | brew install --cask visual-studio-code 29 | brew install --cask slack 30 | brew install --cask kitty 31 | brew install --cask karabiner-elements 32 | brew install --cask obsidian 33 | 34 | brew install tmux 35 | } 36 | 37 | install_homebrew() { 38 | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 39 | } 40 | 41 | install_nvm() { 42 | brew install nvm 43 | } 44 | 45 | install_pyenv() { 46 | brew install pyenv 47 | } 48 | 49 | setup_pure_prompt() { 50 | brew install pure 51 | } 52 | 53 | install_ohmyzsh () { 54 | git clone https://github.com/ohmyzsh/ohmyzsh.git "$XDG_CONFIG_HOME/.oh-my-zsh" 55 | echo "source $XDG_CONFIG_HOME/zsh/zshrc" > "$HOME/.zshrc" 56 | } 57 | 58 | install_fzf() { 59 | brew install fzf 60 | } 61 | 62 | main() { 63 | check_requirements 64 | install_homebrew 65 | install_nvm 66 | install_pyenv 67 | install_ohmyzsh 68 | setup_pure_prompt 69 | install_fzf 70 | install_apps 71 | } 72 | 73 | main "$@" -------------------------------------------------------------------------------- /skhd/skhdrc: -------------------------------------------------------------------------------- 1 | # change window focus within space 2 | alt - j : yabai -m window --focus south 3 | alt - k : yabai -m window --focus north 4 | alt - h : yabai -m window --focus west 5 | alt - l : yabai -m window --focus east 6 | 7 | # maximize a window 8 | shift + alt - m : yabai -m window --toggle zoom-fullscreen 9 | 10 | # move window to space # 11 | shift + alt - 1 : yabai -m window --space 1; 12 | shift + alt - 2 : yabai -m window --space 2; 13 | shift + alt - 3 : yabai -m window --space 3; 14 | shift + alt - 4 : yabai -m window --space 4; 15 | shift + alt - 5 : yabai -m window --space 5; 16 | shift + alt - 6 : yabai -m window --space 6; 17 | shift + alt - 7 : yabai -m window --space 7; -------------------------------------------------------------------------------- /tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # Install TMP if not installed 2 | run-shell " \ 3 | if [ ! -d ~/.local/share/tmux/plugins/tpm ]; then \n\ 4 | git clone https://github.com/tmux-plugins/tpm ~/.local/share/tmux/plugins/tpm \n\ 5 | fi \ 6 | " 7 | set-environment -g TMUX_PLUGIN_MANAGER_PATH "~/.local/share/tmux/plugins/" 8 | 9 | # Set prefix to Ctrl+Space 10 | unbind-key C-b 11 | set-option -g prefix C-Space 12 | 13 | set-option -g default-terminal "tmux-256color" 14 | set-option -ga terminal-overrides ',xterm-256color:Tc' 15 | 16 | set -g mouse on 17 | 18 | bind-key -T copy-mode-vi v send-keys -X begin-selection 19 | bind-key -T copy-mode-vi y send-keys -X copy-selection 20 | bind-key -T copy-mode-vi r send-keys -X rectangle-toggle 21 | 22 | # Reduce number of scrolled rows per tick to 2 23 | bind -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 2 scroll-up 24 | bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down 25 | 26 | set-option -g default-shell /bin/zsh 27 | 28 | set-option -sg escape-time 10 29 | 30 | # reload config 31 | bind r source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display-message "Config reloaded..." 32 | 33 | # Alt-vim keys to switch panes 34 | bind -n M-h select-pane -L 35 | bind -n M-j select-pane -D 36 | bind -n M-k select-pane -U 37 | bind -n M-l select-pane -R 38 | 39 | # Intuitive window-splitting keys. 40 | bind-key | split-window -h -c '#{pane_current_path}' # normally prefix-% 41 | bind-key \\ split-window -h -c '#{pane_current_path}' # normally prefix-% 42 | bind-key - split-window -v -c '#{pane_current_path}' # normally prefix-" 43 | 44 | black="#100e23" 45 | cyan="#aaffe4" 46 | dark_cyan="#63f2f1" 47 | 48 | # Status bar. 49 | set -g status-justify centre 50 | set-option -g status-style bg=$black,fg=$cyan 51 | set-option -g status-left-length 40 52 | set-option -g status-left "#[bg=$dark_cyan,fg=$black] ⧉ #S #[fg=$dark_cyan,bg=$black]" 53 | set-option -g status-right "#[fg=$dark_cyan,bg=$black]#[fg=$black,bg=$dark_cyan] %Y-%m-%d | %l:%M %p " 54 | set-option -g status-interval 60 # Default is 15. 55 | 56 | set-option -g window-status-current-format "#[fg=$dark_cyan,bg=$black]#[fg=$black,bg=$dark_cyan] #W #{?window_zoomed_flag,▣ ,}#[fg=$dark_cyan,bg=$black]" 57 | set-option -g window-status-format "#[bg=$black] #I:#W " 58 | 59 | # Start window and pane numbering at 1, (0 is too hard to reach). 60 | set-option -g base-index 1 61 | set-option -g pane-base-index 1 62 | 63 | # Turn off distracting border highlight. 64 | set-option -ga pane-border-style bg=default,fg="#767676" 65 | set-option -ga pane-active-border-style bg=default,fg="#767676" 66 | 67 | # Fix issue with the cursor 68 | set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' 69 | 70 | # List of plugins 71 | set -g @tpm_plugins ' \ 72 | NHDaly/tmux-better-mouse-mode\ 73 | ' 74 | 75 | # NHDaly/tmux-better-mouse-mode Options: 76 | set -g @emulate-scroll-for-no-mouse-alternate-buffer "on" 77 | set -g @scroll-speed-num-lines-per-scroll 1 78 | 79 | # Initialize TMUX plugin manager 80 | run '~/.local/share/tmux/plugins/tpm/tpm' 81 | -------------------------------------------------------------------------------- /yabai/yabairc: -------------------------------------------------------------------------------- 1 | # default layout (can be bsp, stack or float) 2 | yabai -m config layout bsp 3 | 4 | # New window spawns to the right if vertical split, or bottom if horizontal split 5 | yabai -m config window_placement second_child 6 | 7 | # padding set to 6pt 8 | yabai -m config top_padding 6 9 | yabai -m config bottom_padding 6 10 | yabai -m config left_padding 6 11 | yabai -m config right_padding 6 12 | yabai -m config window_gap 6 13 | 14 | # center mouse on window with focus 15 | yabai -m config mouse_follows_focus on 16 | 17 | # modifier for clicking and dragging with mouse 18 | yabai -m config mouse_modifier alt 19 | # set modifier + left-click drag to move window 20 | yabai -m config mouse_action1 move 21 | # set modifier + right-click drag to resize window 22 | yabai -m config mouse_action2 resize 23 | 24 | # when window is dropped in center of another window, swap them (on edges it will split it) 25 | yabai -m mouse_drop_action swap 26 | 27 | yabai -m rule --add app="^System Settings$" manage=off 28 | yabai -m rule --add app="^Calculator$" manage=off 29 | yabai -m rule --add app="^Karabiner-Elements$" manage=off -------------------------------------------------------------------------------- /zsh/zshrc: -------------------------------------------------------------------------------- 1 | if [[ ! -v XDG_CONFIG_HOME ]]; then 2 | echo "Variable XDG_CONFIG_HOME not set!!!" 3 | fi 4 | 5 | # Tmux 6 | TERM=screen-256color 7 | 8 | # Oh-My-Zsh setup 9 | export ZSH="$XDG_CONFIG_HOME/.oh-my-zsh" 10 | ZSH_THEME="robbyrussell" 11 | plugins=(git) 12 | source $ZSH/oh-my-zsh.sh 13 | 14 | # Fixes a bug where zsh repeats the command in output 15 | # ref: https://stackoverflow.com/questions/30940299/zsh-repeats-command-in-output 16 | DISABLE_AUTO_TITLE="true" 17 | 18 | # Pure prompt 19 | fpath+=("$(brew --prefix)/share/zsh/site-functions") 20 | autoload -U promptinit; promptinit 21 | prompt pure 22 | 23 | # Nvm 24 | [ -s "$(brew --prefix)/opt/nvm/nvm.sh" ] && \. "$(brew --prefix)/opt/nvm/nvm.sh" 25 | 26 | # FZF 27 | if [[ ! "$PATH" == *$(brew --prefix)/opt/fzf/bin* ]]; then 28 | PATH="${PATH:+${PATH}:}$(brew --prefix)/opt/fzf/bin" 29 | fi 30 | source "$(brew --prefix)/opt/fzf/shell/completion.zsh" 31 | source "$(brew --prefix)/opt/fzf/shell/key-bindings.zsh" 32 | 33 | # Pyenv 34 | export PYENV_ROOT="$HOME/.pyenv" 35 | [[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH" 36 | eval "$(pyenv init --path)" 37 | 38 | # Android emulator looks for its config in $HOME, but I want it in $XDG_CONFIG_HOME 39 | alias emulator="HOME=$XDG_CONFIG_HOME emulator" 40 | --------------------------------------------------------------------------------