其他
1. git bash vim配置,支持python,c, c++头文件标头autocmd BufNewFile *.cpp,*.py,*.[ch],*.sh,*.java exec ":call SetTitle()"
func SetTitle() if &filetype == 'sh' call setline(1,"\#########################################################################") call append(line("."), "\# File Name:".expand("%")) call append(line(".")+1, "\# Author:Xwell") call append(line(".")+2, "\# mail:Xwell@qq.com") call append(line(".")+3, "\# Created Time:".strftime("%Y-%m-%d %H:%M")) call append(line(".")+4, "\#########################################################################") call append(line(".")+5, "\#!/bin/bash") call append(line(".")+6, "") else if &filetype == 'python'call setline(1,"\#########################################################################") call append(line("."), "\# File Name:".expand("%")) call append(line(".")+1, "\# Author:Xwell") call append(line(".")+2, "\# mail:Xwell@qq.com") call append(line(".")+3, "\# Created Time:".strftime("%Y-%m-%d %H:%M")) call append(line(".")+4, "\#########################################################################") call append(line(".")+5, "\#!/usr/bin/python") call append(line(".")+6, "")endifif &filetype == 'cpp'call setline(1, "/*************************************************************************") call append(line("."), "\* @Filename : ".expand("%")) call append(line(".")+1, "\* @Description : ") call append(line(".")+2, "\* @Date : ".strftime("%Y-%m-%d %H:%M")) call append(line(".")+3, "\* @Author : Xwell")call append(line(".")+4, "\* @Email : xxxxxx@qq.com")call append(line(".")+5, "\* @Vesion : 1.0")call append(line(".")+6, "\* @ Copyright (c) 2024 Xwell. All rights reserved")call append(line(".")+7, "\* ************************************************************************/") call append(line(".")+8, "")call append(line(".")+9, "#include<iostream>")call append(line(".")+10, "using namespace std;")call append(line(".")+11, "")call append(line(".")+12, "int main(int argc, char* argv[]){")call append(line(".")+13, " return 0;")call append(line(".")+14, "}")endifif &filetype == 'c'call setline(1, "/*************************************************************************") call append(line("."), "\* @Filename : ".expand("%")) call append(line(".")+1, "\* @Description : ") call append(line(".")+2, "\* @Date : ".strftime("%Y-%m-%d %H:%M")) call append(line(".")+3, "\* @Author : Xwell")call append(line(".")+4, "\* @Email : Xwell@qq.com")call append(line(".")+5, "\* @Vesion : 1.0")call append(line(".")+6, "\* @ Copyright (c) 2024 Xwell. All rights reserved")call append(line(".")+7, "\* ************************************************************************/") call append(line(".")+8, "")call append(line(".")+9, "#include<stdio.h>")call append(line(".")+10, "")endifendifautocmd BufNewFile * normal G
endfunc