Vim automatically adds annotations

Source: Internet
Author: User

I thought about it, to do something good,

1, first of all like it's the most motive to understand it

2, hearsay about that thing, will go to understand and go to play a turn

3, interest needs to be cultivated

One add VIM header information.

System: C67

Append the following code to/ETC/VIMRC.

Map <F4>: Call Titledet () <cr>'sfunctionaddtitle () call Append (0,"/*=============================================================================") Call Append (1,"#") Call Append (2,"# author:lanny-[email protected]") Call Append (3,"#") Call Append (4,"# qq:781647046") Call Append (5,"#") Call Append (6,"# Last modified:". Strftime ("%y-%m-%d%h:%m")) Call Append (7,"#") Call Append (8,"# Filename:". Expand ("%:t")) Call Append (9,"#") Call Append (Ten,"# Description:") Call Append ( One,"#") Call Append ( A,"=============================================================================*/") Echohl warningmsg|Echo "successful in adding the copyright."|Echohl noneendffunctionupdatetitle () normal m'Execute'/# *last modified:/[email protected]:.*[email protected]\=strftime (": \t%y-%m-%d%h:%m") @'Normal"'Normal Mk Execute'/# *filename:/[email protected]:.*[email protected]\= ": \t\t". Expand ("%:t") @'Execute"Noh"Normal'kEchohl warningmsg |Echo "successful in updating the copy right."|Echohl noneendfunctionfunctionTitledet () Let n=1     whileN <Ten Let Line=getline (n)ifLine =~'^\#\s*\s*last\smodified:\s*.*$'Call Updatetitle () return endif let n= n +1Endwhile Call AddTitle () endfunction

Vim automatically adds annotations

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.