Advertisement
Guest User

zshrc

a guest
Oct 9th, 2023
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.66 KB | Software | 0 0
  1. export ZSH="/home/maykel/.oh-my-zsh"
  2.  
  3. ZSH_THEME="robbyrussell"
  4.  
  5. plugins=(
  6.     git
  7.     history-substring-search
  8.     colored-man-pages
  9.     zsh-autosuggestions
  10.     zsh-syntax-highlighting
  11. )
  12.  
  13. source $ZSH/oh-my-zsh.sh
  14.  
  15. # User configuration
  16.  
  17. export PWGEN_SPECIAL="\'\"\@\?\^\&\*\(\)\`\:\~\?\;\:\[\]\{\}\.\,\\\/\|\#"
  18. function pwgen-special () {
  19.   NUM_CHARS=$1
  20.   pwgen -sy $NUM_CHARS 1 -r $PWGEN_SPECIAL
  21. }
  22.  
  23. export PATH=/home/maykel/bin:$PATH
  24.  
  25. ## AUTOCOMPLETE SSH HOSTS ##
  26.  
  27. h=()
  28. if [[ -r ~/.ssh/config ]]; then
  29.  h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
  30. fi
  31. if [[ -r ~/.ssh/known_hosts ]]; then
  32.  h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
  33. fi
  34. if [[ $#h -gt 0 ]]; then
  35.  zstyle ':completion:*:ssh:*' hosts $h
  36.  zstyle ':completion:*:slogin:*' hosts $h
  37. fi
  38.  
  39. ## This speeds up pasting w/ autosuggest ##
  40. # https://github.com/zsh-users/zsh-autosuggestions/issues/238
  41. pasteinit() {
  42.  OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}
  43.  zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
  44. }
  45.  
  46. pastefinish() {
  47.  zle -N self-insert $OLD_SELF_INSERT
  48. }
  49. zstyle :bracketed-paste-magic paste-init pasteinit
  50. zstyle :bracketed-paste-magic paste-finish pastefinish
  51.  
  52. function netstat-count () {
  53.    netstat -tn 2>/dev/null | grep :443 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
  54. }
  55.  
  56. #[ "$TERM" = "xterm-kitty" ] && alias ssh="kitty +kitten ssh"
  57. #source ~/powerlevel10k/powerlevel10k.zsh-theme
  58.  
  59. # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
  60. #[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
  61.  
  62. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement