Skip to content

Commit

Permalink
Update keymaps and docs on the panel addition
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Jan 11, 2014
1 parent 24a0cc5 commit c002d2b
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ InsertDate Changelog
-------------------

- Added a panel to choose a format from, configurable via settings
- Changed default keybindings a bit (f5 -> ctrl+f5, ctrl+f5; panel on f5)


v0.5.0 (2014-01-11)
Expand Down
17 changes: 14 additions & 3 deletions Default (OSX).sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
[
// Insert datetime using default format text
{ "keys": ["f5"],
{ "keys": ["super+f5", "super+f5"],
"command": "insert_date" },

// Insert datetime using the specified format
// Locale date
{ "keys": ["super+f5", "super+d"],
"command": "insert_date",
"args": {"format": "%x"} },

// iso date (YYYY-MM-DD)
{ "keys": ["super+shift+f5", "super+shift+d"],
"command": "insert_date",
"args": {"format": "%Y-%m-%d"} },

// Locale time
{ "keys": ["super+f5", "super+t"],
"command": "insert_date",
"args": {"format": "%X"} },

// iso time (HH:MM:SS)
{ "keys": ["super+shift+f5", "super+shift+t"],
"command": "insert_date",
"args": {"format": "%H:%M:%S"} },

// Locale date and time with timezone name (not for 'local' timezone)
{ "keys": ["super+f5", "super+z"],
"command": "insert_date",
"args": {"format": "%c %Z"} },

// Full iso date and time
{ "keys": ["super+f5", "super+i"],
"command": "insert_date",
"args": {"format": "iso"} },

// Locale date and time converted to UTC (with timezone name)
{ "keys": ["super+f5", "super+u"],
"command": "insert_date",
"args": {"format": "%c %Z", "tz_out": "UTC"} },

// Unix time (seconds since the epoch, in UTC)
{ "keys": ["super+f5", "super+x"],
"command": "insert_date",
"args": {"format": "unix"} },

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

// Show the panel with pre-defined options from settings
{ "keys": ["f5"],
"command": "insert_date_panel" }
]
17 changes: 14 additions & 3 deletions Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,45 +1,56 @@
[
// Insert datetime using default format text
{ "keys": ["f5"],
{ "keys": ["ctrl+f5", "ctrl+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": "%c %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": "%c %Z", "tz_out": "UTC"} },

// Unix time (seconds since the epoch, in UTC)
{ "keys": ["ctrl+f5", "ctrl+x"],
"command": "insert_date",
"args": {"format": "unix"} },

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

// Show the panel with pre-defined options from settings
{ "keys": ["f5"],
"command": "insert_date_panel" }
]
62 changes: 42 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
========================
SublimeText - InsertDate
========================
===============================
InsertDate - SublimeText Plugin
===============================

A plugin for Sublime Text **2 and 3** that inserts the current date and/or time according to the format specified and supports named timezones (preferrably using [pytz][pytz], but can interpret the locale's timezone settings if necessary).
A plugin for Sublime Text **2 and 3** that inserts the current date and/or time according to the format specified and supports named timezones (using [pytz][pytz], but can interpret the locale's timezone settings if necessary).

For more information about the accepted formatting syntax, see <http://strfti.me/>.

Expand All @@ -28,54 +28,54 @@ Usage

### Command Examples ###

These are the [default key bindings][keymap] (on [OSX][keymap-osx]: `super` instead of `ctrl`):
The following is an excerpt of the [default key bindings][keymap] (on [OSX][keymap-osx]: `super` instead of `ctrl`):

```js
[
// Insert datetime using default format text
{ "keys": ["f5"],
{ "keys": ["ctrl+f5", "ctrl+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": "%c %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": "%c %Z", "tz_out": "UTC"} },

// Unix time (seconds since the epoch, in UTC)
{ "keys": ["ctrl+f5", "ctrl+x"],
"command": "insert_date",
"args": {"format": "unix"} },

// Prompt for user input, "format" would behave as default text,
// ... and many more

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

// Show the panel with pre-defined options from settings
{ "keys": ["f5"],
"command": "insert_date",
"args": {"prompt": true} }
]

```


Expand Down Expand Up @@ -109,8 +109,15 @@ For more information about the accepted formatting syntax, see <http://strfti.me

### Command Reference ###

***insert_date_panel***

Open a quick panel with pre-defined format settings


***insert_date***

Insert the current date/time with specified formatting

*Parameters*

- **format** (str) - *Default*: `'%c'` (configurable in settings)
Expand Down Expand Up @@ -152,7 +159,22 @@ Here is an excerpt of the [default settings][settings]:
// 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"
"tz_in": "local",

// A set of pre-defined settings that are prompted by "promt_insert_time"
// and previewed. You can modify this list in your User settings, but be
// aware that you remove all these entries when overriding "prompt_config"!
// Use "user_prompt_config" if you just want to add a few entries.
//
// `$default` is replaced by the "format" setting above, unspecified values
// remain default.
"prompt_config": [ //...
],

// Works similar to "prompt_config" but is added to the above list.
// Supposed to be used by you when you just want to add some entries to the
// list.
"user_prompt_config": []
}
```

Expand Down
9 changes: 8 additions & 1 deletion messages/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,14 @@ Notes:
Command Reference
-----------------

**insert_date**
***insert_date_panel***

Open a quick panel with pre-defined format settings


***insert_date***

Insert the current date/time with specified formatting

Parameters:

Expand Down

0 comments on commit c002d2b

Please sign in to comment.