This repository has been archived by the owner on Apr 24, 2022. It is now read-only.
Releases: Iron-E/vim-libmodal
Releases · Iron-E/vim-libmodal
2.4.0 – Timeouts
Changes
Key Combos
Timeouts
- Add
g:libmodalTimeouts
and mode-specific timeout variables. - Modes can now optionally time-out when waiting for user input (input will clear, just like in normal mode).
- This will only occur if the user has entered a key that has a mapping in the
modeCombos
dict. Otherwise, the user's input will be automatically cleared.
- This will only occur if the user has entered a key that has a mapping in the
- Timeouts are not implemented for
modeCallback
s— they must be implemented by mode creators usingtimers
.
Cloberring
-
Key combos no longer clobber each other when they share beginnings that are shorter.
- e.g.
zfo
used to wipe out anyz
orzf
mappings (althoughzfx
would work just fine).
- e.g.
-
When a combo has both a command and sub-mappings, it is now automatically mapped to
<CR>
.- e.g.:
let s:modeCombos = { \ 'z': 'split', \ 'zf': 'tabnew' \ 'zfo': 'tabclose' \}
Is now translated to:
let s:internalModeCombos = { \ 'z': { \ '<CR>': 'split', \ 'f': { \ '<CR>': 'tabnew', \ 'o': 'tabclose' \ } \ } \}
- Dictionaries are not expanded to include
<CR>
annotations until necessary, in order to be more space-efficient.
-
Unfortunately, the
g:libmodalTimeout
feature will not automatically execute these commands for you.- This is a limitation of Vimscript. There is a rewrite of this plugin being developed for Neovim only that is capable of doing this and more (find it here when it is complete).
2.3.0 – Interactive Prompts
Changes
- Add
libmodal#Prompt
, a function to create new command-prompt-like modes to gather user input without clobbering existing commands.
2.2.0 – Dict Key Combos
Changes
- Add the option to define a dictionary of key combos rather than passing a callback to
libmodal#Enter
and manually tracking .- See
libmodal-key-combinations
for more information, or this example.
- See
2.1.0 – Exit Supression
Changes
- It is now possible to pass an additional variable to
libmodal#Enter
to indicate that the user wishes to control when the mode exits, rather than accept the default<Esc>
- To tell the mode to exit, pass
1
as the third parameter tolibmodal#Enter
, and then setg:{modeName}ModeExit
to1
when exiting is desired.
- To tell the mode to exit, pass
2.0.1 – Unique Input Variables
Changes
libmodal#Enter
will now create a unique variable for receiving user input based on the name of the mode that was entered.- This should prevent multiple modes from interfering with each other, especially if more than one Vim window is open at a time.
- The variable is now
g:{modeName}ModeInput
.
1.0.0 – Initial Release
Changes
- Implement first working version of
libmodal#Enter
.- Define a mode by passing a
modeName
and amodeCallback
. - Listen for input with the variable
g:libmodalInput
.
- Define a mode by passing a