Giter Site home page Giter Site logo

fileheader's People

Contributors

bendem avatar fgummesson avatar naoyeye avatar petrikoz avatar reinaldorauch avatar sbilly avatar shiyanhui avatar zhanghan177 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fileheader's Issues

Personal setting for blade.php

I am using Laravel Blade templating. The file has suffix .blade.php. When I use FileHeader, it automatically detects my file as php. But in this case I want to change it to html. How can I do that?

Incorrect Syntax when create a new file ( if one change the default syntax for some ext).

I set all .js to syntax javascript(babel) by sublime menus: View -> Syntax -> Open all with current extension as... ->[your syntax choice].
http://stackoverflow.com/questions/7574502/set-default-syntax-to-different-filetype-in-sublime-text-2

It work fine with the original sublime New File. But when I use FileHeader > New File, it create a file with syntax javascript. I have to set it to javascript(babel) manually.

Last_modified_time update not working with custom (or default) time format string

Ok, this time i'm not sure why.

Here are my user settings:

{
"custom_template_header_path": "~/code_templates/FileHeader/header/",
"custom_template_body_path": "~/code_templates/FileHeader/body",

// For now, we have to set time_format to an invalid selection for
// auto-update to work with a custom time format string.

// Set this to match my Vim setup i.e.
// Sun Oct 04, 2015  03:45PM
"custom_time_format": "%a %b %d, %Y %I:%M:%S %p",

"Default": {
    "email": "[email protected]"
},

"file_suffix_mapping": {
    "as": "ActionScript",
    "scpt": "AppleScript",
    "asp": "ASP",
    "aspx": "ASP",
    "bat": "Batch File",
    "cmd": "Batch File",
    "c": "C",
    "cs": "C#",
    "cpp": "C++",
    "hpp": "C++",
    "clj": "Clojure",
    "css": "CSS",
    "D": "D",
    "erl": "Erlang",
    "go": "Go",
    "groovy": "Groovy",
    "hs": "Haskell",
    "htm": "HTML",
    "html": "HTML",
    "java": "Java",
    "js": "JavaScript",
    "tex": "LaTeX",
    "lsp": "Lisp",
    "lua": "Lua",
    "md": "Markdown",
    "mat": "Matlab",
    "m": "Objective-C",
    "ml": "OCaml",
    "p": "Pascal",
    "pl": "Perl",
    "php": "PHP",
    "py": "Python",
    "R": "R",
    "rst": "RestructuredText",
    "rb": "Ruby",
    "scala": "Scala",
    "sh": "ShellScript",
    "sql": "SQL",
    "tcl": "TCL",
    "txt": "Text",
    "xml": "XML"
}
}

It will work correctly when I add the header to the file, but it will not update on save.
Any thoughts? I can provide more details if you need. Just let me know.

Clutters up the console on ST3 Windows

Whenever I switch document it prints out the currently used template 3 times to the console.
Example:
C:\Users\Johan\AppData\Roaming\Sublime Text 3\Packages\FileHeader\template/header\PHP.tmpl

Could this be removed?

cursor position is wrong when create a new file

when I create a new file by "File Header -> new file", the cursor in the new file is at the beginning, I need to use the mouse to move it. I think the correct position is under the header info. How could I do this?

FileHeader for Atom

Any chance that you could provide a link to my FileHeader for Atom project in your README.md?

