Centos6.x安裝以後的9件事

Centos6.x安裝以後的9件事

這些不是必須都作的,只不過是我我的的習慣,在此記錄一下。html

1.修改yum源到國內

CentOS系統更換軟件安裝源
  1. 備份你的原鏡像文件,以避免出錯後能夠恢復。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
  1. 下載新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  1. 生成緩存
yum clean all
   yum makecache
   yum update

2.防火牆設置

# 臨時關閉防火牆
service iptables stop

# 永久關閉防火牆
chkconfig iptables off

3.設置ssh免密登錄

ssh免密登錄設置教程git

4.添加man

yum -y install man

5.修改目錄顏色

注意:先安裝zsh後再執行,否則安裝zsh後又變回原來的樣子了github

# 方法一:
# 在~/.bash_profile文件中添加LS_COLORS
export LS_COLORS='no=00:fi=00:di=01;33:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;35:*.cmd=01;35:*.exe=01;35:*.com=01;35:*.btm=01;35:*.bat=01;35:*.sh=01;35:*.csh=01;35:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:'


# 方法二:
# 拷貝/etc/DIR_COLORS文件爲當前主目錄的 .dir_colors
cp /etc/DIR_COLORS ~/.dir_colors
# 修改~/.dir_colors中DIR對應的顏色
vim ~/.dir_colors
# 把DIR 01;34(01:粗體,34:藍色)修改成 DIR 01;33(01:粗體,33:黃色)
# eval `dircolors /etc/DIR_COLORS`

6.個性化Vim

:set nu
:noh
set ignorecase
set shortmess=atI
syntax on
autocmd InsertLeave * se nocul
set ruler
set showcmd
set foldenable
set foldmethod=manual
set autowrite
set cursorline
set confirm
set autoindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set smarttab
set hlsearch
set incsearch
set enc=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set langmenu=zh_CN.UTF-8
set showmatch
set smartindent

7.刪除配置文件中以'#'開始的註釋

# 刪除~/.zshrc文件中以#開頭的註釋行
sed -i -e '/#/d' ~/.zshrc

# 刪除~/.zshrc文件中的空行
sed -i -e '/^\s*$/d' ~/.zshrc

8.zsh

# 安裝zsh
yum install zsh

# 下載oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

# 修改主題
vim ~/.zshrc
# 修改第10行爲
ZSH_THEME="agnoster"
# 保存退出後
source ~/.zshrc

# !!若是出現亂碼的話,請自行安裝PowerLineII字體~

9.zsh插件

# 自動提示插件
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

# 修改自動提示的顏色
vim ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh

# 找到 ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' 修改成
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6'

# 高亮插件
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

# vim ~/.zshrc 並找到plugins
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

source ~/.zshrc
相關文章
相關標籤/搜索