ZSH配置文件

  1. # If you come from bash you might have to change your $PATH.
  2. # export PATH=$HOME/bin:/usr/local/bin:$PATH
  3. # Path to your oh-my-zsh installation.
  4. export ZSH=$HOME/.oh-my-zsh
  5. # Set name of the theme to load --- if set to "random", it will
  6. # load a random theme each time oh-my-zsh is loaded, in which case,
  7. # to know which specific one was loaded, run: echo $RANDOM_THEME
  8. # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
  9. ZSH_THEME="ys"
  10. # Set list of themes to pick from when loading at random
  11. # Setting this variable when ZSH_THEME=random will cause zsh to load
  12. # a theme from this variable instead of looking in $ZSH/themes/
  13. # If set to an empty array, this variable will have no effect.
  14. # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
  15. # Uncomment the following line to use case-sensitive completion.
  16. # CASE_SENSITIVE="true"
  17. # Uncomment the following line to use hyphen-insensitive completion.
  18. # Case-sensitive completion must be off. _ and - will be interchangeable.
  19. # HYPHEN_INSENSITIVE="true"
  20. # Uncomment the following line to disable bi-weekly auto-update checks.
  21. # DISABLE_AUTO_UPDATE="true"
  22. # Uncomment the following line to automatically update without prompting.
  23. # DISABLE_UPDATE_PROMPT="true"
  24. # Uncomment the following line to change how often to auto-update (in days).
  25. # export UPDATE_ZSH_DAYS=13
  26. # Uncomment the following line if pasting URLs and other text is messed up.
  27. # DISABLE_MAGIC_FUNCTIONS="true"
  28. # Uncomment the following line to disable colors in ls.
  29. # DISABLE_LS_COLORS="true"
  30. # Uncomment the following line to disable auto-setting terminal title.
  31. # DISABLE_AUTO_TITLE="true"
  32. # Uncomment the following line to enable command auto-correction.
  33. # ENABLE_CORRECTION="true"
  34. # Uncomment the following line to display red dots whilst waiting for completion.
  35. # COMPLETION_WAITING_DOTS="true"
  36. # Uncomment the following line if you want to disable marking untracked files
  37. # under VCS as dirty. This makes repository status check for large repositories
  38. # much, much faster.
  39. # DISABLE_UNTRACKED_FILES_DIRTY="true"
  40. # Uncomment the following line if you want to change the command execution time
  41. # stamp shown in the history command output.
  42. # You can set one of the optional three formats:
  43. # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
  44. # or set a custom format using the strftime function format specifications,
  45. # see 'man strftime' for details.
  46. # HIST_STAMPS="mm/dd/yyyy"
  47. # Would you like to use another custom folder than $ZSH/custom?
  48. # ZSH_CUSTOM=/path/to/new-custom-folder
  49. # Which plugins would you like to load?
  50. # Standard plugins can be found in $ZSH/plugins/
  51. # Custom plugins may be added to $ZSH_CUSTOM/plugins/
  52. # Example format: plugins=(rails git textmate ruby lighthouse)
  53. # Add wisely, as too many plugins slow down shell startup.
  54. plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
  55. source $ZSH/oh-my-zsh.sh
  56. # User configuration
  57. # export MANPATH="/usr/local/man:$MANPATH"
  58. # You may need to manually set your language environment
  59. # export LANG=en_US.UTF-8
  60. # Preferred editor for local and remote sessions
  61. # if [[ -n $SSH_CONNECTION ]]; then
  62. # export EDITOR='vim'
  63. # else
  64. # export EDITOR='mvim'
  65. # fi
  66. # Compilation flags
  67. # export ARCHFLAGS="-arch x86_64"
  68. # Set personal aliases, overriding those provided by oh-my-zsh libs,
  69. # plugins, and themes. Aliases can be placed here, though oh-my-zsh
  70. # users are encouraged to define aliases within the ZSH_CUSTOM folder.
  71. # For a full list of active aliases, run `alias`.
  72. #
  73. # Example aliases
  74. alias cls="clear"
  75. alias zshconfig="vim ~/.zshrc"
  76. alias ohmyzsh="cd ~/.oh-my-zsh"
  77. alias doc="docker"
  78. alias doccom="docker-compose"
  79. #alias rm="rm -i"
  80. alias cp="cp -i"
  81. alias mv="mv -i"
  82. alias cat="ccat"
  83. alias grep='grep --color=auto'
  84. # Warning delete
  85. #alias rm[:blank:]-rf="echo haha"
  86. # other
  87. # eval "$(starship init zsh)"
  88. # fzf
  89. [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
  90. # NVM
  91. export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
  92. [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  93. # golang
  94. export GOROOT=/usr/local/go
  95. export PATH=$PATH:$GOROOT/bin
  96. export GO111MODULE="on"
  97. export GOPROXY="https://goproxy.cn"

修改系统语言为中文

  1. locale -a # 查看系统是否有中文语言支持,zh_CN.UTF-8是简体中文,如果没有zh_CN.UTF-8,就安装语言包
  2. yum groupinstall "fonts" #安装中文字体包
  3. LANG="zh_CN.UTF-8" #修改为中文
  4. LANG="en_US.UTF-8" #修改为英文
  1. locale -a 查看系统是否有中文语言支持,zh_CN.UTF-8是简体中文,如果没有zh_CN.UTF-8,就安装语言包
  2. yum install langpacks-zh_CN.noarch 安装中文字体包
  3. 临时修改
    1. LANG="zh_CN.UTF-8" 修改为中文
    2. LANG="en_US.UTF-8" 修改为英文
  4. 永久修改

vi /etc/locale.conf 中修改为LANG=zh_CN.UTF8或者
localectl set-locale LANG=zh_CN.UTF8
echo "export LC_ALL=en_US.UTF-8" >> /etc/profile

Centos图形界面切换

  1. 查看目前默认的启动默认

systemctl get-default
命令行模式 :multi-user.target
图形界面模式:graphical.target

  1. 设置为图形界面模式

systemctl set-default graphical.target

  1. 设置为命令行模式

systemctl set-default multi-user.target

修改主机名

  • 临时修改

hostname <name>

  • 永久修改

hostnamectl set-hostname <name>