Sublime Forum

How to install configure and use insertDate

#1

This should not be this difficult.

I cloned the git repo because contrary to the instructions insertDate is not avaliable in the ST package manager.

My insert_date.sublime-settings for both default and user look like this:

{
    ////////////////////////////////////////////////////////////////////////////
    // COPY THIS FILE TO YOUR USER SETTINGS BEFORE MODIFYING IT, OTHERWISE
    // CHANGES WILL BE OVERWRITTEN WITH EVERY UPDATE!
    //
    // Tip: Copy the file, select "Preferences > Package Settings >
    // InsertDate > Settings - User" and paste.
    ////////////////////////////////////////////////////////////////////////////

    // This is the format that will be used when no format has been specified
    // when calling the command. Also used for the "InsertDate: Default"
    // command from the command palette.
    // Default: '%x %X'
    "format": "%x %X",

    // Similar to above, this is the default timezone that will be used when
    // there was no other incoming timezone specified. Because the default is
    // set to 'local' it will be interpreted the timezone of your machine. As
    // of now, 'local' does not support the `%Z` named timezone representation
    // and it is HIGHLY RECOMMENDED to specify your local pytz timezone here.
    // Default: 'local'
    "tz_in": "local"

The key bindings for user and default look like this:



// Insert datetime using default format text
  { "keys": "f5"],
    "command": "insert_date" },

// Insert datetime using the specified format
  // Locale date
  { "keys": "ctrl+f5", "ctrl+d"],
    "command": "insert_date",
    "args": {"format": "%x"} },
  // iso date (YYYY-MM-DD)
  { "keys": "ctrl+shift+f5", "ctrl+shift+d"],
    "command": "insert_date",
    "args": {"format": "%Y-%m-%d"} },
  // Locale time
  { "keys": "ctrl+f5", "ctrl+t"],
    "command": "insert_date",
    "args": {"format": "%X"} },
  // iso time (HH:MM:SS)
  { "keys": "ctrl+shift+f5", "ctrl+shift+t"],
    "command": "insert_date",
    "args": {"format": "%H:%M:%S"} },
  // Locale date and time with timezone name (not for 'local' timezone)
  { "keys": "ctrl+f5", "ctrl+z"],
    "command": "insert_date",
    "args": {"format": "%x %X %Z"} },
  // Full iso date and time
  { "keys": "ctrl+f5", "ctrl+i"],
    "command": "insert_date",
    "args": {"format": "iso"} },
  // Locale date and time converted to UTC (with timezone name)
  { "keys": "ctrl+f5", "ctrl+u"],
    "command": "insert_date",
    "args": {"format": "%x %X %Z", "tz_out": "UTC"} },

// Prompt for user input, "format" would behave as default text,
// and insert the datetime using that format string
  { "keys": "alt+f5"],
    "command": "insert_date",
    "args": {"prompt": true} }
]

I installed the library as mentioned in the read me using easy-install:


***[pytz-2012c-py2.6][pytz]*** ([ext. download][pytz-down])<br />
     **pytz** by Stuart Bishop is used for displaying and conversion between timezones. **MIT license**

However I can not get this to work. Pressing f5 or any combination of f5 (shift f5, ctrl f5) does nothing.
What am I doing wrong?

0 Likes