Insert File Header/Copyright Feature


I would like to request this as a feature:

A package in Atom for creating headers for different programming languages? With information like :

Author Name
Date Created
Date Modified

Several existing editors have similar packages, for example sublime has -, and emacs which I commonly use has the make-headers package, which is quite complete.


For those whose needs aren’t quite as complex, there is my auto-copyright package that will insert a customizable header as a comment in files. It doesn’t support macros other than copyright owner name and copyright year … but that is enough for many.


Thanks @leedohm . I actually did have a look at the auto-copyright package. I was hoping to extend it myself, but unfortunately, I am unfamiliar with coffeescript.

Hope somebody else picks this up :slight_smile:


Consider this an opportunity to learn an excellent language. (grin)


I just wrote a FileHeader for Atom. I think it solves your problem. Check it out! :smiley:


I just made a snippet for myself: Cmd+Shift+P -> Application: Open your snippets, Added this: my snippets

giphy (1)


Hi cKx - Kick it up a notch. How about developing some coding that paste the note in from a short-cut or from the command-pallet.

You can have the text adapt the comment marker to the code grammar used.

TIP: Here is some Coffeescript to sip on…

return false unless _editor = atom.workspace.getActiveTextEditor()
_prefix = _editor.getCommentStrings(_editor.getCursorScope()).commentStartString


How do you run the package?


Apparently there is a command that you can call from the command palette, or bind it to a keybinding: auto-copyright:insert. Alternatively, there is a menu entry in the package section, called “Auto Copyright”, or the context menu from the editor (right click anywhere in a text editor, then click on “Insert Copyright”).

Hope this helps!


Thanks! I ran it but I got a bug.