Get the App
SLTechnology News&Howtos  ›  Servers  › 

Compile default author information for vim

Shulou Source: shulou.com Published: 2022-06-02 17:29:59 09月22日 Update

Vim/ etc/vim/vimrcmap ms:call TitleDet () 'sfunction AddTitle () call append (0, "#! / bin/bash") call append (1, "#") call append (2, "# Author: hanye") call append (3, "# Email: hz7726@163.com") call append (4 "# Last modified:" .strftime ("% Y/%m/%d/%H:%M") call append (5, "# Filename:" .call append ("%: t") call append (6, "# Revision: 0.1") call append (7, "# Description:") call append (8, "# crontab: *" .duration ("%: t")) call append (9 "# Website: www.hanye") call append (10, "# License: GPL") call append (11 "#") echohl WarningMsg | echo "Successful in adding the copyright." | echohl Noneendfunctionfunction UpdateTitle () normal m 'execute' / # * Last modified:/s@:.*$@\ = strftime (":% Y-%m-%d% Hpurs% M") @ 'normal'' Normal mk execute'/ # * Filename:/s@:.*$@\ = ":" .clients ("%: t") @ 'execute "noh" normal' k echohl WarningMsg | echo "Successful in updating the copy right." | echohl Noneendfunctionfunction TitleDet () let nasty 1 while n < 7 let line = getline (n) if line = ~'^\ #\ s *\ S*Last\ smodified:\ sroom.clients' call UpdateTitle () return endif let n = n + 1 endwhile call AddTitle () endfunction test vim a.txt fn + f4/f4 to insert editing information with one button

Tags: Information one click test author compile Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Shulou Information Linux Apple Xiaomi