Files
dotfiles/common/.config/shell/aliases
Pratik Tripathy 5fa524dd1d - TMUX: Switched back to ctrl+b as leader
- VIM: Configurations better commented
- NVIM: NVChad, LazyNvim, Old-Config removed
- NVIM: Restarted and reconfigured from kickstart.nvim [WIP]
- Dotfiles on $HOME removed from 160+ to 25. Most of them moved to $XDG_* directories
- Shell: Added back p10k config
- Shell: Autoremove brew left over applications
- Kitty: Added bashrc & profiles for ssh kitten
- Kitty: Custom tab-titles
2024-01-29 22:51:23 +05:30

94 lines
2.6 KiB
Bash

#!/bin/sh
# Generic
alias sb="source ~/.bashrc"
alias bashreload="source ~/.bashrc"
alias sz="source ~/.zshrc"
alias zshreload="source ~/.zshrc"
alias zshrc="${EDITOR} ~/.zshrc"
alias free="free -ht"
alias type="type -a"
alias grep='grep --color=auto'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home Dir: \" \$6 \", Shell Used: \" \$7}' /etc/passwd | grep"
alias untar='tar -zxvf '
alias wget="wget --hsts-file ${WGET_HSTS_FILE}"
alias v="${EDITOR}"
alias snvim="${HOMEBREW_PREFIX}"/bin/nvim # Stable nvim
url_encode(){
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
}
# History
alias histsearch="history | grep"
alias hs="histsearch"
alias hsi="histsearch"
# Directories and Directory listings
alias ~="cd ~"
alias ..="cd .."
alias ...='cd ../../../' # Go back 3 directory levels
alias cd_root='cd $(git rev-parse --show-toplevel 2>/dev/null || echo ".")'
alias cd_git_root=cd_root
alias c=clear
alias cl=clear
alias lsc='ls --color=auto --hyperlink=auto'
alias ll='lsc -alhF'
alias la='lsc -Ah'
alias l='lsc -CF'
alias lsa="lsc -lAFhZ"
alias mkdir="mkdir -pv"
alias df="df -h"
mkcd () {
mkdir "$1"
cd "$1" || exit
}
# Network
alias ping="ping -c 10"
alias ping8="ping 8.8.8.8"
alias ping1="ping 1.1.1.1"
alias p8="ping8"
alias p1="ping1"
alias pubip="curl https://ipinfo.io/ip; echo"
alias speedtest="speedtest-cli --secure" # needs speedtest-cli installed
geoip () {
curl -s https://ipinfo.io | sed '/readme/d;/loc/d;/postal/d;s/org/ISP/' | tr -d {},\" | awk -F ':' 'NF {printf ("%10s: %.25s \n", $1, $2)}'
}
# Git
# To use this - Ensure all git server SSH are in ~/.ssh
alias git_signin='(for i in ~/.ssh/{*github*,*gitea*}; do ssh-add -k $i; done; ) && (echo; echo Identities added successfully)'
git_push_all_changes(){
git add . && git commit -am "${1}" && git push
}
alias ta="tmux a"
alias tat="tmux a -t"
alias tls="tmux ls"
alias tnew="tmux new"
alias tnewt="tmux new -t"
# Nvim Distro-Switcher
alias nvim-lazy="NVIM_APPNAME=nvim-lazy nvim"
alias OldConfig="NVIM_APPNAME=oldconfig nvim"
nvims() {
items=$(find -L "$HOME"/.config -maxdepth 2 -name "init.lua" -type f -execdir sh -c 'pwd | xargs basename' \;)
config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config  " --height=~50% --layout=reverse --border --exit-0)
if [[ -z $config ]]; then
echo "Nothing selected"
return 0
elif [[ $config == "default" ]]; then
config=""
fi
NVIM_APPNAME=$config nvim $@
}