ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Custom Insert

by yanni4night ST2/ST3

A sublime 2 /3 plugin that can easily insert custom content.

Details

  • 2018.03.29.03.31.05
  • github.​com
  • github.​com
  • 1 year ago
  • 25 minutes ago
  • 6 years ago

Installs

  • Total 408
  • Win 276
  • OS X 82
  • Linux 50
Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6
Windows 0 0 0 0 0 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
OS X 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
Linux 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

sublime-custominsert

A Sublime plugin that can easily insert custom content.It can insert 'copyright',code template,signature,date time or anything else as you want.

Now Sublime 3 is supported.

install

configuration

Custominsert.sublime-keymap:

{    
    /*Default data*/
    "data":{},

    /*Default content*/
    "content":"Nohting to insert",

    /*Default date_format,see https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior*/
    "date_format":"%Y-%m-%d %H:%M:%S",

    /*Default insert position*/
    "position":"cursor",

    /*custom actions you can define*/
    "actions":{
        "datetime":{
            "content":"{%datetime%}"
        },
        "copyright":{
            "content": {
                "default": "/*{{author}}*/",
                "php": "<?php{{author}}?>",
                "py": "#php{{author}}",
            },
            "data":{
                "author":"yanni4night",
                "version":"0.0.1"
            }
        }
    }
}

Default (OSX).sublime-keymap:

[
    { "keys": ["ctrl+c"], "command": "custominsert", "args": {"action":"copyright"} },
    { "keys": ["ctrl+t"], "command": "custominsert", "args": {"action":"datetime"} }
]

syntax

pre-defined vars

  • year : current year
  • filename : file name with ext
  • dirname : absolute directory path
  • filepath : absolute file path
  • datetime : date&time
  • platform : 'osx','linux' or 'windows'
  • arch : 'x32' or 'x64'
  • ext : file ext(without '.',may be empty)
  • ip : IP address(may be 'localhost')
  • encoding : file encoding(may be Undefined),you can use 'default_encoding' to override Undefined value
  • user : name of the user logged in

changelog

  • 2015-11-06:content by file ext is supported,'year' supported
  • 2015-01-12:sublime 3 is supported
  • 2014-09-13:generate menus&commands automatically
  • 2014-06-21:modified settings
  • 2013-12-30:default_encoding supported
  • 2013-11-19:menus supported.
  • 2013-11-15:{{}} syntax supported;position custom define supported;multiple actions&position insert supported,more pre-defined supported.
  • 2013-11-14:{%%} syntax supported.