Rearrange aliases, add WSL-specific clipboard aliases, reformat

This commit is contained in:
2024-11-07 15:11:12 -06:00
parent 86544ac385
commit 2bcb58f7e6
@@ -1,20 +1,36 @@
# Controlled by chezmoi # Controlled by chezmoi
alias gpt='chatgpt'
alias copilot='gh copilot' # Core aliases
alias suggest='gh copilot suggest -t shell'
alias cha='chezmoi apply --interactive'
alias nano='micro'
alias ch='chezmoi'
alias copy='xsel -ib'
alias cdp='cd $(xsel -b)'
alias spt='spotify_player'
alias lg='lazygit'
alias vim='nvim'
alias gitalias='alias | grep "git "'
alias mousefix='sudo udevadm trigger'
alias ll='ls -AlFh' alias ll='ls -AlFh'
alias la='ls -Ah' alias la='ls -Ah'
alias l='ls -CF' alias l='ls -CF'
alias nano='micro'
alias lg='lazygit'
alias vim='nvim'
alias chlg='lazygit --path ~/.local/share/chezmoi'
# Chezmoi
alias cha='chezmoi apply --interactive'
alias ch='chezmoi'
# Other aliases
alias gpt='chatgpt'
alias copilot='gh copilot'
alias suggest='gh copilot suggest -t shell'
alias spt='spotify_player'
alias gitalias='alias | grep "git "'
alias mousefix='sudo udevadm trigger' # helped with mouse issues on laptop
# Clipboard aliases
{{ if not .wsl -}}
alias copy='xsel -ib'
alias paste='xsel -b'
alias cdp='cd $(xsel -b)'
{{- else -}}
alias copy='clip.exe'
alias paste='powershell.exe -noprofile Get-Clipboard'
alias cdp='cd $(xsel -b)'
{{- end }}
# fast chmod execute alias # fast chmod execute alias
function chfix() { function chfix() {
@@ -28,7 +44,7 @@ function chfix() {
} }
# https://docs.gitignore.io/install/command-line # https://docs.gitignore.io/install/command-line
function gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;} function gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@; }
function chcode() { function chcode() {
EDITOR="code --wait" EDITOR="code --wait"
@@ -45,10 +61,6 @@ function chcode() {
chezmoi edit $@ chezmoi edit $@
} }
function chlg() {
lazygit --path ~/.local/share/chezmoi
}
# Add an "alert" alias for long running commands. Use like so: # Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert # sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
@@ -76,7 +88,7 @@ maestroAddress="AC:BF:71:66:FE:B2"
alias maestroOff="bluetoothctl block $maestroAddress" alias maestroOff="bluetoothctl block $maestroAddress"
alias maestroOn="bluetoothctl unblock $maestroAddress && bluetoothctl connect $maestroAddress" alias maestroOn="bluetoothctl unblock $maestroAddress && bluetoothctl connect $maestroAddress"
function lastRuns () { function lastRuns() {
# default to 10 runs # default to 10 runs
if [ -z "$1" ]; then if [ -z "$1" ]; then
RUNS=10 RUNS=10
@@ -88,7 +100,7 @@ function lastRuns () {
# Touches a file while also creating the parent directory (and any other necessary directories) in order to do so. # Touches a file while also creating the parent directory (and any other necessary directories) in order to do so.
function mktouch() { function mktouch() {
mkdir -p $(dirname $1) && touch $1; mkdir -p $(dirname $1) && touch $1
} }
# When in the appropriate KiTTy terminal, use the SSH kitten # When in the appropriate KiTTy terminal, use the SSH kitten