GithubHelp home page GithubHelp logo

vscode-fileheader's Introduction

vscode-fileheader

feature

Add notes to the file header, and supports automatic update file modification time.

eg:

/*
 * @Author: mikey.zhaopeng
 * @Email:  [email protected]
 * @Date:   2016-07-29 15:57:29
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2016-08-09 13:29:41
 */

fileheader

Tip: ctrl+alt+i You can insert comments in the head, ctrl+s After you save the file, and automatically update the time and author.

install

Press F1,typeext install fileheader.

Configuration

In the User Settings inside, set and modify the creator's name & email.

"fileheader.Author": "tom",
"fileheader.Email": "[email protected]",
"fileheader.LastModifiedBy": "jerry"

name config

hot key

ctrl+alt+i You can insert comments in the head.

Change log

1.0.0

  1. Support hotkey insert header comments
  2. Support Save file, automatically update the time
  3. Support the configuration and update the creator's name

task

 [] 1. add template 

vscode-fileheader's People

Contributors

caoweiju avatar eastegg avatar huangyuan avatar zhaopengme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-fileheader's Issues

行尾加了空格会使eslint报错

由于团队使用了eslint,fileheader生成注释时会自动在行尾加空格,导致eslint报错,而修改fileheader.tpl配置也不生效

Multiline string settings are now supported in the settings editor

Ref microsoft/vscode#79571

Hi! Just a note that you can now add the "editPresentation": "multilineText" key-value pair to any string setting that can take multiple lines (such as fileheader.tpl). In the settings editor, the setting will then display a textarea rather than a single-line inputbox. The feature is currently available in the Insiders edition of VS Code, and will be released to Stable in around two weeks.

did not work for mac ?

it does not generate the wanted template comment in file header through the key withctrl + option + i.

add python suport

in my python file when i save the file the format is for javasctipt file for python we need hash

javscript format

/*
 * @Author: Georgios X
 * @Date: 2017-10-27 03:45:48 
 * @Last Modified by:   George X
 * @Last Modified time: 2017-10-27 03:45:48 
 */

python.py file

#################################
# @Author: Georgios X
# @Date: 2017-10-27 03:45:48 
# @Last Modified by:   George X
# @Last Modified time: 2017-10-27 03:45:48 
#################################

How to add custom headers like company name and copyright statement with year..

i want the thing like this.

{
"fileheader.Author": "King",
"fileheader.LastModifiedBy": "King",
"fileheader.Company": "Copyright (c) {year} My World.",
"fileheader.tpl": "/*\r\n * @Company: {Company} \r\n * @author: {author} \r\n * @Date: {createTime} \r\n * @last Modified by: {lastModifiedBy} \r\n * @last Modified time: {updateTime} \r\n */\r\n"
}

please have a look to this package functionality
https://marketplace.visualstudio.com/items?itemName=doi.fileheadercomment

Replacement comment characters / change to comment block for another coding language [solved]

In the "User" settings and "Workspace" settings under the 'vscode-fileheader' extension settings you need to update:

  1. Fileheader: Author --> [desired name]
  2. Fileheader: Last Modified By -> [desired name]

** this is how you can update the Comment block to suit another programming language:

First, find an example of the Comment block for the desired programming language. Next, DO NOT DELETE the '@author: {author} , @created: {createTime}' , etc. fields in the "Fileheader: Tpl" settings. INSTEAD -- before each "@" symbol, add in the character used for 'newline' for your language of choice ... ex) Python: input "\n" right before the "@" symbols
You can of course delete the extra asterisks (*) inside the "Fileheader: Tpl" field if they are of no use to you in your Comment block
(FINAL STEP): Be sure that you have added the needed "Comment block symbols" at the beginning and end of the field for "Fileheader: Tpl" ... **ex) Python: input """ at both the beginning (before any other characters) and end of the field (after all characters) ... **ex) Powershell: input <# at the beginning of the field before all other characters, and #> at the end of the field after all other characters.
Add in 'newline' ( \n ) as needed to reformat the file header to your liking. REMEMBER: you must make the changes in both "User" and "Workspace" tabs for the extension (make changes in one tab, copy and paste to the other) ... must then close and re-open VS Code before extension changes will take affect

Originally posted by @motraor3 in #16 (comment)

Allow to insert year

Currently it's possible to insert the {createTime} or {updateTime}. It would be nice if this could be customized so that it's possible to insert the year without day and month.

This would be helpful for inserting a copyright string in the template, e.g.

// Copyright (c) {year} {author}

One option would be to add a new variable {year} that contains the current year. Another option is to allow to customize the {createTime}/{updateTime}, e.g. by specifying a format: {createTime:yyyy}

希望可以支持用户自定义模板

Hello

由于团队规范需求,希望能够修改配置模板;但是修改模板后保存自动更新 Last Modified Time 这个feature就失效了,看了下代码是由于注释必须是 /* ... */ 的形式。

所以非常希望能够支持自定义模板;或者提供CommentStart和CommentEnd这两个配置项可能也是一种方法。

非常感谢。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.