我的Centos全局环境设置(bash,vim)

一:设置bashrc

 全局/etc/bashrc/
 if [ -f /etc/aliasrc ]; then
      . /etc/aliasrc
    fi  

#...
#...
#something global env setting 

 

本地用户~/.bashrc
 
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi

if [ -f ./.bashrc_local ]; then
    source .bashrc_local
fi

if [ -f ./.alias ]; then
    source .alias
fi  

 

 
二:设置alias
全局/etc/aliasrc:
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias g='gvim'
alias ga='g ~/.alias'
alias glg='git lg'
alias gls='git status'
alias grep='grep --color=auto'
alias gst='git status'
alias h='history'
alias l='ls -lh'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
alias sa='source ~/.alias'
alias venv='virtualenv'

本地~/.alias:

 

alias cdtest='cd ~/test'
alias cdlab='cd ~/lab'
alias ...="cd ../../../"
....
..

 

三:设置vim 

全局:

/etc/vim/autoload/pathogen.vim  

/etc/vim/autoload/bundle/**  VIM插件统一安装到该目录下,本地用户ln -s 到各自目录

/etc/vimrc

"-------------------------------------------------
set nu
colorscheme desert
syntax on
set ruler
"set cursorline
"set cursorcolumn
"-------------------------------------------------
imap <s-enter> <esc>o
imap <c-enter> <esc>O

nmap K 6k
nmap J 6j
"-------------------------------------------------
set autoindent
set smartindent
set smarttab
set tabstop=4
set shiftwidth=4
set expandtab
set list listchars=tab:>-
"ret !4
set virtualedit=all 
"-------------------------------------------------
"call pathogen#infect()  
syntax on
filetype plugin indent on
"-------------------------------------------------
autocmd FileType apache set commentstring=#\ %s
autocmd FileType verilog set commentstring=//\ %s
autocmd FileType c set commentstring=//\ %s
                                                    

本地用户:

ln -s /etc/vim/autoload/  ~/.vim/

ln -s /etc/vim/autoload/bundle/* ~/.vim/bundle/

g ~/.vimrc 需要加入

call pathogen#infect()

 

posted @ 2014-11-03 22:08  goco  阅读(864)  评论(0)    收藏  举报