diff --git a/fish.configlink/config.fish b/fish.configlink/config.fish index aa4d5ea..ed932b6 100644 --- a/fish.configlink/config.fish +++ b/fish.configlink/config.fish @@ -2,32 +2,14 @@ if status --is-interactive - # Set $PATH for finding programs - set FISH_DIR (readlink ~/.config/fish) - set DOTS (dirname $FISH_DIR) - set PATH $PATH /usr/local/bin ~/.local/bin $DOTS/bin ~/.cargo/bin - set CDPATH . $HOME - set EDITOR nvim - set PROJ $HOME/dev/work - set -gx NOTES_PATH $HOME/notes - # Aliases - alias reload='source $DOTS/fish.configlink/config.fish' - alias ls 'exa' - alias proj 'cd $PROJ' + set PATH $PATH /usr/local/bin ~/.local/bin $DOTS/bin ~/.cargo/bin if command -v nvim > /dev/null alias vim='nvim' abbr -a vimrc 'vim $HOME/.config/nvim/init.vim' end - alias ping='prettyping --nolegend' - alias weather='curl wttr.in/$WEATHER_CITY' - alias moon='curl wttr.in/Moon' - alias ipinfo='curl ipinfo.io' - alias worldmap='telnet mapscii.me' - alias connect='docker run --rm -v ~/.aws:/root/.aws -v ~/.ssh:/root/.ssh -it connect-aws' if [ (uname) = "Linux" ] - alias pbcopy='xclip -selection clipboard -in' - alias pbpaste='xclip -selection clipboard -out' + linux end # Use `vi` in the shell with cursor shapes @@ -43,9 +25,6 @@ if status --is-interactive set -g fish_cursor_replace_one underscore fish_vi_cursor - # Turn off greeting - set fish_greeting "" - # Autojump zoxide init fish | source @@ -61,4 +40,3 @@ if status --is-interactive # Use `starship` prompt starship init fish | source end - diff --git a/fish.configlink/functions/abbrs.fish b/fish.configlink/functions/abbrs.fish index c67d142..fde0f03 100644 --- a/fish.configlink/functions/abbrs.fish +++ b/fish.configlink/functions/abbrs.fish @@ -3,11 +3,12 @@ function abbrs --description 'All abbreviations' # Directory aliases - abbr -a l 'ls' # Quicker shortcut for ls - abbr -a lh 'ls -lh' # Pretty vertical list - abbr -a ll 'ls -alhF' # Include hidden files + abbr -a l 'ls' + abbr -a lh 'ls -lh' + abbr -a ll 'ls -alhF' abbr -a c 'cd' abbr -a -- - 'cd -' + abbr -a proj 'cd $PROJ' # Tmux abbr -a ta 'tmux attach-session' diff --git a/fish.configlink/functions/json.fish b/fish.configlink/functions/json.fish new file mode 100644 index 0000000..89643db --- /dev/null +++ b/fish.configlink/functions/json.fish @@ -0,0 +1,3 @@ +function json --description "Tidy up JSON with jq" + pbpaste | jq '.' | pbcopy +end diff --git a/fish.configlink/functions/linux.fish b/fish.configlink/functions/linux.fish new file mode 100644 index 0000000..b5fe2ef --- /dev/null +++ b/fish.configlink/functions/linux.fish @@ -0,0 +1,4 @@ +function linux --description "Load only on Linux" + alias pbcopy='xclip -selection clipboard -in' + alias pbpaste='xclip -selection clipboard -out' +end diff --git a/fish.configlink/functions/ls.fish b/fish.configlink/functions/ls.fish new file mode 100644 index 0000000..6eeff32 --- /dev/null +++ b/fish.configlink/functions/ls.fish @@ -0,0 +1,3 @@ +function ls --description "Use exa to list files" + exa $argv +end diff --git a/fish.configlink/functions/moon.fish b/fish.configlink/functions/moon.fish new file mode 100644 index 0000000..55b2be0 --- /dev/null +++ b/fish.configlink/functions/moon.fish @@ -0,0 +1,3 @@ +function moon --description "See lunar status" + curl wttr.in/Moon +end diff --git a/fish.configlink/functions/ping.fish b/fish.configlink/functions/ping.fish new file mode 100644 index 0000000..f10bc94 --- /dev/null +++ b/fish.configlink/functions/ping.fish @@ -0,0 +1,3 @@ +function ping --description "Improved ping" + prettyping --nolegend +end diff --git a/fish.configlink/functions/reload.fish b/fish.configlink/functions/reload.fish new file mode 100644 index 0000000..736e594 --- /dev/null +++ b/fish.configlink/functions/reload.fish @@ -0,0 +1,3 @@ +function reload --description "Reload fish configuration" + source $DOTS/fish.configlink/config.fish +end diff --git a/fish.configlink/functions/weather.fish b/fish.configlink/functions/weather.fish new file mode 100644 index 0000000..96cbdbe --- /dev/null +++ b/fish.configlink/functions/weather.fish @@ -0,0 +1,3 @@ +function weather --description "Check weather" + curl wttr.in/$WEATHER_CITY +end diff --git a/fish.configlink/functions/worldmap.fish b/fish.configlink/functions/worldmap.fish new file mode 100644 index 0000000..8778b08 --- /dev/null +++ b/fish.configlink/functions/worldmap.fish @@ -0,0 +1,3 @@ +function worldmap --description "Terminal atlas" + telnet mapscii.me +end diff --git a/scripts/setup_fish b/scripts/setup_fish index bd4ccf7..25768ee 100755 --- a/scripts/setup_fish +++ b/scripts/setup_fish @@ -3,7 +3,45 @@ # Install fisher packages fisher update +# Set $PATH for finding programs +set -U FISH_DIR (readlink ~/.config/fish) +set -U DOTS (dirname $FISH_DIR) +set -U CDPATH . $HOME +set -U EDITOR nvim +set -U PROJ $HOME/dev/work +set -Ux NOTES_PATH $HOME/notes + # Load abbreviations abbrs +# Turn off greeting +set -U fish_greeting "" + +# Set colors (Base16 Eighties) +set -U fish_color_normal normal +set -U fish_color_command 99cc99 +set -U fish_color_quote ffcc66 +set -U fish_color_redirection d3d0c8 +set -U fish_color_end cc99cc +set -U fish_color_error f2777a +set -U fish_color_selection white --bold --background=brblack +set -U fish_color_search_match bryellow --background=brblack +set -U fish_color_history_current --bold +set -U fish_color_operator 6699cc +set -U fish_color_escape 66cccc +set -U fish_color_cwd green +set -U fish_color_cwd_root red +set -U fish_color_valid_path --underline +set -U fish_color_autosuggestion 747369 +set -U fish_color_user brgreen +set -U fish_color_host normal +set -U fish_color_cancel -r +set -U fish_pager_color_completion normal +set -U fish_pager_color_description B3A06D yellow +set -U fish_pager_color_prefix white --bold --underline +set -U fish_pager_color_progress brwhite --background=cyan +set -U fish_color_comment ffcc66 +set -U fish_color_param d3d0c8 +set -U fish_color_match 6699cc + echo "fish setup ✓"