fish-shell/share/functions/__ssh_history_completions.fish

4 lines
190 B
Fish
Raw Permalink Normal View History

function __ssh_history_completions -d "Retrieve `user@host` entries from history"
history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1'
end