syntax on " 语法高亮显示
set nocompatible " 关闭vim扩展功能,模拟vi行为
set number " 设置行号
filetype on " 开启文件类型检测
set history=1000
set background=dark
set autoread " 设置文件被改动时自动载入
set autoindent " 自动缩进
"set cindent " 针对C语言
"set smartindent
set tabstop=4 " Tab键宽度
set shiftwidth=4
set showmatch
set guioptions-=T
set ruler " 打开状态标尺
"set cursorline " 突出显示当前行
set nohls
set incsearch
set nocompatible " 共享剪贴板
"set fileencodings=utf-8
if &term=="xterm"
set t_Co=8
set t_Sb=^[[4%dm
set t_Sf=^[[3%dm
endif
function AddFileInformation_php()
let infor = "<?php\n"
\." ******************************************************************** \n"
\." * Copyright (c) 2016 \n"
\." * \n"
\." ********************************************************************/ \n"
\." \n"
\."/** \n"
\." * @file: ".expand("%")." \n"
\." * @author: Janesong \n"
\." * @mail: Janesong0806@163.com \n"
\." * @date: ".strftime("%Y-%m-%d %H:%M:%S")." \n"
\." * @version 1.0 \n"
\." **/ \n"
\." \n"
\." \n"
\." \n"
\." \n"
\."?>"
silent put! =infor
endfunction
autocmd BufNewFile *.php call AddFileInformation_php()
function AddFileInformation_sh()
let infor = "#!/bin/bash\n"
\."\n"
\."# ******************************************************************** \n"
\."# * @file: ".expand("%")." \n"
\."# * @author: Janesong \n"
\."# * @mail: Janesong0806@163.com \n"
\."# * @date: ".strftime("%Y-%m-%d %H:%M:%S")." \n"
\."# * @version 1.0 \n"
\."# * @description: Shell script. \n"
\."# * @Copyright (c) all right reserved \n"
\."# ********************************************************************/ \n"
\."\n"
\."\n"
\."\n"
\."\n"
\."exit 0"
silent put! =infor
endfunction
autocmd BufNewFile *.sh call AddFileInformation_sh()
function AddFileInformation_py()
let infor = "#!/usr/bin/env python\n"
\."# -*- coding: utf-8 -*-\n"
\."# ******************************************************************** \n"
\."# * @file:".expand("%")." \n"
\."# * @author: Janesong \n"
\."# * @mail: Janesong0806@163.com \n"
\."# * @date: ".strftime("%Y-%m-%d %H:%M:%S")." \n"
\."# * @version 1.0 \n"
\."# * @description: Python Script. \n"
\."# * @Copyright (c) all right reserved \n"
\."# ********************************************************************/ \n"
\."import os,sys"
\."\n"
\."print u'''??'''\n"
\."\n"
\."\n"
\."\n"
\."\n"
\."exit()"
silent put! =infor
endfunction
autocmd BufNewFile *.py call AddFileInformation_py()
function AddFileInformation_cpp()
let infor = "#include<iostream>\n"
\."# ******************************************************************** \n"
\."# * @file: ".expand("%")." \n"
\."# * @author: Janesong \n"
\."# * @mail: Janesong0806@163.com \n"
\."# * @date: ".strftime("%Y-%m-%d %H:%M:%S")." \n"
\."# * @version 1.0 \n"
\."# * @description: C++ Script. \n"
\."# * @Copyright (c) all right reserved \n"
\."# ********************************************************************/ \n"
\."\n"
\."\n"
\."\n"
\."\n"
silent put! =infor
endfunction
autocmd BufNewFile *.cpp call AddFileInformation_cpp()