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.

152 lines
4.2KB

  1. . ~/.profile
  2. # Set prompt for tramp
  3. [[ $TERM == "tramp" ]] && unsetopt zle && PS1='$ ' && return
  4. # Path to your oh-my-zsh installation.
  5. ZSH=/usr/share/oh-my-zsh/
  6. # Set name of the theme to load.
  7. # Look in ~/.oh-my-zsh/themes/
  8. # Optionally, if you set this to "random", it'll load a random theme each
  9. # time that oh-my-zsh is loaded.
  10. ZSH_THEME="bullet-train"
  11. # Uncomment the following line to use case-sensitive completion.
  12. # CASE_SENSITIVE="true"
  13. # Uncomment the following line to use hyphen-insensitive completion. Case
  14. # sensitive completion must be off. _ and - will be interchangeable.
  15. # HYPHEN_INSENSITIVE="true"
  16. # Uncomment the following line to disable bi-weekly auto-update checks.
  17. DISABLE_AUTO_UPDATE="true"
  18. # Uncomment the following line to change how often to auto-update (in days).
  19. # export UPDATE_ZSH_DAYS=13
  20. # Uncomment the following line to disable colors in ls.
  21. # DISABLE_LS_COLORS="true"
  22. # Uncomment the following line to disable auto-setting terminal title.
  23. # DISABLE_AUTO_TITLE="true"
  24. # Uncomment the following line to enable command auto-correction.
  25. ENABLE_CORRECTION="false"
  26. # Uncomment the following line to display red dots whilst waiting for completion.
  27. #COMPLETION_WAITING_DOTS="true"
  28. # Uncomment the following line if you want to disable marking untracked files
  29. # under VCS as dirty. This makes repository status check for large repositories
  30. # much, much faster.
  31. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  32. # Uncomment the following line if you want to change the command execution time
  33. # stamp shown in the history command output.
  34. # The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  35. # HIST_STAMPS="mm/dd/yyyy"
  36. # Would you like to use another custom folder than $ZSH/custom?
  37. ZSH_CUSTOM=~/.oh-my-zsh
  38. # Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
  39. # Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
  40. # Example format: plugins=(rails git textmate ruby lighthouse)
  41. # Add wisely, as too many plugins slow down shell startup.
  42. plugins=(git adb archlinux sudo zsh-syntax-highlighting history-substring-search)
  43. # source ~/.oh-my-zsh/plugins/zsh-autosuggestions/autosuggestions.zsh
  44. # zle-line-init() {
  45. # zle autosuggest-start
  46. # }
  47. # zle -N zle-line-init
  48. # User configuration
  49. # export MANPATH="/usr/local/man:$MANPATH"
  50. # You may need to manually set your language environment
  51. # export LANG=en_US.UTF-8
  52. # Preferred editor for local and remote sessions
  53. # if [[ -n $SSH_CONNECTION ]]; then
  54. # export EDITOR='vim'
  55. # else
  56. # export EDITOR='mvim'
  57. # fi
  58. # Compilation flags
  59. # export ARCHFLAGS="-arch x86_64"
  60. # ssh
  61. # export SSH_KEY_PATH="~/.ssh/dsa_id"
  62. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  63. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  64. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  65. # For a full list of active aliases, run `alias`.
  66. #
  67. # Example aliases
  68. # alias zshconfig="mate ~/.zshrc"
  69. # alias ohmyzsh="mate ~/.oh-my-zsh"
  70. alias q='exit'
  71. alias tmux='tmux -2'
  72. alias v='echo "Warning: Xorg";emacsclient -nc'
  73. alias vv='emacsclient -nw'
  74. alias color='msgcat --color=test'
  75. alias pe='EDITOR=nvim pass edit'
  76. # Systemd aliases
  77. alias s=systemctl
  78. alias j='journalctl -eu'
  79. alias ju='journalctl --user -eu'
  80. ZSH_CACHE_DIR=$HOME/.oh-my-zsh-cache
  81. if [[ ! -d $ZSH_CACHE_DIR ]]; then
  82. mkdir $ZSH_CACHE_DIR
  83. fi
  84. source $ZSH/oh-my-zsh.sh
  85. # Vim mode
  86. zmodload zsh/zle
  87. bindkey -v
  88. bindkey -v '^?' backward-delete-char
  89. bindkey -v 'ii' vi-cmd-mode
  90. bindkey -a 't' vi-backward-char
  91. bindkey -a 'r' vi-forward-char
  92. bindkey -a 'd' up-history
  93. bindkey -a 's' down-history
  94. bindkey -a 'l' vi-delete
  95. bindkey -a 'L' vi-kill-eol
  96. echo -ne '\e[5 q'
  97. # perform parameter expansion/command substitution in prompt
  98. setopt PROMPT_SUBST
  99. vim_ins_mode="%{$bg[blue]%}%{$fg[black]%}%BINSERT%b%{$reset_color%}"
  100. vim_cmd_mode="%{$bg[green]%}%{$fg[black]%}%BNORMAL%b%{$reset_color%}"
  101. vim_mode=$vim_ins_mode
  102. function zle-keymap-select {
  103. if [ $KEYMAP = vicmd ];then
  104. echo -ne '\e[1 q'
  105. else
  106. echo -ne '\e[5 q'
  107. fi
  108. vim_mode="${${KEYMAP/vicmd/${vim_cmd_mode}}/(main|viins)/${vim_ins_mode}}"
  109. zle reset-prompt
  110. }
  111. zle -N zle-keymap-select
  112. function zle-line-finish {
  113. vim_mode=$vim_ins_mode
  114. }
  115. zle -N zle-line-finish
  116. RPROMPT='${vim_mode}'