Permalink
Browse files

Version 0.1: Initial upload

  • Loading branch information...
0 parents commit 24c3bc798fcc52ce4f3af642ee4a72ad5c25f828 @tomtom tomtom committed with Aug 31, 2012
@@ -0,0 +1,58 @@
+This is a mirror of http://www.vim.org/scripts/script.php?script_id=4199
+
+This plugin is a 90% clone of Andy Wokula's tinymode (vimscript #2223).
+It takes a different approach that hopefully avoids certain problems
+without creating new ones. tinymode actually creates maps to do its job,
+tinykeymap only creates maps for the entry sequence and uses the
+|getchar()| function to handle further input.
+
+This plugin lets users define "temporary keymaps", a.k.a. tinykeymaps,
+with the |tinykeymap#EnterMap()| function. Users can define a map to
+activate a tinykeymap. Users can then use single key shortcuts to
+trigger commands defined with |tinykeymap#Map()|. Pressing an undefined
+key or <Esc>, deactivates the tinykeymap.
+
+Example usage: Define a tinykeymap to make it easier to ...
+
+ - operate on windows
+ - operate on tabs
+ - operate on text
+
+Example definition for a "tabs" tinykeymap (heavily based on Andy
+Wokula's tabs mode for tinymode): >
+
+ call tinykeymap#EnterMap('tabs', 'gt', {'name': 'Tabs mode'})
+ call tinykeymap#Map('tabs', 'n', 'tabnew')
+ call tinykeymap#Map('tabs', 't', 'norm! gt')
+ call tinykeymap#Map('tabs', 'T', 'norm! gT')
+ call tinykeymap#Map("tabs", "^", "tabfirst")
+ call tinykeymap#Map("tabs", "$", "tablast")
+ call tinykeymap#Map("tabs", "c", "tabclose")
+
+Example use of the above tinykeymap: E.g. pressing gt3n^c2t will:
+
+ gt ... Enter tabs mode
+ 3n ... create 3 new tabs,
+ ^ ... select the first one,
+ c ... close it, and
+ 2t ... move to the second tab on the right.
+
+A tinykeymap is exited (1) by pressing <Esc> or (2) by timeout (see
+|g:tinykeymap#timeout|).
+
+tinykeymap comes with the following pre-defined tinykeymaps:
+
+ tabs gt :: Operate on tabs
+ windows <C-W> :: Operate on windows
+ buffers <Leader>b :: Operate on buffers
+ undo <Leader>u :: Operate on the |undo| tree
+
+Differences to tinymode:
+
+ - tinykeymaps and maps may have options (optional)
+ - tinykeymaps can be buffer-local
+ - dealing with [count] is easier (if a map contains "<count>", this
+ placeholder is replaced with the current [count], i.e. a
+ previously entered number; otherwise the expression is evaluated
+ [count] times)
+
Oops, something went wrong.

0 comments on commit 24c3bc7

Please sign in to comment.