more fish speedup and colors

This commit is contained in:
Noah Masur 2020-12-21 19:09:53 -07:00
parent 80f84e69b3
commit 64b7abf5eb
11 changed files with 69 additions and 27 deletions

View File

@ -2,32 +2,14 @@
if status --is-interactive 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 # Aliases
alias reload='source $DOTS/fish.configlink/config.fish' set PATH $PATH /usr/local/bin ~/.local/bin $DOTS/bin ~/.cargo/bin
alias ls 'exa'
alias proj 'cd $PROJ'
if command -v nvim > /dev/null if command -v nvim > /dev/null
alias vim='nvim' alias vim='nvim'
abbr -a vimrc 'vim $HOME/.config/nvim/init.vim' abbr -a vimrc 'vim $HOME/.config/nvim/init.vim'
end 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" ] if [ (uname) = "Linux" ]
alias pbcopy='xclip -selection clipboard -in' linux
alias pbpaste='xclip -selection clipboard -out'
end end
# Use `vi` in the shell with cursor shapes # Use `vi` in the shell with cursor shapes
@ -43,9 +25,6 @@ if status --is-interactive
set -g fish_cursor_replace_one underscore set -g fish_cursor_replace_one underscore
fish_vi_cursor fish_vi_cursor
# Turn off greeting
set fish_greeting ""
# Autojump # Autojump
zoxide init fish | source zoxide init fish | source
@ -61,4 +40,3 @@ if status --is-interactive
# Use `starship` prompt # Use `starship` prompt
starship init fish | source starship init fish | source
end end

View File

@ -3,11 +3,12 @@
function abbrs --description 'All abbreviations' function abbrs --description 'All abbreviations'
# Directory aliases # Directory aliases
abbr -a l 'ls' # Quicker shortcut for ls abbr -a l 'ls'
abbr -a lh 'ls -lh' # Pretty vertical list abbr -a lh 'ls -lh'
abbr -a ll 'ls -alhF' # Include hidden files abbr -a ll 'ls -alhF'
abbr -a c 'cd' abbr -a c 'cd'
abbr -a -- - 'cd -' abbr -a -- - 'cd -'
abbr -a proj 'cd $PROJ'
# Tmux # Tmux
abbr -a ta 'tmux attach-session' abbr -a ta 'tmux attach-session'

View File

@ -0,0 +1,3 @@
function json --description "Tidy up JSON with jq"
pbpaste | jq '.' | pbcopy
end

View File

@ -0,0 +1,4 @@
function linux --description "Load only on Linux"
alias pbcopy='xclip -selection clipboard -in'
alias pbpaste='xclip -selection clipboard -out'
end

View File

@ -0,0 +1,3 @@
function ls --description "Use exa to list files"
exa $argv
end

View File

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

View File

@ -0,0 +1,3 @@
function ping --description "Improved ping"
prettyping --nolegend
end

View File

@ -0,0 +1,3 @@
function reload --description "Reload fish configuration"
source $DOTS/fish.configlink/config.fish
end

View File

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

View File

@ -0,0 +1,3 @@
function worldmap --description "Terminal atlas"
telnet mapscii.me
end

View File

@ -3,7 +3,45 @@
# Install fisher packages # Install fisher packages
fisher update 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 # Load abbreviations
abbrs 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 ✓" echo "fish setup ✓"