-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
75 lines (64 loc) · 2.09 KB
/
.aliases
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Check if eza exists and alias ls to eza
if command -v eza >/dev/null 2>&1; then
alias ls=eza
fi
alias la="ls -AlH" # Show hidden files, detailed listing
alias ll="ls -lH" # Detailed listing
alias lt="ls --tree" # Display directory as a tree
alias ld="ls -ld */" # List only directories
alias lg=lazygit
# Check if zoxide exists and alias cd to zoxide
if command -v zoxide >/dev/null 2>&1; then
alias cd=z
alias zi="z -i" # Interactive mode for zoxide
alias zb="z -b" # Jump to the best match
fi
# Check if bat exists and alias cat to bat
if command -v bat >/dev/null 2>&1; then
alias cat="bat --style=plain --paging=never"
alias batn="bat --style=numbers" # Bat with line numbers
alias batc="bat --style=changes" # Bat with Git diff highlights
fi
# Directory navigation aliases
alias ..="cd .."
alias ...="cd ../../"
alias ....="cd ../../../"
alias -- -="cd -" # Go back to the previous directory
# Editor aliases
alias vim=nvim
alias v=nvim
alias edit=nvim
# Git aliases
alias gs="git status"
alias ga="git add"
alias gA="git add -A"
alias gr="git restore"
alias grs="git restore --staged"
alias gc="git commit"
alias gcm="git commit -m"
alias gP="git push"
alias gPf="git push --force-with-lease"
alias gPF="git push --force"
alias ga="git add"
alias gp="git pull"
alias gl="git log --oneline --graph --decorate"
alias gco="git checkout"
alias gb="git branch"
alias gcp="git cherry-pick"
alias gcpn="git cherry-pick -n"
alias gwa="git worktree add"
alias gwr="git worktree remove"
alias gwls="git worktree list"
# File search and manipulation aliases
alias f="find . -type f -iname" # Search for files by name
alias fd="find . -type d -iname" # Search for directories by name
alias grep="grep --color=auto" # Colored grep
# System monitoring aliases
alias dfh="df -h" # Disk usage in human-readable format
alias duh="du -sh" # Directory size in human-readable format
alias top="htop" # Use htop if installed
alias meminfo="free -h" # Memory usage
# Networking aliases
alias ip="ip -c a" # Colorful IP address display
alias ping="ping -c 5" # Limit ping to 5 packets
alias ports="netstat -tulanp" # Show open ports