I loved your FileHeader for Sublime so much. Now I have migrated to Atom and found out there was no FileHeader. I was very disappointed :(, so I implemented one my own. If you could mention this, I think it could benefit other migrants like myself.

Cheers,
Guan

Default keymap conflicts with national characters

After installing FileHeader plugin I'm unable to enter some Polish language-specific characters:

  • ś (right alt + s)
  • ń (right alt + n)

Other plugins have the same issue: http://stackoverflow.com/questions/25924373/certain-national-characters-blocked-in-sublime-text-3
As it's written by trejder, it's mainly because:

Sublime Text 3 doesn't make any difference between pressing Right Alt and Ctrl+Left Alt

When I deleted all bindings from FileHeader default keymap it's working fine.

.Git directory is modified

Even when the setting enable_add_header_to_hidden_file set to false, the plugin is still trying to insert headers into the directory. I'm using sublime text 2 just as a fyi

Add New File - PHP

When you are making new PHP files, the code that it actually generates is invalid. It has the comment block above the <?php block which means that it would be emitted to the page/script.

/* 
* @Author: {author}
* @Date:   {date}
* @Last Modified by:   {author}
* @Last Modified time: {date}
*/

<?php

?>

Should actually be:

<?php
/* 
* @Author: {author}
* @Date:   {date}
* @Last Modified by:   {author}
* @Last Modified time: {date}
*/
?>

[Fix provided]: Add support for user's home directory based paths.

Currently, when setting "custom_template_header_path" and "custom_template_body_path" only absolute paths are supported because of the current state of get_template_part in FileHeader.py.

I have found an OS agnostic method of handling paths based on home directories, and it is tested and working on OSX, and should work on the other major OSes.

Simply change

_ = os.path.join(custom_template_path, tmpl_name)

to

_ = os.path.expanduser(os.path.join(custom_template_path, tmpl_name))

If the given path does not contain a home directory relative to that system then the function will return the original path unmodified.

If you'd prefer, I can submit a pull request.

During handling of the above exception, another exception occurred

error in ST3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "FileHeader in /config/sublime-text-3/Installed Packages/FileHeader.sublime-package", line 87, in render_template
File "FileHeader in /config/sublime-text-3/Installed Packages/FileHeader.sublime-package", line 49, in get_template
File "/opt/sublime_text/sublime.py", line 86, in error_message
sublime_api.error_message(msg)
TypeError: String required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "FileHeader in /config/sublime-text-3/Installed Packages/FileHeader.sublime-package", line 187, in on_done
File "FileHeader in /config/sublime-text-3/Installed Packages/FileHeader.sublime-package", line 135, in new_file
File "FileHeader in /config/sublime-text-3/Installed Packages/FileHeader.sublime-package", line 90, in render_template
File "/opt/sublime_text/sublime.py", line 86, in error_message
sublime_api.error_message(msg)
TypeError: String required

get_syntax_type() has name.split() error

Traceback (most recent call last):
  File "E:\Program Files\Sublime Text\sublime_plugin.py", line 303, in on_activated
    callback.on_activated(v)
  File "E:\Program Files\Sublime Text\Data\Packages\FileHeader\FileHeader.py", line 602, in on_activated
    self.update_automatically(view, 'file_name')
  File "E:\Program Files\Sublime Text\Data\Packages\FileHeader\FileHeader.py", line 516, in update_automatically
    syntax_type = get_syntax_type(view.file_name())
  File "E:\Program Files\Sublime Text\Data\Packages\FileHeader\FileHeader.py", line 230, in get_syntax_type
    name = name.split('.')
AttributeError: 'NoneType' object has no attribute 'split'

creating a new file when the template contains a {{file_name}} causes it to be undefined

eg:
create the file "Python.tmpl" in your custom header folder (refer to FileHeader sublime settings for custom header, or set it yourself) with contents

# -*- coding: utf-8 -*-
# @File Name: {{file_name}}
# @Author: {{author}}
# @Date:   {{create_time}}
# @Last Modified by:   {{last_modified_by}}
# @Last Modified time: {{last_modified_time}}

right click > FileHeader > New File
name it "test_fileheader.py"
and observe that the file says undefined in place of the file name

Plugin loading loops

Hi!

I have installed FileHeader (v1.5.4) through Package Control (v2.0.0, ST v3.3059) on my Win 7 system and I noticed lag after loading the plugin. Opening the Packages directory new files are continuously written and removed to/from the FileHeader folder. Opening the Sublime Text console reveals a loop of the following four lines, every few seconds:

reloading plugin FileHeader.FileHeader
reloading Packages/FileHeader/FileHeader.sublime-settings
found 9 files for base name Default.sublime-keymap
found 9 files for base name Main.sublime-menu

What may be going on?

Thanks a lot! :-)

Cheers, Joost

File Header includes <?php itself when file already has Php code in it

