Skip to content

Commit

Permalink
feat(msys64): add fish, git and ssh support
Browse files Browse the repository at this point in the history
  • Loading branch information
kyau committed Feb 6, 2024
1 parent 3a3e9a0 commit d050e9e
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 1 deletion.
84 changes: 84 additions & 0 deletions config/fish/config-msys64.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# $KYAULabs: config-msys64.fish,v 1.0.2 2022/11/23 18:27:36 kyau Exp $

# Null the default fish greeting
set fish_greeting

# Set the platform variable
set -x FISH_PLATFORM (uname -s)

# Set the window title
function fish_title
set -l _fish_hostname (hostname)
echo "$_fish_hostname:" $_ ' '
dirs
end

# Aliases
function aliases -d "Command Aliases"
alias c="clear"
alias cd..="cd .."
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias bc="bc -l"
alias diff="colordiff -u"
alias du="du -ch"
alias edit="$EDITOR"
alias g="grep"
alias grep="grep --color=auto --exclude-dir=\.git --exclude-dir=\.svn --exclude-dir=\.hg"
alias h="history"
alias nssh="ssh -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no"
alias scp="scp -q"
alias nscp="scp -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no"
alias tmux="tmux -2 -u"
alias vi="$EDITOR"
alias wget="wget -c"
alias ls="ls --color=auto --file-type --group-directories-first"
alias lsa="ls -A"
alias lla="ls -Al --human-readable"
alias lld="ls -At1"
alias ll="ls -l --human-readable"
alias cp="cp -i"
alias k="kill"
alias k1="kill -1"
alias k2="kill -2"
alias k9="kill -9"
alias ln="ln -i"
alias mkdir="mkdir -pv"
alias mv="mv -i"
alias rm="rm -I --preserve-root"
end
function aliases_git -d "Git Command Aliases"
alias commit="git commit -S -a"
alias gitad="git add -A -n ."
alias gitadd="git add -A ."
alias gitlog="git log --graph --all --format=format:'%C(bold red)%h%C(reset) %C(white)-%C(reset) %C(reset)%s %C(bold green)(%ar)%C(reset) %C(bold cyan)[%an]%C(reset)%C(bold yellow)%d%C(reset)%n'''' %C(white)%b%C(reset)' --no-abbrev-commit"
alias gitls="git ls-files -o --exclude-standard"
alias pull="git pull origin"
alias push="git push origin"
end

# Interactive shell
if status --is-interactive
# environmental variables
set -x GPG_TTY (tty)
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
set -x EDITOR "subl -w"
set -x PATH "$HOME/bin" "/c/Program Files/Sublime Text" "/mingw64/bin" "/opt/bin" $MSYS2_PATH "/c/ProgramData/chocolatey/bin" "/c/Program Files/dotnet" "/c/ProgramData/chocolatey/lib/mpv.install/tools" $ORIGINAL_PATH
set -x PAGER "less"
set -x LESS "-RSM~gIsw"
set -x DOTNET_CLI_TELEMETRY_OPTOUT 1
# gpg-agent + scdaemon check
ps -eaf | grep scdaemon >/dev/null 2>&1
if test $status -eq 1
set -l _gpg_pid (ps | grep -i gpg-agent | awk '{ print $1 }')
if test -n "$_gpg_pid"
kill -9 $_gpg_pid
gpg --card-status >/dev/null 2>&1
end
end
# command aliases
aliases
aliases_git
starship init fish | source
end
13 changes: 12 additions & 1 deletion gitconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $KYAULabs: gitconfig,v 1.0.3 2022/03/24 22:35:51 kyau Exp $
# $KYAULabs: gitconfig,v 1.0.4 2023/06/07 11:36:41 kyau Exp $

[core]
editor = vim
Expand All @@ -11,3 +11,14 @@
[alias]
ls = log --all --format=format:'%C(red)%h%C(reset)%C(bold) -%C(yellow)%d%C(reset) %s %C(green)(%ar)%C(reset) %C(cyan)[%an]%C(reset)' --graph
ll = log --all --format=format:'%C(red)%h%C(reset)%C(bold) -%C(yellow)%d%C(reset) %s %C(green)(%ar)%C(reset) %C(cyan)[%an]%C(reset)%n%b%C(reset)' --graph --numstat

[init]
defaultBranch = main

[commit]
gpgsign = true

[push]
followTags = true

# vim: ft=gitconfig sts=4 sw=4 ts=4 et :
22 changes: 22 additions & 0 deletions ssh/config-msys64
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# $KYAULabs: config,v 1.0.2 2022/11/24 19:32:55 kyau Exp $

# Default Config
Host *
User kyau
KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256
ChallengeResponseAuthentication no
ConnectTimeout 60
HashKnownHosts yes
HostKeyAlgorithms [email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr
MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,[email protected]
ServerAliveInterval 30

# Forward the local gpg-agent to remote unix socket
Host *.kyaulabs *.kyaulabs.com
Port 4222
ForwardAgent yes
StreamLocalBindUnlink yes
RemoteForward /home/kyau/.gnupg/S.gpg-agent /C/Users/SeanBruen/.gnupg/S.gpg-agent.extra

# vim: ft=sshconfig ts=4 sw=4 noet :
39 changes: 39 additions & 0 deletions ssh/config-vscode
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Host *
KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256
ChallengeResponseAuthentication no
ConnectTimeout 60
HashKnownHosts yes
HostKeyAlgorithms [email protected],[email protected],[email protected],ssh-ed25519,rsa-sha2-512,rsa-sha2-256
Ciphers [email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr
MACs [email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,[email protected]
ServerAliveInterval 30

Host web.kyaulabs
HostName web.kyaulabs
User http
ForwardAgent yes
Port 4222

Host orbit.kyaulabs
HostName orbit.kyaulabs
User kyau
ForwardAgent yes
Port 4222
StreamLocalBindUnlink yes
RemoteForward /home/kyau/.gnupg/S.gpg-agent /C/Users/SeanBruen/.gnupg/S.gpg-agent.extra

Host arrakis.kyaulabs.com
HostName arrakis.kyaulabs.com
User kyau
ForwardAgent yes
Port 4222
StreamLocalBindUnlink yes
RemoteForward /home/kyau/.gnupg/S.gpg-agent /C/Users/SeanBruen/.gnupg/S.gpg-agent.extra

Host chloe.kyaulabs.com
HostName chloe.kyaulabs.com
User kyau
ForwardAgent yes
Port 4222
StreamLocalBindUnlink yes
RemoteForward /home/kyau/.gnupg/S.gpg-agent /C/Users/SeanBruen/.gnupg/S.gpg-agent.extra

0 comments on commit d050e9e

Please sign in to comment.