1Set Nu"Serial Number2Set tabstop=4 "the size of the TAB key3 Set ShowCmd4Nnoremap <F2>: Set Nonumber!<cr>:set foldcolumn=0<CR>"use F2 to switch numbers for easy copying5 6 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""7 "create a new. c,.h,.sh,.java file, insert the file header automatically8Autocmd Bufnewfile *.CPP,*. [Ch],*.SH, *.java exec": Call Settitle ()" 9 ""define function settitle, insert file header automaticallyTen func settitle () One "If the file type is. sh file A if&filetype = ='SH' -Call Setline (1,"\#########################################################################") -Call Append ("."),"\# File Name:". Expand ("%")) theCall Append (".")+1,"\#[email protected] Author:panhao_neo")"here is the copyright name (author) -Call Append (".")+2,"\# Mail: [email protected]")"Email -Call Append (".")+3,"\# Created Time:". Strftime ("%c")) -Call Append (".")+4,"\#########################################################################") +Call Append (".")+5,"\#!/bin/bash") -Call Append (".")+6,"") + Else ACall Setline (1,"/*************************************************************************") atCall Append ("."),"> File Name:". Expand ("%")) -Call Append (".")+1,"> [email protected] Author:panhao_neo") -Call Append (".")+2,"> Mail: [email protected]") -Call Append (".")+3,"> Created Time:". Strftime ("%c")) -Call Append (".")+4," ************************************************************************/") -Call Append (".")+5,"") in endif - if&filetype = ='CPP' toCall Append (".")+6,"#include <iostream>") +Call Append (".")+7,"using namespace std;") -Call Append (".")+8,"") the endif * if&filetype = ='C' $Call Append (".")+6,"#include <stdio.h>")Panax NotoginsengCall Append (".")+7,"int main ()") -Call Append (".")+8,"{") theCall Append (".")+9," ") +Call Append (".")+Ten,"}") A endif the "if &filetype = = ' java ' + "Call Append (".") +6,"public class". Expand ("%")) - "Call Append (".") +7,"") $ "endif $ "automatically navigates to the end of a file after creating a new file -Autocmd Bufnewfile *Normal G -Endfunc