Skip to content

Commit 18fc29d

Browse files
chore: modernize dotfiles configuration
- Update git aliases to use safer --force-with-lease - Enable GPG signing for commits - Migrate Python 2 to Python 3 commands - Replace hardcoded paths with $HOME variable - Remove deprecated commands (brew prune, GREP_OPTIONS) - Add Docker CLI completions for zsh - Consolidate mise activation - Update VSCode Continue extension path
1 parent 4f4f5ef commit 18fc29d

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
lines changed

.aliases

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ alias sv3=sv
2929
alias undopush="git push -f origin HEAD^:master"
3030

3131
alias gp='git push origin HEAD'
32-
alias gpf='git push origin HEAD -f'
32+
alias gpf='git push origin HEAD --force-with-lease'
33+
alias gpff='git push origin HEAD --force'
3334
alias gd='git diff'
3435
alias gds='git diff --staged'
3536
alias gl='git log'
@@ -69,7 +70,7 @@ alias cleanup="find . -name '*.DS_Store' -type f -ls -delete"
6970
alias pycclean='find . -name \*.pyc -type f -ls -delete'
7071

7172
# Remove unlinked packages + stale links on MacOS
72-
alias cleanmac="brew cleanup -s; brew prune"
73+
alias cleanmac="brew cleanup -s"
7374

7475
alias df='df -h'
7576
alias du='du -hs'

.bashrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ export PATH="$PATH:$HOME/.rvm/bin"
55

