增加管理员用户
useradd l****
passwd l****
chmod u+w /etc/sudoers
vim /etc/sudoers
96 ## Allow root to run any commands anywhere
97 root ALL=(ALL) ALL
99 l**** ALL=(ALL) ALL100
chmod u-w /etc/sudoers
.vimrc配置
vim ~/.vimrc
set nu
set tabstop=4
set expandtab
filetype on
set shiftwidth=4
set autoindent
set smartindent
set showmatch
syntax on
set hlsearch
"保存时,自动删除空格
autocmd BufWrite * execute ":%s/ *$//
"==========================================
" cscope Settings 设置
"==========================================
if has("cscope") && filereadable("/usr/bin/cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
"==========================================
" General Settings 基础设置
"==========================================
" 显示行号
set number
" 取消换行
set nowrap
" 括号配对情况, 跳转并高亮一下匹配的括号
set showmatch
" How many tenths of a second to blink when matching brackets
set matchtime=2
" A buffer becomes hidden when it is abandoned
set hidden
set wildmode=list:longest
set ttyfast
":hi MatchParen ctermbg=blue ctermfg=white
" history存储容量
set history=2000
" 检测文件类型
filetype on
" 针对不同的文件类型采用不同的缩进格式
filetype indent on
" 允许插件
filetype plugin on
" 启动自动补全
filetype plugin indent on
" 文件修改之后自动载入
set autoread
" 启动的时候不显示那个援助乌干达儿童的提示
set shortmess=atI
" 取消备份。 视情况自己改
set nobackup
" 关闭交换文件
set noswapfile
"==========================================
" Display Settings 展示/排版等界面格式设置
"==========================================
" 显示当前的行号列号
set ruler
" 在状态栏显示正在输入的命令
set showcmd
" 左下角显示当前vim模式
set showmode
" 在上下移动光标时,光标的上方或下方至少会保留显示的行数
set scrolloff=7
" set winwidth=79
" 命令行(在状态行下)的高度,默认为1,这里是2
set statusline=%<%f\ %h%m%r%=%k[%{(&fenc==\"\")?&enc:&fenc}%{(&bomb?\",BOM\":\"\")}]\ %-14.(%l,%c%V%)\ %P
" Always show the status line - use 2 lines for the status bar
set laststatus=2
" 显示行号
set number
" 取消换行
set nowrap
" 括号配对情况, 跳转并高亮一下匹配的括号
set showmatch
" How many tenths of a second to blink when matching brackets
set matchtime=2
" 设置文内智能搜索提示
" 高亮search命中的文本
set hlsearch
" 打开增量搜索模式,随着键入即时搜索
set incsearch
"" 缩进配置
" Smart indent
set smartindent
" 打开自动缩进
" never add copyindent, case error " copy the previous indentation on autoindenting
set autoindent
" tab相关变更
" 设置Tab键的宽度 [等同的空格个数]
set tabstop=4
" 每一次缩进对应的空格数
set shiftwidth=4
" 按退格键时可以一次删掉 4 个空格
set softtabstop=4
" insert tabs on the start of a line according to shiftwidth, not tabstop 按退格键时可以一次删掉 4 个空格
set smarttab
" 将Tab自动转化成空格[需要输入真正的Tab键时,使用 Ctrl+V + Tab]
set expandtab
" 缩进时,取整 use multiple of shiftwidth when indenting with '<' and '>'
set shiftround
" A buffer becomes hidden when it is abandoned
et hidden
set wildmode=list:longest
set ttyfast
"==========================================
" FileEncode Settings 文件编码,格式
"==========================================
" 设置新文件的编码为 UTF-8
set encoding=utf-8
" 自动判断编码时,依次尝试以下编码:
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
set helplang=cn
"set langmenu=zh_CN.UTF-8
"set enc=2byte-gb18030
" 下面这句只影响普通模式 (非图形界面) 下的 Vim
set termencoding=utf-8
" Use Unix as the standard file type
set ffs=unix,dos,mac
" 如遇Unicode值大于255的文本,不必等到空格再折行
set formatoptions+=m
" 合并两行中文时,不在中间加空格
set formatoptions+=B
"==========================================
" others 其它设置
"==========================================
" vimrc文件修改之后自动加载, windows
autocmd! bufwritepost _vimrc source %
" vimrc文件修改之后自动加载, linux
autocmd! bufwritepost .vimrc source %
" kj 替换 Esc
inoremap kj <Esc>
配置cscope vim
sudo vim /etc/profile
增加
export CSCOPE_EDITOR=vim