Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Releases: Iron-E/vim-libmodal

2.4.0 – Timeouts

29 Apr 19:37
5f67d1b
Compare
Choose a tag to compare

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.
  • Timeouts are not implemented for modeCallbacks— they must be implemented by mode creators using timers.

Cloberring

  • Key combos no longer clobber each other when they share beginnings that are shorter.

    • e.g. zfo used to wipe out any z or zf mappings (although zfx would work just fine).
  • 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

26 Apr 04:49
0352539
Compare
Choose a tag to compare

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

25 Apr 17:38
Compare
Choose a tag to compare

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.

2.1.0 – Exit Supression

25 Apr 17:33
Compare
Choose a tag to compare

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 to libmodal#Enter, and then set g:{modeName}ModeExit to 1 when exiting is desired.

2.0.1 – Unique Input Variables

25 Apr 17:28
Compare
Choose a tag to compare

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

25 Apr 17:26
Compare
Choose a tag to compare

Changes

  • Implement first working version of libmodal#Enter.
    • Define a mode by passing a modeName and a modeCallback.
    • Listen for input with the variable g:libmodalInput.