File Header includes <?php itself when file already has Php code in it.

Steps to reproduce:

  1. Create a php file and add some php code.
  2. Right click on that file in Project Structure and click on "File Header"->"Add Header..".
  3. See it add File Header as well as php opening tag in the file.

screenshot from 2016-03-17 23 19 39

Trailing comma...

I don´t know if this is a problem or not but... I get this error message every time I start Sublime 2 (Using mac):

Error trying to parse settings: Trailing comma before closing bracket in ~/Library/Application Support/Sublime Text 2/Packages/FileHeader/FileHeader.sublime-settings:130:5

file_name inserted in first line

If {{file_name}} is inserted in the header template, no matter which line, when opening an existing file, the first line is substituted with the line from the header template containing {{file_name}}

Using builtin in variable file_name does not produce expected result...

Hi,

Great plug-in, just giving it a go. Just on your built-in variable file_name it doesn't do what I'm expecting. It puts the file_name and it's extension into my file, where as I was hoping it would just put the base name of the file.

I can possible see the use of the full file name including it's extension, but the only use case that makes sense for me is without the extension.

Kind Regards,
M

Having a save or build counter?

As confusing as version numbers are since everyone can't get on board for a uniform way to write them, having an additional build count has always been crazy (because it reaches into the thousands for some projects) but helpful in the long run of knowing that you're looking at the latest version.

Could you consider either having a build counter that adds 1 to the build number if enabled or else consider prompting the user for the version they are calling that save upon the time of the save?

custom variable not working after last_modified_time

I found a bug appearing in very specific conditions where a custom {{variable}} value is not resolved, and it is happening when the variable {{variable}} is on the same line as {{last_modified_time}} .

To reproduce the bug:

  • template used
// Made by {{full_name}}
// Mail:   <{{email}}>
//
// Started on  {{create_time}} {{full_name}}
// Last update {{last_modified_time}} {{full_name}}
  • settings
"Default": {
        "full_name": "Name SURN"
    },
  • add new template to existing file. Result is ok
// Made by Name SURN
// Mail:   <[email protected]>
// 
// Started on  Wed Jul 06 14:19:41 2016 Name SURN
// Last update Wed Jul 06 14:19:41 2016 Name SURN
this is a test
  • modify and save. This is the result
// Made by Name SURN
// Mail:   <[email protected]>
// 
// Started on  Wed Jul 06 14:19:41 2016 Name SURN
// Last update Wed Jul 06 14:28:25 2016  {{full_name}}
this is a test 2

how to add email address in file header

It's the first time for me to use FileHeader plugin in Sublime Text 3,and and i just want to modify setting file to add email info in my file header,however i don't know how to set it, even though i have read some details in the default setting file,can some warm heart guys to show me how to add email info or add user defined info into file header when i use the Ctrl+Alt+A shortcut key!Thank you !

osx 10.9 报错了

右健 File Header -> New File

Traceback (most recent call last):
  File "/Users/vfasky/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 261, in on_done
    syntax_type = get_syntax_type(name)
  File "/Users/vfasky/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 168, in get_syntax_type
    syntax_type = options['syntax_when_not_match']
KeyError: 'syntax_when_not_match'

右健 File Header -> Add Header

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 524, in run_
    return self.run(**args)
  File "/Users/vfasky/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 410, in run
    'show_input_panel_when_add_header'])
KeyError: 'show_input_panel_when_add_header'

注: 启用 vim 模式

Feature: Add FileHeader to Command Palette

As someone who likes to minimise use of the mouse when coding, I think it'd be useful to be able to access the right-click menu options from the Command Palette (i.e. http://i.imgur.com/h6uSj3F.png), so I can do the following:

  • Super+P (command palette pops up)
  • type in "FileH..." (options show up)
  • select what I want to do (new file, add header etc.)

I realise there are already keybinds that I can use that come with FileHeader out of the box, but since I currently already use the Command Palette extensively for other addons, it saves me having to memorise even more keybinds and just remember "Super+P".

Thoughts?

Variable Path Expansion

It doesn't appear that path name expansion is working in the variables, i.e.:

