refactor: Remove spurious files & move around aliases
This commit is contained in:
39
10x_alias.sh
39
10x_alias.sh
@@ -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"
|
||||
|
||||
@@ -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
|
||||
15
10x_nvim.sh
15
10x_nvim.sh
@@ -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"
|
||||
Reference in New Issue
Block a user