All Projects β†’ kairyou β†’ Sublimetmpl

kairyou / Sublimetmpl

Licence: mit
Create File From Templates for SublimeText 2 / SublimeText 3

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sublimetmpl

sublime-live-server
🌍️ Launch a Development Server directly from Sublime Text
Stars: ✭ 49 (-77.93%)
Mutual labels:  sublime, sublime-package
Coffeescript Sublime Plugin
Syntax highlighting and checking, commands, shortcuts, snippets, compilation and more.
Stars: ✭ 296 (+33.33%)
Mutual labels:  snippets, sublime
sublime-jsx
Simple Sublime Text 3 JSX implementation
Stars: ✭ 24 (-89.19%)
Mutual labels:  sublime, sublime-package
Sublime-GameMaker-Studio-Language-Bundle
A sublime bundle for GameMaker Language (GML)
Stars: ✭ 32 (-85.59%)
Mutual labels:  snippets, sublime
Vuejs Sublime Complete
Better Vue.js completions for sublime text with syntax highlighting.
Stars: ✭ 57 (-74.32%)
Mutual labels:  snippets, sublime
30-seconds-of-code-texteditorsnippets
Files to import the 30-seconds-of-code snippets into VSCode, Atom and Sublime.
Stars: ✭ 35 (-84.23%)
Mutual labels:  snippets, sublime
eRCaGuy dotfiles
.bashrc file, terminal prompt that shows current git branch, Arduino setup, Eclipse setup, git diff with line numbers, helpful scripts, improved Linux productivity, etc.
Stars: ✭ 84 (-62.16%)
Mutual labels:  sublime, templates
Sublimeallautocomplete
Extend Sublime autocompletion to find matches in all open files of the current window
Stars: ✭ 906 (+308.11%)
Mutual labels:  sublime, sublime-package
Sublime Ava
Snippets for AVA
Stars: ✭ 41 (-81.53%)
Mutual labels:  snippets, sublime-package
Hayaku
Fuzzy abbreviations, support for preprocessors (Sass, Less, Stylus) and a lot of other features in easily configurable set of tools for writing CSS faster
Stars: ✭ 973 (+338.29%)
Mutual labels:  snippets, sublime-package
Carbonsublime
πŸš€ A Sublime Text 3 Plugin for Carbon. (https://carbon.now.sh)
Stars: ✭ 104 (-53.15%)
Mutual labels:  sublime, sublime-package
Android Templates And Utilities
Collection of source codes, utilities, templates and snippets for Android development.
Stars: ✭ 1,099 (+395.05%)
Mutual labels:  snippets, templates
Pine Utils
Code Snippets + Tricks & Tips to help Pine Script developers
Stars: ✭ 149 (-32.88%)
Mutual labels:  snippets, templates
Snippets
Atom snippets package
Stars: ✭ 191 (-13.96%)
Mutual labels:  snippets
Pollinate
Template your base files and generate new projects from Git(Hub).
Stars: ✭ 213 (-4.05%)
Mutual labels:  templates
Ng Polymorpheus
Polymorpheus is a tiny library for polymorphic templates in Angular.
Stars: ✭ 191 (-13.96%)
Mutual labels:  templates
Cgx
πŸ’»πŸ”₯CLI to generate the recommended documentation/files to improve contribution (Github, Gitlab, CodeCommit and Bitbucket)
Stars: ✭ 190 (-14.41%)
Mutual labels:  templates
Bookmarks.dev
Bookmarks and Code Snippets Manager for Developers & Co
Stars: ✭ 218 (-1.8%)
Mutual labels:  snippets
Divi Resources
A curated list of awesome Divi resources
Stars: ✭ 213 (-4.05%)
Mutual labels:  snippets
Vscode Vlang
V Language extension for Visual Studio Code.
Stars: ✭ 190 (-14.41%)
Mutual labels:  snippets

SublimeTmpl

A Sublime Text 2/3 plugin for create file from templates.

Installation

Github

Go to the "Packages" directory (Preferences / Browse Packages). Then clone this repository:

$ git clone https://github.com/kairyou/SublimeTmpl.git

Package Control

Install Package Control. Then Package Control: Install Package, look for SublimeTmpl / tmpl and install it.

Usage

  • Create file with menu File - New File (SublimeTmpl)

  • Create file with command use cmd+shift+p then look for tmpl:

Settings

Default Settings: Preferences > Packages Settings > SublimeTmpl > Settings - Default

Custom settings (*Recommend): Preferences > Package Settings > SublimeTmpl > Settings - User

Default template files: Packages/SublimeTmpl/templates

Custom template files (Recommend): Packages/User/SublimeTmpl/templates/

Project-specific template files (ST3 only): via settings: SublimeTmpl: template_folder key within your sublime-project file (see "Features added" below)

Default key bindings

ctrl+alt+h html
ctrl+alt+j javascript
ctrl+alt+c css
ctrl+alt+p php
ctrl+alt+r ruby
ctrl+alt+shift+p python

Disable shortcuts

If you’re unhappy with default keymap, you can disable keyboard shortcuts with disable_keymap_actions preference of SublimeTmpl.sublime-settings.

Use a comma-separated list of action names which default keyboard shortcuts should be disabled. For example, if you want to disable creat html and css shortcuts, your must set the following value:

"disabled_keymap_actions": "html, css"

To disable all default shortcuts, set value to all.

Features added

  • custom template files

    put your custom template files in Packages/User/SublimeTmpl/templates Project-specific template files can be specified in project files, along with overriding other templating options.

  • *.tmpl file support ${date} variable

    default "date_format" : "%Y-%m-%d %H:%M:%S" .

  • *.tmpl file support ${saved_filename}, ${saved_filepath} on save file

    Enable: SublimeTmpl > settings - user add "enable_file_variables_on_save": true,

  • *.tmpl file support ${project_base_name}, ${project_path} and ${platform}

    NOTE: This will only work with SublimeText 3.0 or above.

    Enable: SublimeTmpl > settings - user add "enable_project_variables": true,

It is recommended that you put your own custom settings in settings - user. Please see note below in "*Detailed Instructions for Sublime Newbies"

  • custom variables: attr

    custom the attr variables in settings, example:

   "attr": {
       "author": "Your Name" ,
       "email": "[email protected]",
       "link": "http://example.org",
       "hello": "word"
   }
> The `*.tmpl` file will support `${author}` `${email}` `${link}` `${hello}` variables.
  • Project specific overrides via SublimeTmpl attribute in sublime-project file.
    "settings":
    {
        "SublimeTmpl":
        {
            "template_folder": "Path\\to\\some\\custom\\template\\folder",
            "template_replace_pattern": "{{%s}}",
            "enable_project_variables": true,
            "enable_file_variables_on_save": true,
            "attr": {  // Fully overrides "attr" settings (i.e. elements missing here will not attempt to be replaced in template)
                "author": "Alternative Name"
            },
            "project_variables": {
                // Allows for use with other template formats, provide mapping here
                // "tmpl_formatted_name": "current_template_name"
                "project_base_name": "projectbase",
                "project_path": "projectpath",
                "platform": "plat"
            },
            
            "file_variables_on_save": {
                // Allows for use with other template formats, provide mapping here
                // "tmpl_formatted_name": "current_template_name"
                "saved_filename": "name",
                "saved_filepath": "filepath"
            },
        },
    },

*Detailed Instructions for Sublime Newbies

Sublime Text keeps settings in bunch of files in a folder. For example, OS X, it is located at

/Users/yourusername/Library/Application Support/Sublime Text 3/Packages

You can navigate to it easily by using the following menu item in Sublime, for example: Sublime Text>Preferences>Browse Packages

Now go to Packages\SublimeTmpl folder and open the file SublimeTmpl.sublime-settings. Save the file with the same file name under Packages\User. Delete everything except the variables that are custom to you. By the time you are finished, the file might look as simple as this (JSON format):

{
    "attr": {
        "author": "Chuck Norris" ,
        "email": "[email protected]",
    }
}

If you don't want the "link" and "hello" variables to show up, you should copy the (for example) python.tmpl file to Packages/User/SublimeTmpl/templates and remove those elements from it.

Contributors

Donate

PayPal donate button

FAQ

  • SublimeTmpl not work after update the package.

    Please open Preferences / Settings - User, remove "SublimeTmpl" from ignored_packages.

  • Alert message Replace pattern None doesn't seem to work: unsupported operand type(s) for %: 'NoneType' and 'str'

    Please restart Sublime Text and try again.


Source: https://github.com/kairyou/SublimeTmpl

Docs: δΈ­ζ–‡ζ–‡ζ‘£

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].