// specifying the full path works to templates works
"custom_template_body_path": "/Users/nfarrar/.local/share/sublime-text/templates/header",
"custom_template_body_path": "/Users/nfarrar/.local/share/sublime-text/templates/body",

// but specifying a relative path does not
// "custom_template_header_path": "~/.local/share/sublime-text/templates/header",
// "custom_template_header_path": "~/.local/share/sublime-text/templates/header",
// "custom_template_header_path": "$HOME/.local/share/sublime-text/templates/header",
// "custom_template_header_path": "$HOME/.local/share/sublime-text/templates/header",

I synchronize my settings across multiple systems and platforms - I don't always have the same username or path to $HOME, but I can always keep my templates in the same directory relative to $HOME.

The other plugins I use do this - so I assumed it was the default behavior - but after checking through sublime text reference manual - it doesn't appear that they are expanded by default.

I found some boilerplate code here that provides an easy solution to perform cross-platform path expansion with sublime settings.

Any chance this could be added?

Add Header error

Hello!
win7 x64
sublimetext3 portable version
If i try Add Header:

Traceback (most recent call last):
  File "O:\Sublime Text 3\sublime_plugin.py", line 543, in run_
    return self.run(edit, **args)
  File "FileHeader in O:\Sublime Text 3\Data\Installed Packages\FileHeader.sublime-package", line 224, in run
  File "FileHeader in O:\Sublime Text 3\Data\Installed Packages\FileHeader.sublime-package", line 90, in render_template
  File "O:\Sublime Text 3\sublime.py", line 86, in error_message
    sublime_api.error_message(msg)
TypeError: String required

No module named 'jinja2'

Traceback (most recent call last):
  File "/Users/Randy/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 227, in on_done
    self.new_file(path, syntax_type)
  File "/Users/Randy/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 178, in new_file
    header = render_template(syntax_type)
  File "/Users/Randy/Library/Application Support/Sublime Text 3/Packages/FileHeader/FileHeader.py", line 118, in render_template
    from jinja2 import Template
ImportError: No module named 'jinja2'

You may need the following for ST3.

  from .jinja2 import Template

I am on Mac OSX 10.9, ST3.

Suggestion/solution for header/source files for cpp

So today I found your plug-in for Sublime, good job by the way!

I have managed to set up a basic header for my CPP project. However, there is one minor issue I would like a solution for. I would like to be able to define different body and header files for different file extensions which conform to the same language. Currently the file name that is used in the header/body files use the same name for both the file name and determining the language that should be used for the file.

E.G. I decided to make a different template and body for my header files that would allow for automation of include guard generation. Thus, I decided to make a custom template/body pair, which I named C++_Header.tmpl and adding an entry to the file_suffic_mapping field in the settings file. Lo and behold I got the follwoing exception:

Error loading syntax file "Packages/C++_Header/C++_Header.tmLanguage": 
Unable to open Packages/C++_Header/C++_Header.tmLanguage

What I suggest is that for every language suffix a pair of variables be possible to add. This would solve the problem of defining templates based on suffix, e.g.:

"file_suffix_mapping":{
        "cpp": ["C++", "C++_Template1"],
        "cc": ["C++", "C++_Template2"],
        "h": ["C++", "C++_Header"]
}

I have next to zero experience with JSON so maybe this wont work as well as I think it will. Any other relevant solution would be just as fine.

Custom time string format currently does not work

Hi,

When using a custom time format string the @last Modified time: time string is not updated in the file properly.

In the last version, and I this is true of the current version, the issue is with the way you handle the string with regex. Here is the relevant code:

inside update_automatically function, starting at line 624:

elif what == LAST_MODIFIED_TIME:
                line_pattern = '%s\s*%s.*\n' % (
                    line_header, self.time_pattern())

You call a function to get the regex of the time string.
This is all well and good, except you can not feasibly have a case for every custom format string.
You have a few options on how to fix this, but the way that seemed least intrusive to me is the way I have modified my current FileHeader.py file.

