Last active
November 19, 2023 00:46
-
-
Save ktunprasert/1e3692c75fa9ebd95d99e1ba5fc05d98 to your computer and use it in GitHub Desktop.
Collection of fish functions to make my life easier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cheat.sh function | |
function cheat --description ="Curl commands from cheat.sh with the format 'cheat.sh/[0]/[1]/...'" | |
# Arguments parsing | |
# from: > cheat go :learn | |
# to: go/:learn | |
set path (echo $argv | sed 's/\s/\//g') | |
echo $path | |
# curl (echo cheat.sh/$path) | bat | |
curl (echo cheat.sh/$path) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exdoc | |
elixir -e "require IEx.Helpers; IEx.Helpers.h $argv" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git_fd | |
set -l commandline (__fzf_parse_commandline) | |
set -l dir $commandline[1] | |
set -l fzf_query $commandline[2] | |
set -l COMMAND "fd -HI -d 3 -t directory --absolute-path -g \.git $HOME $HOME/workspace $W/go/src/github.com/ktunprasert -x echo {//}" | |
begin | |
eval "$COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result | |
if [ -n "$result" ]; | |
cd $result | |
commandline -t "" | |
end | |
end | |
commandline -f repaint | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment