reduce fish functions

This commit is contained in:
Noah Masur 2021-05-08 17:39:52 -04:00
parent 9e2ab0f2d8
commit 882d8c75fa
13 changed files with 20 additions and 38 deletions

View File

@ -8,9 +8,11 @@ function abbrs --description 'All abbreviations'
abbr -a ll 'ls -alhF'
abbr -a lf 'ls -lh | fzf'
abbr -a c 'cd'
abbr -a fcd 'cd (fd -t d . ~ | fzf)'
abbr -a -- - 'cd -'
abbr -a proj 'cd $PROJ'
abbr -a mkd 'mkdir -pv'
alias --save fcd 'set jump (fd -t d . ~ | fzf); and cd $jump'
# Tmux
abbr -a ta 'tmux attach-session'
@ -42,7 +44,6 @@ function abbrs --description 'All abbreviations'
abbr -a gr 'git reset'
abbr -a grh 'git reset --hard'
abbr -a gm 'git merge'
abbr -a gmf 'git-merge-fuzzy'
abbr -a gcp 'git cherry-pick'
abbr -a ghr 'gh repo view -w'
abbr -a gha 'gh run list | head -1 | awk \'{ print $NF }\' | xargs gh run view'
@ -58,7 +59,6 @@ function abbrs --description 'All abbreviations'
abbr -a v 'vim'
abbr -a vl 'vim -c "normal! `0"'
abbr -a vll 'vim -c "Hist"'
abbr -a vh 'vim -c "Hist"'
# Notes
abbr -a qn 'quicknote'
@ -71,6 +71,8 @@ function abbrs --description 'All abbreviations'
# Fun CLI Tools
abbr goo 'googler'
abbr gooj 'googler -j'
abbr weather 'curl wttr.in/$WEATHER_CITY'
abbr moon 'curl wttr.in/Moon'
# Dotfile and config shortcuts
abbr -a s 'sudo'
@ -109,6 +111,9 @@ function abbrs --description 'All abbreviations'
abbr -a dash 'kube-dashboard'
abbr -a ks 'k9s'
# Cloud
abbr -a awsc 'vim ~/.aws/credentials'
# Python
abbr -a py 'python'
abbr -a po 'poetry'

View File

@ -1,3 +0,0 @@
function awsc --description "Open AWS credentials file"
vim ~/.aws/credentials
end

View File

@ -1,9 +0,0 @@
function brewinfo --description "Lookup brew plugins"
set -l inst (brew formulae | eval "fzf $FZF_DEFAULT_OPTS -m --header='[brew:info]'")
if not test (count $inst) = 0
for prog in $inst
brew info "$prog"
end
end
end

View File

@ -1,5 +1,5 @@
function brewsearch --description "Install brew plugins"
set -l inst (brew formulae | eval "fzf $FZF_DEFAULT_OPTS -m --header='[brew:install]'")
set -l inst (brew formulae | eval "fzf $FZF_DEFAULT_OPTS -m --header='[press ctrl-i for info, enter to install]' --bind 'ctrl-i:preview(brew info {})'")
if not test (count $inst) = 0
for prog in $inst

View File

@ -0,0 +1,4 @@
# Defined via `source`
function fcd --wraps='set jump (fd -t d . ~ | fzf); and cd $jump' --description 'alias fcd set jump (fd -t d . ~ | fzf); and cd $jump'
set jump (fd -t d . ~ | fzf); and cd $jump $argv;
end

View File

@ -1,9 +0,0 @@
function fuck -d "Correct your previous console command"
set -l fucked_up_command $history[1]
env TF_SHELL=fish TF_ALIAS=fuck PYTHONIOENCODING=utf-8 thefuck $fucked_up_command THEFUCK_ARGUMENT_PLACEHOLDER $argv | read -l unfucked_command
if [ "$unfucked_command" != "" ]
eval $unfucked_command
builtin history delete --exact --case-sensitive -- $fucked_up_command
builtin history merge ^ /dev/null
end
end

View File

@ -1,3 +0,0 @@
function moon --description "See lunar status"
curl wttr.in/Moon
end

View File

@ -1,3 +1,3 @@
function psf
function psf --description "Search for open process" -a "process"
ps aux | rg -v "$USER.*rg $argv" | rg $argv
end

View File

@ -1,3 +0,0 @@
function weather --description "Check weather"
curl wttr.in/$WEATHER_CITY
end

View File

@ -2,6 +2,7 @@
tap "nmasur/repo"
brew "ffmpeg" # Convert videos
brew "nmasur/repo/bid" # Look up stock tickers
brew "nmasur/repo/bee" # Cheat on NYTimes Spelling Bee
brew "tickrs" # Interactive stock tickers

View File

@ -4,7 +4,6 @@ tap "superfly/tap"
tap "nmasur/repo"
tap "cjbassi/ytop"
brew "thefuck" # Fix terminal mistakes
brew "superfly/tap/flyctl" # Fly.io CLI
brew "haskell-stack" # Latest version of Haskell
brew "xsv" # CSV manipulation

6
scripts/setup_cheatsheet Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
echo "downloading cheatsheet"
curl https://cht.sh/:cht.sh > ~/.local/bin/cheat
chmod 755 ~/.local/bin/cheat
echo "cheatsheet ✓"

View File

@ -1,6 +0,0 @@
#!/bin/sh
echo "downloading cheatsheet"
curl https://cht.sh/:cht.sh > ~/.local/bin/cht.sh
chmod 755 ~/.local/bin/cht.sh
echo "cht.sh ✓"