Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
autoload typo
doc docs
etc docs
plugin version
.gitignore
CHANGES.TXT docs
README misc
addon-info.json

README

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.

tinykeymap comes with the following pre-defined tinykeymaps (see 
|g:tinykeymap#mapleader| and the related g:tinykeymap#*#map variables for how 
to customize the key binding):

    buffers ... Navigate/operate on buffers
                Enter map: <Leader>mb
    diff    ... Navigate/operate on |diff|s
                Enter map: <Leader>md
    filter  ... "filter" text in a buffer using folds
                Enter map: <Leader>mf
    lines   ... Navigate/operate on lines (similar to vimscript #4140)
                Enter map: <Leader>ml
    loc     ... Navigate the |location-list|
                Enter map: <Leader>mo
    qfl     ... Navigate the |quickfix| list
                Enter map: <Leader>mq
    tabs    ... Navigate/operate on tabs
                Enter map: gt
    undo    ... Navigate/operate on the undo tree (with optional support for 
                vimscript #4177)
                Enter map: <Leader>mu
    windows ... Navigate/operate on windows
                Enter map: <C-W>

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|).

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)
    - avoid a certain misleading error message

submode (vimscript #2467) is another package that provides similar 
functionality.

-----------------------------------------------------------------------

Status:  Experimental
Dependencies:
  tlib :: http://github.com/tomtom/tlib_vim
      > git clone git://github.com/tomtom/tlib_vim.git
Install: See http://github.com/tomtom/vimtlib/blob/master/INSTALL.TXT
See http://github.com/tomtom for related plugins.

Something went wrong with that request. Please try again.