Script Roundup: Cycle.vim, numbers.vim, Clutch
Send in your Vim scripts for review through our contact form or @vimnews.
Cycle.vim
Zef Houssney’s Cycle.vim allows lists of words to be cycled through. It has some built-in cycle groups, but it’s pretty easy to add new ones:
call AddCycleGroup(['one', 'two', 'three'])
Pressing <C-a>
will cycle the word under the cursor. Filetype matching is also supported, for cycling words specific to certain programming languages:
call AddCycleGroup('ruby', ['class', 'module'])
call AddCycleGroup(['ruby', 'eruby', 'perl'], ['else', 'elsif'])
Numbers.vim
numbers.vim (GitHub: myusuf3 / numbers.vim, License: MIT) by Mahdi Yusuf changes line numbering schemes based on the current editor mode:
This plugin will alternate between relative numbering (normal mode) and absolute numbering (insert mode) depending on the mode you are in.
VIM Clutch
VIM Clutch (License: CC BY-SA 3.0) by Aleksandr Levchuk is a hardware pedal for Vim:
When the pedal is pressed down, the pedal types “i” causing VIM to go into Insert Mode. When released, it types
<Esc>
and you are back in Normal Mode.
The author explains how to build and program the hardware. The hardware is largely off the shelf, but it had to be hacked to support sensing when the pedal is released.