作者:邓聪聪
[root@localhost ~]# cat ~/.vimrc syntax on " ============================================== " " General settings " " ============================================== set nocp set ru set nu " "set cin " "set cino = :0g0t0(sus set sm set ai set sw=4 set ts=4 set noet set lbr set hls "set backspace = indent , eol , start "set whichwrap = b , s , < , > , [ , ] "set fo+ = mB set selectmode = "set mousemodel = popup set keymodel = "set selection = inclusive "set matchpairs+ = " " ============================================== " " Cursor movement " " ============================================== " "nnoremap gj " "nnoremap gk " "vnoremap gj " "vnoremap gk " "inoremap gj " "inoremap gk " "nnoremap g$ " "nnoremap g0 " "vnoremap g$ " "vnoremap g0 " "inoremap g$ " "inoremap g0 " "nmap :confirm bd " "vmap :confirm bd " "omap :confirm bd " "map! :confirm bd " syntax on set foldmethod=syntax if (has( " gui_running " )) set nowrap set guioptions+=b colo inkpot else set wrap colo ron endif "let mapleader = " , " if !has("gui_running") set t_Co=8 set t_Sf=^[[3%p1%dm set t_Sb=^[[4%p1%dm endif
[root@localhost ~]# more ~/.bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi alias vi=vim alias grep='grep --color'
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
alias vi=vim
#export PS1="[ 33]2;h:uw 07 33[32;1m]u@$ip 33[35;1m 33[0m[ 33[34;1m]w[ 33[0m][e[31;1m] # [e[0m]"
export PS1="[ 33]2;H:uw 07 33[32;1m]u@ 33[33;1mH 33[35;1m$ip 33[0m[ 33[36;1m]w[ 33[0m] [e[31;1m]# [e[0m]"
$vim ~/.vimrc #将以下内容写入vimrc文件中,注释除外: #关闭vim所有扩展的功能,避免产生bug和局限 set nocompatible #显示行号 set number #检测文件的类型 filetype on #记录历史的行数 set history=1000 #背景使用黑色 set background=dark #语法高亮度显示 syntax on #设置自动对齐 set autoindent #智能的选择对齐方式 set smartindent #设置tab键为4个空格 set tabstop=4 #设置当行之间交错时使用4个空格 set shiftwidth=4 #设置自动匹配符号模式 set showmatch #去除vim的GUI版本中的toolbar set guioptions-=T #当vim进行编辑时,如果命令错误,会发出一个响声,该设置去掉响声 set vb t_vb= #在编辑过程中,在右下角显示光标位置的状态行 set ruler #默认情况下,寻找匹配是高亮度显示的,该设置关闭高亮显示 set nohls #设置快速寻找搜索结果 set incsearch