In the below function:

    def time_pattern(self):
    choice = Settings().get('time_format')
    _ = [0, 1, 2]
    if choice not in _:
        choice = 0

    _ = ['\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}',
         '\d{4}-\d{2}-\d{2}', '\d{2}:\d{2}:\d{2}']
    return _[choice]

If you change this file to match any regex if the custom setting is set, then it will work. For example:

   def time_pattern(self):

    choice = Settings().get('custom_time_format')
    if choice:
        return '.'
    else:
        choice = Settings().get('time_format')

    _ = [0, 1, 2]
    if choice not in _:
        choice = 0

    _ = ['\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}',
         '\d{4}-\d{2}-\d{2}', '\d{2}:\d{2}:\d{2}']
    return _[choice]

FileHeader not working

Hi,

In the last few days, FileHeader stopped working. When I use the keyboard shortcut (I'm using ST2), the following shows up in the console:

using gpu buffer for window
Traceback (most recent call last):
File "./sublime_plugin.py", line 337, in run_
File "./FileHeader.py", line 565, in run
Boost.Python.ArgumentError: Python argument types in
Window.show_input_panel(Window, str, NoneType, instancemethod, NoneType, NoneType)
did not match C++ signature:
show_input_panel(SP<edit_window::reference>, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, boost::python::api::object, boost::python::api::object, boost::python::api::object)

Any ideas?

New method of getting git username has small bug

Currently, the new method of getting the git username does not work as intended. The reason is, you are calling git status and checking for an error, but git status is ran relative to the process, not the working directory of the current file.

To see this in action, you can modify get_user() as follows:

def get_user():
'''Get user'''

user = getpass.getuser()
user = os.getcwd()

output, error = getOutputError('git status')
if not error:
    output, error = getOutputError('git config --get user.name')
    if not error and output:
        user = output
return user

There you can see that the current working directory is not the working directory of the current file, but of the plugin itself.

I have a temporary fix, but i don't know if it's a good solution.
To restore the git username detection, one option is to update the new getOutputError function to the following:

def getOutputError(cmd):
    curr_dir = sublime.active_window().extract_variables()
    curr_dir_value = sublime.expand_variables("${folder}", curr_dir)
    if curr_dir_value:
        return map(str.strip, subprocess.Popen(
            cmd, shell=True, universal_newlines=True,
            stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            cwd=curr_dir_value
            ).communicate())
    else:
        return map(str.strip, subprocess.Popen(
            cmd, shell=True, universal_newlines=True,
            stdout=subprocess.PIPE, stderr=subprocess.PIPE
            ).communicate())

Unbound Local Error on save file

If I save a file which does not contain a file header I always get error messages in my SublimeText console saying the variable line_header has not been assigned.

Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 127, in reload_plugin
    el.on_activated(v)
  File "C:\Users\Lehmann\AppData\Roaming\Sublime Text 3\Packages\FileHeader\FileHeader.py", line 692, in on_activated
    block(view, self.update_automatically, view, FILE_NAME)
  File "C:\Users\Lehmann\AppData\Roaming\Sublime Text 3\Packages\FileHeader\FileHeader.py", line 326, in block
    _block()
  File "C:\Users\Lehmann\AppData\Roaming\Sublime Text 3\Packages\FileHeader\FileHeader.py", line 324, in _block
    callback(*args, **kwargs)
  File "C:\Users\Lehmann\AppData\Roaming\Sublime Text 3\Packages\FileHeader\FileHeader.py", line 611, in update_automatically
    line_header = re.escape(line_header)
UnboundLocalError: local variable 'line_header' referenced before assignment

"get git user.name" problem [ST3] in OS Windows

Hello!
I would like to give your attention to the fact that the method of subprocess.getstatusoutput () -
does not work in OS Windows.

An alternative implementation I apply.

def getstatusoutput(cmd):
    """Return (status, output) of executing cmd in a shell."""
    """This new implementation should work on all platforms."""
    import subprocess
    pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, universal_newlines=True)
    output = "".join(pipe.stdout.readlines())
    sts = pipe.returncode
    if sts is None: sts = 0
    return sts, output

Enhancements: Allows 3rd-Party plugin to override some settings

Problem

