refactor: Remove spurious files & move around aliases

This commit is contained in:
Pratik Tripathy
2025-08-29 16:18:06 +05:30
parent 0758973e20
commit bc91c33378
3 changed files with 19 additions and 45 deletions

View File

@@ -1,6 +1,18 @@
#!/bin/sh
# Git
# Templates
[ ! -f "$GITIGNORE_TEMPLATE" ] || alias cp_gi='cp ${GITIGNORE_TEMPLATE} .'
[ ! -f "$PRETTIER_TEMPLATE" ] || alias cp_prc='cp ${PRETTIER_TEMPLATE} .'
[ ! -f "$PRETTIER_IGNORE_TEMPLATE" ] || alias cp_prigr='cp ${PRETTIER_IGNORE_TEMPLATE} .'
command -v tldr >/dev/null && alias tldr="tldr --platform=linux"
command -v tldr >/dev/null && alias h="tldr"
command -v fzf >/dev/null && alias path="printenv | grep ^PATH= | sed 's/^PATH=//' | tr ':' '\n' | fzf"
command -v podman >/dev/null && alias docker=podman
alias cd_root='cd $(git rev-parse --show-toplevel 2>/dev/null || echo ".")'
alias cd_git_root=cd_root
git_push_all_changes() {
if [ -z "$1" ] || [ "$1" = " " ]; then
echo "Please provide a commit message."
@@ -8,25 +20,6 @@ git_push_all_changes() {
fi
git add . && git commit -am "${1}" && git push
}
alias git_just_push=git_push_all_changes
alias cd_root='cd $(git rev-parse --show-toplevel 2>/dev/null || echo ".")'
alias cd_git_root=cd_root
[ ! -f "$GITIGNORE_TEMPLATE" ] || alias cp_gi='cp ${GITIGNORE_TEMPLATE} .'
# command -v eza >/dev/null && alias ls="eza --hyperlink --header --git -M --icons=auto --color=never"
alias ls='ls --color=auto --hyperlink'
alias ll='ls -alhF'
alias la='ls -Ah'
alias lsa="ls -lAFhZ"
command -v tldr >/dev/null && alias tldr="tldr --platform=linux"
command -v tldr >/dev/null && alias mann="tldr"
command -v tldr >/dev/null && alias help="tldr"
alias printpath="echo $PATH | tr : '\n'"
command -v fzf >/dev/null && alias path="printenv | grep ^PATH= | sed 's/^PATH=//' | tr ':' '\n' | fzf"
[ ! -f "$PRETTIER_TEMPLATE" ] || alias cp_prc='cp ${PRETTIER_TEMPLATE} .'
[ ! -f "$PRETTIER_IGNORE_TEMPLATE" ] || alias cp_prigr='cp ${PRETTIER_IGNORE_TEMPLATE} .'
cp_gitprecommit() {
if [ ! -f "$GIT_PRECOMMIT_TEMPLATE" ]; then
@@ -49,6 +42,12 @@ cp_gitprecommit() {
cp "$GIT_PRECOMMIT_TEMPLATE" "$hooks_dir" && printf "Pre-commit hook template copied to %s\n" "$hooks_dir"
}
alias ls='ls --color=auto --hyperlink'
alias ll='ls -alhF'
alias la='ls -Ah'
alias lsa="ls -lAFhZ"
alias printpath="echo $PATH | tr : '\n'"
port_who() {
if [ -z "$1" ] || [ "$1" = " " ]; then
echo "Please provide port number"

View File

@@ -1,10 +0,0 @@
#!/bin/sh
# TODO:
# - Fn that creates a gitea repo
# - Accept a name
# - On success display the remote ssh url + commands to add it to an existing repo
# curl "http://git.pratik.live/api/v1/activitypub/user-id/pratik" \
# -H "accept: application/json" \
# -H "Authorization: token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
# -H "Content-Type: application/json" -d "{ \"body\": \"testing\", \"title\": \"test 20\"}" -i

View File

@@ -1,15 +0,0 @@
#!/bin/sh
# Nvim Distro-Switcher
alias nvim-lazy="NVIM_APPNAME=nvim-lazy nvim"
nvims() {
config=$(find -L "$HOME"/.config -maxdepth 2 -name "init.lua" -type f -execdir sh -c 'pwd | xargs basename' \; | fzf --prompt=" Neovim Config ")
if [ "$config" = "" ]; then
echo "Nothing selected"
return 0
fi
NVIM_APPNAME=$config nvim "$@"
}
# Nvim Distro-Switcher
alias nvim-lazy="NVIM_APPNAME=nvim-lazy nvim"