set nobackup
" Tab操作快捷方式!
nnoremap <C-TAB> :tabnext<CR>
nnoremap <C-S-TAB> :tabprev<CR>
" nnoremap <C-T> :tabnew<CR>
" 设置背景颜色
set gfn=Courier_New:h13
colorscheme torte
au BufRead,BufNewFile,BufEnter * cd %:p:h
set nocp "不与vi兼容
filetype plugin on "允许插件
set number " 显示行号
set cursorline " 突出显示当前行
set ruler " 打开状态栏标尺
set shiftwidth=4 " 设定 << 和 >> 命令移动时的宽度为 4
set softtabstop=4 " 使得按退格键时可以一次删掉 4 个空格
set tabstop=4 " 设定 tab 长度为 4
set ignorecase smartcase " 搜索时忽略大小写,但在有一个或以上大写字母时仍保持对大小写敏感
set showmatch " 插入括号时,短暂地跳转到匹配的对应括号
set matchtime=1 " 短暂跳转到匹配括号的时间
set guioptions-=T " 隐藏工具栏
set guioptions-=m " 隐藏菜单栏
set guioptions-=L " 隐藏左滚动栏
set guioptions-=r " 隐藏右滚动栏
set smartindent " 开启新行时使用智能自动缩进
" set foldenable " 开始折叠
" set foldmethod=syntax " 设置语法折叠
" set foldcolumn=0 " 设置折叠区域的宽度
" setlocal foldlevel=1 " 设置折叠层数为
" nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR> " 用空格键来开关折叠
" :A 切换同名头文件并独占整个屏幕
" 以下为自动添加注释的代码
"添加函数注释
function FUNHEAD()
let li=line(".")
call append(li,"/**")
call append(li+1,"* @brief "
call append(li+2,"* @param[in] ")
call append(li+3,"* @param[out] ")
call append(li+4,"* @return ")
call append(li+5,"*/")
echohl WarningMsg | echo "Successful in adding the notes." | echohl None
endf
"添加文件头注释
function FILEHEAD()
let li=line(".") - 1
call append( li + 0, "/**" )
call append( li + 1, "* @filename ".bufname("%") )
call append( li + 2, "* @brief " )
call append( li + 3, "* @date ".strftime( "%c" ) )
call append( li + 4, "* @author wlb" )
call append( li + 5, "*/")
echohl WarningMsg | echo "Successful in adding the notes." | echohl None
endf
" map <F4> : call AddTitle()
" 自动加注释代码结束
" 显示目录左边栏
function Explore()
20vs
Ex
endf
" ctags
let Tlist_Ctags_Cmd=" ctags.exe"
let Tlist_WinWidth=25
" 设置编码
function UTF8()
set encoding=utf8
endf
" 文档格式化,整个文件风格化,不保存备份,自动重加载缓冲
function Style()
let StyleDir="d:\\SourceInsight\\SI\\uncrustify-0.56-win32\\"
let StyleExe=StyleDir."uncrustify.exe"
let StyleCnf=StyleDir."amxmodx.cfg"
let CurFile=bufname("%")
bdelete
exe "!".StyleExe." ".CurFile." -c "StyleCnf." --no-backup"
echohl WarningMsg | echo "Successful in indenting." | echohl None
exe "open ".CurFile
endf
" 批量注释
function Notes()
s/^/\/\//g
endf
function UnNotes()
s/^\/\///g
endf