On a new, empty file, usually FileHeader will add a template to that file based on syntax of the file. This, however, make new file creation conflict with 3rd-party plugins (in my case, Javatar) in which two plugin try to create their own template on the same file. The result ends up with a bunch of templates added to the file. This also apply on specific syntax (based on 3rd-party plugins) not all of them.

My suggestion

To override the settings, that plugin should set the view's settings called enable_add_template_to_empty_file to either True or False based on how plugin want FileHeader to behave as view's settings did not get set easily in the normal workflow (can be set via console only).

AsciiDoctor syntax not loaded when creating a new file

Hi,

When creating a new file using ctrl + alt + n using File Header I can get to have my header's template inserted however the AsciiDoc (Asciidoctor) file syntax can't be loaded.

I added "adoc": "Asciidoctor", in `file_suffix_mapping json document.

I did installed Asciidoctor package using package control so it's installed within 'Installed Package' Folder.

I am running st3 build 3103 under linux.

Step to reproduce :

  • Install Asciidoctor package using Package Control
  • Install File Header package using Package Control
  • Edit FileHeader.sublime-settings and add "adoc": "Asciidoctor", infile_suffix_mapping json document.
  • Add an header's template named Asciidoctor.tmpl with that content :

//// @Author : {{author}} @Date : {{create_time}} @Last Modified by : {{last_modified_by}} @Last Modified time : {{last_modified_time}} ////

For now it sets my syntax of the new file to Asciidoctor instead of AsciiDoc (Asciidoctor). I bet this have to do either with the fact the language syntax is bundled with the package installed through package control or the weird name of the syntax which doesn't match the one of the package name.

This might have to do with the fact Asciidoctor language syntax file is within a syntaxes folder at the package root level.

C++ head Template DO NOT work well

My template is just like the followings:

 /*
 * @Date:   {{create_time}}
 * @Last Modified time: {{last_modified_time}}
 */

When save XXX.cpp after do some modification, the modified time does not change as I wish.

PS:

  1. Python head with @Last Modified time works well.
  2. Change the C++ templates as follows:
/*
 * @Date:   {{create_time}}
 * @Last Modified time: {{last_modified_time}}
 */

can also updates modified time, but have some dirty datas, for example:

 /*
 * @Date:   2016-03-26 12:01:15
 * @Last Modified time: 2 2016-03-26 12:06:33
 */

Configuration Settings Path

After installing, I copied the %PACKAGES%/FileHeader.sublime-settings file to %PACKAGES%/User/FileHeader.sublime-settings and configured to my liking - however it doesn't seem to ever be used - I assumed it would, since this is how sublime plugins typically work - a default configuration file is provided - then you can override those settings in your own configuration file in %PACKAGES%/User/ExtensionName.sublime-settings file.

I was curious why it wasn't working - so I checked how they're loaded and found:

load_settings(base_name): Loads the named settings. The name should include a file name and extension, but not a path. The packages will be searched for files matching the base name, and the results will be collated into the settings object. Subsequent calls to load_settings with the name base_name will return the same object, and not load the settings from disk again.
-- https://www.sublimetext.com/docs/3/api_reference.html

I checked the source for FileHeader and found:

return sublime.load_settings('%s.sublime-settings' % PLUGIN_NAME)

The key thing there is that the expected behavior and use of sublime.load_settings(...) specifies that only a filename should be passed in - not a full path - because that breaks the ability for users to override the settings in %PACKAGES%/User/PluginName.sublime-settings. This allows users to version control and synchronize the files in that directory across multiple platforms & systems.

Any chance that could be adjusted to allow the user settings file to override the plugin's defaults?

Support of Footers

"Add Footer" would be a good option to add stuff like copyright at the bottom of a file.

There is no way to change the date format to a custom one

As stated in the title, I have not been able to find a way to change the create_time variable to a custom format. I used grep and the only match for "create_time" was in the file "FileHeader.sublime-package" which as far as I can tell, is uneditable.

If I just haven't been able to find the way to edit it, I'd appreciate some documentation on the matter, but if a way to change it doesn't exist, I'd appreciate it being added.

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.