Skip to content

Instantly share code, notes, and snippets.

@YuanLiou
Created December 10, 2023 02:21
Show Gist options
  • Save YuanLiou/51a485e4f9cb792be04aa041fb42b9be to your computer and use it in GitHub Desktop.
Save YuanLiou/51a485e4f9cb792be04aa041fb42b9be to your computer and use it in GitHub Desktop.
Ray WSL Fish Settings 1.0
if status is-interactive
# Commands to run in interactive sessions can go here
end
# Misc
set fish_greeting "Hello Fish!"
set TERM "xterm-256color"
# set EDITOR "nvim"
#export LANG=zh_TW.UTF-8
#export LC_ALL=zh_TW.UTF-8
# Third Party
## Autojump
begin
set --local AUTOJUMP_PATH $HOME/.autojump/share/autojump/autojump.fish
if test -e $AUTOJUMP_PATH
source $AUTOJUMP_PATH
end
end
# Alias
## Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'
alias .5='cd ../../../../..'
## Others
alias cla='lsd -lA --sd'
alias cls='lsd'
alias cb='swagit'
alias ruo='git fetch upstream && git checkout develop && git merge --ff-only upstream/develop && git push origin develop'
alias ruom='git fetch upstream && git checkout master && git merge --ff-only upstream/master && git push origin master'
alias ruomain='git fetch upstream && git checkout main && git merge --ff-only upstream/main && git push origin main'
alias update_master='git fetch upstream && git checkout shp_master && git merge --ff-only upstream/shp_master && git push origin shp_master'
alias reload='exec $SHELL -l'
alias standup="git log --since '1 day ago' --oneline --pretty=format':%C(yellow)
%h %aN%n %B%n' --author Ray"
alias RUO='git fetch upstream && git checkout develop && git merge --ff-only upstream/develop && git push origin develop --no-verify'
alias l='lsd -hA --group-dirs first'
alias ex='eza --icons -a --group-directories-first'
# Keybinding
### Default fish keybinding
function fish_user_key_bindings
fish_default_key_bindings
# fish_vi_key_bindings
end
# Functions
function showLogs
git log --pretty=format:'- %s' --since="$1" --author="$2"
end
# Optimize mp4
# Usage: optimizeVideo video_file
function optimizeVideo
set video_file $argv[1]
ffmpeg -i "$video_file" -vcodec h264 -acodec mp2 "$video_file.mp4"
end
# Convert video to gif file.
# Usage: video2gif video_file (scale) (fps)
function video2gif
set video_file $argv[1]
set scale (count $argv) >= 3 ? $argv[2] : 320
set fps (count $argv) >= 4 ? $argv[3] : 10
ffmpeg -y -i "$video_file" -vf fps=$fps,scale=$scale:-1:flags=lanczos,palettegen "$video_file.png"
ffmpeg -i "$video_file" -i "$video_file.png" -filter_complex "fps=$fps,scale=$scale:-1:flags=lanczos[x];[x][1:v]paletteuse" "$video_file.gif"
rm "$video_file.png"
end
# endregion Function
# Starship prompt
starship init fish | source
# The fuck alias
# eval $(thefuck --alias zz)
# pyenv
pyenv init - | source
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment