Skip to content

customized copyright #6

@bo-wu

Description

@bo-wu

Hi authors,

Thanks a lot for the excellent plugin. I use it for quite well, now I want to do some customization. However, I do not know the grammar of vimscript. I also search around and did not find the corrected answer.

The specific customization is changing
call append(l + 7, g:file_copyright_comment_mid_prefix." Last Modified : ".strftime("%Y-%m-%d %H:%M"))
to
call append(l + 13, g:file_copyright_comment_mid_prefix." \\date ".strftime("%Y/%m/%d %H:%M"))

And I also change
let regline = '^'.g:file_copyright_comment_mid_prefix.'\s*\S*Last\sModified\s*:\s*\S*.*$'
execute '/'.g:file_copyright_comment_mid_prefix.'\s*\S*Last\sModified\s*:/s@:.*$@\=strftime(": %Y-%m-%d %H:%M")@'
to
let regline = '^'.g:file_copyright_comment_mid_prefix.'\s*\\date\s*\s*.*$'
execute '/'.g:file_copyright_comment_mid_prefix.'\s*\\date\s*/s@*$@\=strftime("%Y/%m/%d %H:%M")@'
for update

The changes works well, but when I use "CopyrightUpdate", It seems something wrong with string match, and resulting double title. Could you please help me correcting the matching pattern?

thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions