个人开发环境sudo+cscope+vim

来源:互联网 发布:5s4g网络怎么设置 编辑:程序博客网 时间:2024/06/15 14:17

增加管理员用户

useradd l****passwd l****chmod u+w /etc/sudoersvim /etc/sudoers96 ## Allow root to run any commands anywhere 97 root ALL=(ALL) ALL 99 l**** ALL=(ALL) ALL100chmod u-w /etc/sudoers

.vimrc配置
vim ~/.vimrc

set nuset tabstop=4set expandtabfiletype onset shiftwidth=4set autoindentset smartindentset showmatchsyntax onset 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 csverbendif"==========================================" General Settings 基础设置"==========================================" 显示行号set number" 取消换行set nowrap" 括号配对情况, 跳转并高亮一下匹配的括号set showmatch" How many tenths of a second to blink when matching bracketsset matchtime=2" A buffer becomes hidden when it is abandonedset hiddenset wildmode=list:longestset 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,这里是2set 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 barset laststatus=2" 显示行号set number" 取消换行set nowrap" 括号配对情况, 跳转并高亮一下匹配的括号set showmatch" How many tenths of a second to blink when matching bracketsset matchtime=2" 设置文内智能搜索提示" 高亮search命中的文本set hlsearch" 打开增量搜索模式,随着键入即时搜索set incsearch"" 缩进配置" Smart indentset smartindent" 打开自动缩进" never add copyindent, case error   " copy the previous indentation on autoindentingset 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 abandonedet hiddenset wildmode=list:longestset ttyfast"==========================================" FileEncode Settings 文件编码,格式"==========================================" 设置新文件的编码为 UTF-8set encoding=utf-8" 自动判断编码时,依次尝试以下编码:set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1set helplang=cn"set langmenu=zh_CN.UTF-8"set enc=2byte-gb18030" 下面这句只影响普通模式 (非图形界面) 下的 Vimset termencoding=utf-8" Use Unix as the standard file typeset ffs=unix,dos,mac" 如遇Unicode值大于255的文本,不必等到空格再折行set formatoptions+=m" 合并两行中文时,不在中间加空格set formatoptions+=B"==========================================" others 其它设置"==========================================" vimrc文件修改之后自动加载, windowsautocmd! bufwritepost _vimrc source %" vimrc文件修改之后自动加载, linuxautocmd! bufwritepost .vimrc source %" kj 替换 Escinoremap kj <Esc>

配置cscope vim

 sudo vim /etc/profile增加export CSCOPE_EDITOR=vim