added AGENTS.md
This commit is contained in:
@@ -8,7 +8,14 @@ export XAUTHORITY=$HOME/.Xauthority
|
||||
|
||||
cd ~
|
||||
|
||||
# nix build hosts
|
||||
### mize aliases
|
||||
alias mg="mize get"
|
||||
alias mr="mize run"
|
||||
alias ms="mize set"
|
||||
alias md="mize run dev"
|
||||
alias sci="mize run sci"
|
||||
|
||||
### nix build hosts
|
||||
export acern="ssh://acern x86_64-linux,aarch64-linux - 20 10 big-parallel - -"
|
||||
export fe="ssh://fe x86_64-linux,aarch64-linux - 20 10 big-parallel - -"
|
||||
export fusu="ssh://fusu x86_64-linux,aarch64-linux - 20 10 big-parallel - -"
|
||||
@@ -16,7 +23,7 @@ export mac="ssh://mac x86_64-linux,aarch64-linux - 8 5 big-parallel - -"
|
||||
export mosatop="ssh://mosatop x86_64-linux,aarch64-linux - 8 5 big-parallel - -"
|
||||
export hpm="ssh://hpm x86_64-linux,aarch64-linux - 8 5 big-parallel - -"
|
||||
|
||||
## ssh completions
|
||||
### ssh completions
|
||||
_ssh_completion() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
@@ -27,7 +34,30 @@ _ssh_completion() {
|
||||
COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
|
||||
return 0
|
||||
}
|
||||
complete -F _ssh_completion ssh scp sftp
|
||||
_scp_completion() {
|
||||
local cur opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
local OLD_WORDBREAKS=$COMP_WORDBREAKS
|
||||
COMP_WORDBREAKS=${COMP_WORDBREAKS//:/}
|
||||
|
||||
|
||||
# 2. Generate host choices using your existing logic
|
||||
opts=$(awk '/^Host / && $2 !~ /[*?]/ {print $2}' $CONFIG_DIR/hosts/main/ssh_config 2>/dev/null; \
|
||||
awk '{split($1,a,","); print a[1]}' ~/.ssh/known_hosts 2>/dev/null | tr -d '[]')
|
||||
|
||||
|
||||
# 3. Combine both hosts and local files into the initial completion pool
|
||||
# This allows typing 'sc[TAB]' to see both local files and your SSH hosts.
|
||||
COMPREPLY=( $(compgen -S ":" -W "$opts" -- "$cur") $(compgen -f -- "$cur") )
|
||||
|
||||
# Enable filename formatting so local directory trailing slashes work
|
||||
compopt -o filenames 2>/dev/null
|
||||
return 0
|
||||
|
||||
}
|
||||
complete -F _ssh_completion ssh sftp
|
||||
complete -F _scp_completion -o nospace scp
|
||||
|
||||
|
||||
# my prompt
|
||||
|
||||
Reference in New Issue
Block a user