Collected Dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
4.0 KiB

  1. # Personal Zsh configuration file. It is strongly recommended to keep all
  2. # shell customization and configuration (including exported environment
  3. # variables such as PATH) in this file or in files source by it.
  4. #
  5. # Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md.
  6. # Periodic auto-update on Zsh startup: 'ask' or 'no'.
  7. zstyle ':z4h:' auto-update 'no'
  8. # Ask whether to auto-update this often; has no effect if auto-update is 'no'.
  9. zstyle ':z4h:' auto-update-days 'no'
  10. # Automaticaly wrap TTY with a transparent tmux ('integrated'), or start a
  11. # full-fledged tmux ('system'), or disable features that require tmux ('no').
  12. zstyle ':z4h:' start-tmux 'no'
  13. # Move prompt to the bottom when zsh starts up so that it's always in the
  14. # same position. Has no effect if start-tmux is 'no'.
  15. zstyle ':z4h:' prompt-at-bottom 'no'
  16. # Keyboard type: 'mac' or 'pc'.
  17. zstyle ':z4h:bindkey' keyboard 'pc'
  18. # Right-arrow key accepts one character ('partial-accept') from
  19. # command autosuggestions or the whole thing ('accept')?
  20. zstyle ':z4h:autosuggestions' forward-char 'accept'
  21. # Enable ('yes') or disable ('no') automatic teleportation of z4h over
  22. # ssh when connecting to these hosts.
  23. #zstyle ':z4h:ssh:calvin' enable 'yes'
  24. #zstyle ':z4h:ssh:*.example-hostname2' enable 'no'
  25. # The default value if none of the overrides above match the hostname.
  26. zstyle ':z4h:ssh:*' enable 'no'
  27. # Send these files over to the remote host when connecting over ssh to the
  28. # enabled hosts.
  29. zstyle ':z4h:ssh:*' send-extra-files '~/.nanorc' '~/.env.zsh'
  30. # Clone additional Git repositories from GitHub.
  31. #
  32. # This doesn't do anything apart from cloning the repository and keeping it
  33. # up-to-date. Cloned files can be used after `z4h init`. This is just an
  34. # example. If you don't plan to use Oh My Zsh, delete this line.
  35. #z4h install ohmyzsh/ohmyzsh || return
  36. # Install or update core components (fzf, zsh-autosuggestions, etc.) and
  37. # initialize Zsh. After this point console I/O is unavailable until Zsh
  38. # is fully initialized. Everything that requires user interaction or can
  39. # perform network I/O must be done above. Everything else is best done below.
  40. z4h init || return
  41. # Extend PATH.
  42. path=(~/bin $path)
  43. # Export environment variables.
  44. export GPG_TTY=$TTY
  45. # Source additional local files if they exist.
  46. z4h source ~/.env.zsh
  47. # Use additional Git repositories pulled in with `z4h install`.
  48. #
  49. # This is just an example that you should delete. It does nothing useful.
  50. #z4h source $Z4H/ohmyzsh/ohmyzsh/lib/diagnostics.zsh
  51. #z4h source $Z4H/ohmyzsh/ohmyzsh/plugins/emoji-clock/emoji-clock.plugin.zsh
  52. #fpath+=($Z4H/ohmyzsh/ohmyzsh/plugins/supervisor)
  53. # Define key bindings.
  54. z4h bindkey z4h-backward-kill-word Ctrl+Backspace Ctrl+H
  55. z4h bindkey z4h-backward-kill-zword Ctrl+Alt+Backspace
  56. z4h bindkey undo Ctrl+/ # undo the last command line change
  57. z4h bindkey redo Alt+/ # redo the last undone command line change
  58. z4h bindkey z4h-cd-back Alt+Left # cd into the previous directory
  59. z4h bindkey z4h-cd-forward Alt+Right # cd into the next directory
  60. z4h bindkey z4h-cd-up Alt+Up # cd into the parent directory
  61. z4h bindkey z4h-cd-down Alt+Down # cd into a child directory
  62. # Autoload functions.
  63. autoload -Uz zmv
  64. # Define functions and completions.
  65. function md() { [[ $# == 1 ]] && mkdir -p -- "$1" && cd -- "$1" }
  66. compdef _directories md
  67. # Define named directories: ~w <=> Windows home directory on WSL.
  68. [[ -n $z4h_win_home ]] && hash -d w=$z4h_win_home
  69. # Define aliases.
  70. alias tree='tree -a -I .git'
  71. # Add flags to existing aliases.
  72. alias ls="${aliases[ls]:-ls} -A"
  73. # Set shell options: http://zsh.sourceforge.net/Doc/Release/Options.html.
  74. setopt glob_dots # no special treatment for file names with a leading dot
  75. setopt no_auto_menu # require an extra TAB press to open the completion menu
  76. typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_FOUND='bg=black,fg=cyan,bold'
  77. typeset -g HISTORY_SUBSTRING_SEARCH_HIGHLIGHT_NOT_FOUND='bg=black,fg=magenta,bold'
  78. typeset -U config_files
  79. config_files=($HOME/.config/zsh/*.zsh)
  80. # load config files
  81. for file in ${config_files}
  82. do
  83. source $file
  84. done