66
# Generated for envman. Do not edit.
77
[ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh"
8-
if [ -f "/Users/sanyamkhurana/.config/fabric/fabric-bootstrap.inc" ]; then . "/Users/sanyamkhurana/.config/fabric/fabric-bootstrap.inc"; fi
8+
if [ -f "$HOME/.config/fabric/fabric-bootstrap.inc" ]; then . "$HOME/.config/fabric/fabric-bootstrap.inc"; fi

.exports

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ export EDITOR="vim"
99
# Don’t clear the screen after quitting a manual page
1010
export MANPAGER="less -X"
1111

12-
# Larger bash history (allow 32³ entries; default is 500)
12+
# Larger history (allow 32³ entries; default is 500)
13+
# Note: .zshrc may override HISTSIZE/SAVEHIST for zsh
1314
export HISTSIZE=32768
1415
export HISTFILESIZE=$HISTSIZE
16+
export SAVEHIST=$HISTSIZE
1517
export HISTCONTROL=ignoredups
1618

1719
# timestamps for bash history. www.debian-administration.org/users/rossen/weblog/1
@@ -46,7 +48,8 @@ export PATH=/usr/local/mysql/bin/:$PATH
4648
export PATH=$PATH:$HOME/bin/ec2/bin # Add PATH to ec2 commandline tools.
4749

4850
# grep stuff
49-
export GREP_OPTIONS='--color'
51+
# GREP_OPTIONS is deprecated - use alias instead
52+
alias grep='grep --color=auto'
5053

5154
export PATH="/usr/local/opt/openssl/bin:$PATH"
5255

.functions

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ function l () {
144144
# Usage: `json '{"foo":42}'` or `echo '{"foo":42}' | json`
145145
function json() {
146146
if [ -t 0 ]; then # argument
147-
python -mjson.tool <<< "$*" | pygmentize -l javascript
147+
python3 -mjson.tool <<< "$*" | pygmentize -l javascript
148148
else # pipe
149-
python -mjson.tool | pygmentize -l javascript
149+
python3 -mjson.tool | pygmentize -l javascript
150150
fi
151151
}
152152

@@ -187,9 +187,7 @@ function httpcompression() {
187187
function server() {
188188
local port="${1:-8000}"
189189
sleep 1 && open "http://localhost:${port}/" &
190-
# Set the default Content-Type to `text/plain` instead of `application/octet-stream`
191-
# And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
192-
python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port"
190+
python3 -m http.server "$port"
193191
}
194192

195193

.gitconfig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,8 @@
140140
141141
[push]
142142
143-
# Use the Git 1.x.x default to avoid errors on machines with old Git
144-
# installations. To use `simple` instead, add this to your `~/.extra` file:
145-
# `git config --global push.default simple`. See http://git.io/mMah-w.
146-
default = matching
143+
# Push only the current branch to its upstream branch
144+
default = simple
147145
# Make `git push` push relevant annotated tags when pushing branches out.
148146
followTags = true
149147
@@ -176,7 +174,7 @@
176174
177175
[commit]
178176
template = ~/.gitmessage
179-
# gpgsign = true
177+
gpgsign = true
180178
181179
[includeIf "gitdir:~/work/"]
182180
path = ~/work/.gitconfig

.inputrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ set match-hidden-files off
1818
# Show all autocomplete results at once
1919
set page-completions off
2020

21-
# Immediately show all possible completions
22-
set show-all-if-ambiguous on
23-
2421
# If there are more than 200 possible completions for a word, ask to show them all
2522
set completion-query-items 200
2623

.zshrc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@ source ~/.profile
2323
# COMPLETION_WAITING_DOTS="true"
2424

2525
HISTFILE=~/.histfile
26-
HISTSIZE=5000
27-
SAVEHIST=5000
26+
# HISTSIZE and SAVEHIST are set in .exports (32768)
27+
# Uncomment below to override:
28+
# HISTSIZE=5000
29+
# SAVEHIST=5000
2830
bindkey -v
2931
bindkey '^R' history-incremental-search-backward
3032
bindkey "\e[B" history-search-forward
3133
bindkey "\e[A" history-search-backward
32-
export PATH="/usr/local/opt/node@8/bin:$PATH"
3334
export PATH="/usr/local/opt/gettext/bin:$PATH"
3435

3536
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
3637
export PATH="$PATH:$HOME/.rvm/bin"
3738

3839
# Enable buildpack `packs` completion for docker
39-
. $(pack completion --shell zsh)
40+
command -v pack >/dev/null && . $(pack completion --shell zsh)
4041
source ~/powerlevel10k/powerlevel10k.zsh-theme
4142

4243
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
@@ -53,9 +54,8 @@ export NVM_DIR="$HOME/.nvm"
5354
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
5455

5556
# BEGIN SNIPPET: Platform.sh CLI configuration
56-
HOME=${HOME:-'/Users/sanyamkhurana'}
57-
export PATH="$HOME/"'.platformsh/bin':"$PATH"
58-
if [ -f "$HOME/"'.platformsh/shell-config.rc' ]; then . "$HOME/"'.platformsh/shell-config.rc'; fi # END SNIPPET
57+
export PATH="$HOME/.platformsh/bin:$PATH"
58+
if [ -f "$HOME/.platformsh/shell-config.rc" ]; then . "$HOME/.platformsh/shell-config.rc"; fi # END SNIPPET
5959

6060
# >>> conda initialize >>>
6161
# !! Contents within this block are managed by 'conda init' !!
@@ -76,7 +76,10 @@ unset __conda_setup
7676
# Generated for envman. Do not edit.
7777
[ -s "$HOME/.config/envman/load.sh" ] && source "$HOME/.config/envman/load.sh"
7878
export PATH="/opt/homebrew/opt/postgresql@16/bin:$PATH"
79-
eval "$(/Users/sanyamkhurana/.local/bin/mise activate zsh)"
80-
eval "$(mise activate)"
8179
eval "$(~/.local/bin/mise activate zsh)"
82-
if [ -f "/Users/sanyamkhurana/.config/fabric/fabric-bootstrap.inc" ]; then . "/Users/sanyamkhurana/.config/fabric/fabric-bootstrap.inc"; fi
80+
if [ -f "$HOME/.config/fabric/fabric-bootstrap.inc" ]; then . "$HOME/.config/fabric/fabric-bootstrap.inc"; fi
81+
# The following lines have been added by Docker Desktop to enable Docker CLI completions.
82+
fpath=(/Users/sanyamkhurana/.docker/completions $fpath)
83+
autoload -Uz compinit
84+
compinit
85+
# End of Docker CLI completions

setup/vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
},
106106
"github.copilot.nextEditSuggestions.enabled": true,
107107
"yaml.schemas": {
108-
"file:///Users/sanyamkhurana/.vscode/extensions/continue.continue-1.3.16-darwin-arm64/config-yaml-schema.json": [
108+
"file:///Users/sanyamkhurana/.vscode/extensions/continue.continue-1.3.20-darwin-arm64/config-yaml-schema.json": [
109109
".continue/**/*.yaml"
110110
]
111111
},

0 commit comments

Comments
 (0)