Advertisement
Guest User

Untitled

a guest
Sep 9th, 2019
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.62 KB | None | 0 0
  1. #Tab completition
  2. autoload -Uz compinit
  3. typeset -i updated_at=$(date +'%j' -r ~/.zcompdump 2>/dev/null || stat -f '%Sm' -t '%j' ~/.zcompdump 2>/dev/null)
  4. if [ $(date +'%j') != $updated_at ]; then
  5.   compinit -i
  6. else
  7.   compinit -C -i
  8. fi
  9. zmodload -i zsh/complist
  10.  
  11. #ZSH History settings
  12. HISTFILE=$HOME/.zsh_history
  13. HISTSIZE=100000
  14. SAVEHIST=$HISTSIZE
  15.  
  16. setopt hist_ignore_all_dups # remove older duplicate entries from history
  17. setopt hist_reduce_blanks # remove superfluous blanks from history items
  18. setopt inc_append_history # save history entries as soon as they are entered
  19. setopt share_history # share history between different instances of the shell
  20.  
  21. # Other settings
  22. setopt auto_cd # cd by typing directory name if it's not a command
  23. setopt correct_all # autocorrect commands
  24.  
  25. #Tab completition
  26. setopt auto_list # automatically list choices on ambiguous completion
  27. setopt auto_menu # automatically use menu completion
  28. setopt always_to_end # move cursor to end if word had one match
  29. zstyle ':completion:*' menu select # select completions with arrow keys
  30. zstyle ':completion:*' group-name '' # group results by category
  31. zstyle ':completion:::::' completer _expand _complete _ignored _approximate # enable approximate matches for completion
  32. zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}'
  33.  
  34. #Spaceship prompt settings
  35. SPACESHIP_PROMPT_ORDER=(
  36.   user          # Username section
  37.   dir           # Current directory section
  38.   host          # Hostname section
  39.   git           # Git section (git_branch + git_status)
  40.   hg            # Mercurial section (hg_branch  + hg_status)
  41.   exec_time     # Execution time
  42.   line_sep      # Line break
  43.   vi_mode       # Vi-mode indicator
  44.   jobs          # Background jobs indicator
  45.   exit_code     # Exit code section
  46.   char          # Prompt character
  47. )
  48. SPACESHIP_PROMPT_ADD_NEWLINE=false
  49. SPACESHIP_CHAR_SYMBOL="β€šΓΉΓ˜"
  50. SPACESHIP_CHAR_SUFFIX=" "
  51. # Simplify prompt if we're using Hyper
  52. if [[ "$TERM_PROGRAM" == "Hyper" ]]; then
  53.   SPACESHIP_PROMPT_SEPARATE_LINE=false
  54.   SPACESHIP_DIR_SHOW=false
  55.   SPACESHIP_GIT_BRANCH_SHOW=false
  56. fi
  57.  
  58. #Antibody plugins
  59.  
  60. source <(antibody init)
  61. antibody bundle zdharma/fast-syntax-highlighting
  62. antibody bundle zsh-users/zsh-autosuggestions
  63. antibody bundle zsh-users/zsh-completions
  64. antibody bundle marzocchi/zsh-notify
  65. antibody bundle denysdovhan/spaceship-prompt
  66. antibody bundle hschne/fzf-git
  67. antibody bundle gradle/gradle-completion
  68.  
  69.  
  70. # Open new tabs in same directory
  71. if [[ "$TERM_PROGRAM" == "iTerm.app" ]]; then
  72.    function chpwd {
  73.        printf 'e]7;%sa' "file://$HOSTNAME${PWD// /%20}"
  74.     }
  75.     chpwd
  76. fi
  77.  
  78. #Enable vi mode
  79. bindkey -v
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement