Add ssh and key related aliases and reformat all fish files

This commit is contained in:
mitchell 2020-10-31 18:13:25 -04:00
parent 0ef8fb571a
commit 7a361e5260
10 changed files with 72 additions and 54 deletions

View File

@ -7,6 +7,7 @@ function configure_fish
define_global_variables define_global_variables
import_sources $uname import_sources $uname
define_aliases $uname define_aliases $uname
ssh_agent_startup
end end
configure_fish configure_fish

View File

@ -1,22 +1,28 @@
function define_aliases -a uname -d 'Defines aliases for commonly used commands' function define_aliases -a uname -d 'Defines aliases for commonly used commands'
alias cp 'rsync -aP' alias rcp 'rsync -aP'
alias dm 'docker-machine' alias dm 'docker-machine'
alias v 'nvim +FZF' alias v 'nvim +FZF'
alias vg 'vagrant' alias vg 'vagrant'
alias tf 'terraform' alias tf 'terraform'
alias tocb 'xclip -in -selection clipboard' alias tocb 'xclip -in -selection clipboard'
alias fromcb 'xclip -out -selection clipboard' alias fromcb 'xclip -out -selection clipboard'
alias ssh-rm-host 'ssh-keygen -f ~/.ssh/known_hosts -R' alias ssh-rm 'ssh-keygen -f ~/.ssh/known_hosts -R'
alias wiki 'nvim +VimwikiIndex' alias wiki 'nvim +VimwikiIndex'
alias ssh-a 'ssh-add ~/.secrets/id_ed25519'
alias age-p 'age --armor --passphrase'
alias age-d 'age --decrypt --identity ~/.secrets/id_ed25519'
alias age-e 'age --armor --recipient (cat ~/.secrets/id_ed25519.pub)'
alias age-k 'age --decrypt --identity ~/.secrets/id_ed25519 ~/.secrets/age_keys.age'
switch "$uname" switch "$uname"
case 'Linux' case 'Linux'
alias cat 'batcat --theme ansi-dark' alias bat 'batcat --theme ansi-dark'
alias goland 'command goland' alias goland 'command goland'
alias rider 'command rider' alias rider 'command rider'
alias webstorm 'command webstorm' alias webstorm 'command webstorm'
alias sctl 'sudo systemctl'
case 'Darwin' case 'Darwin'
alias cat 'bat --theme ansi-dark' alias bat 'bat --theme ansi-dark'
alias goland 'open -a Goland' alias goland 'open -a Goland'
alias rider 'open -a Rider' alias rider 'open -a Rider'
alias webstorm 'open -a Webstorm' alias webstorm 'open -a Webstorm'

View File

@ -58,7 +58,9 @@ function fish_prompt --description 'Write out the prompt'
# Set user_prefix, based on whether or not inside of ssh session. # Set user_prefix, based on whether or not inside of ssh session.
if test -n "$SSH_CLIENT"; set user_prefix $USER @ (prompt_hostname) ' '; end if test -n "$SSH_CLIENT"
set user_prefix $USER @ (prompt_hostname) ' '
end
# Show current git branch, based on git commands only. # Show current git branch, based on git commands only.
if git status >/dev/null 2>&1 if git status >/dev/null 2>&1
@ -73,7 +75,9 @@ function fish_prompt --description 'Write out the prompt'
end end
set -l cur_branch (string sub -s 3 (string match -r '^\* .*$' (git branch))) set -l cur_branch (string sub -s 3 (string match -r '^\* .*$' (git branch)))
if string match -q '(HEAD detached*' $cur_branch; set cur_branch 'detached'; end if string match -q '(HEAD detached*' $cur_branch
set cur_branch 'detached'
end
if test -n "$cur_branch" if test -n "$cur_branch"
set -l cur_branch_len (string length $cur_branch) set -l cur_branch_len (string length $cur_branch)

View File

@ -3,7 +3,10 @@ function import_sources -a uname -d 'Loads any additional fish files needed at i
switch "$uname" switch "$uname"
case 'Linux' case 'Linux'
test -e ~/.asdf/asdf.fish; and source ~/.asdf/asdf.fish test -e ~/.asdf/asdf.fish
and source ~/.asdf/asdf.fish
and mkdir -p ~/.config/fish/completions
and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
case 'Darwin' case 'Darwin'
command -q brew command -q brew
and test -e (brew --prefix asdf)/asdf.fish and test -e (brew --prefix asdf)/asdf.fish

View File

@ -1,5 +1,7 @@
function send_push -a message -d 'Send a push notification to your phone via pushover (optional delay as second arg)' function send_push -a message -d 'Send a push notification to your phone via pushover (optional delay as second arg)'
if test -n "$argv[2]"; sleep $argv[2]; end if test -n "$argv[2]"
sleep $argv[2]
end
set payload \ set payload \
"{ "{

View File

@ -1,4 +1,6 @@
function tasko -a id -d 'Open the link of a taskwarrior task by id' function tasko -a id -d 'Open the link of a taskwarrior task by id'
set link (task _get $id.link) set link (task _get $id.link)
if test -n $link; open $link; end if test -n $link
open $link
end
end end