All Projects → Houl → repmo-vim

Houl / repmo-vim

Licence: other
Repeat motions [for which a count was given]

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to repmo-vim

opensim-moco
Solve optimal control problems for musculoskeletal models using OpenSim and direct collocation.
Stars: ✭ 45 (+25%)
Mutual labels:  motion
interpolations
Lightweight Unity library for smoothing movements and value progressions in code (dragging, easing, tweening).
Stars: ✭ 29 (-19.44%)
Mutual labels:  motion
spr
Spring-driven motion library
Stars: ✭ 43 (+19.44%)
Mutual labels:  motion
justified
Wrap, align and justify the words in a string.
Stars: ✭ 30 (-16.67%)
Mutual labels:  repeat
WebCamCap
Motion capture tool for 2D/3D motion capture with LED markers.
Stars: ✭ 20 (-44.44%)
Mutual labels:  motion
motion-hooks
A simple Hooks wrapper over Motion One, An animation library, built on the Web Animations API for the smallest filesize and the fastest performance.
Stars: ✭ 93 (+158.33%)
Mutual labels:  motion
use-spring
Hooke's law hook
Stars: ✭ 53 (+47.22%)
Mutual labels:  motion
pymetawear
Community developed SDK around the Python bindings for the C++ SDK
Stars: ✭ 42 (+16.67%)
Mutual labels:  motion
room-glimpse
Read what your Raspberry Pi sees (picamera + Azure Cognitive / IoT)
Stars: ✭ 15 (-58.33%)
Mutual labels:  motion
ux-animate
A simple but powerful tweening, spring physics, animation library for Rust
Stars: ✭ 19 (-47.22%)
Mutual labels:  motion
dynamic-motion
Provide additional functionality to Android MotionLayout.
Stars: ✭ 34 (-5.56%)
Mutual labels:  motion
piCamBot
Security camera based on a raspberry pi and Telegram, controllable by smartphone
Stars: ✭ 43 (+19.44%)
Mutual labels:  motion
ioBroker.ring
Ring Video Doorbell Adapter
Stars: ✭ 25 (-30.56%)
Mutual labels:  motion
ReactZooApp
ReactZooApp
Stars: ✭ 33 (-8.33%)
Mutual labels:  motion
Gestures-Samples
Project Prague Code Samples
Stars: ✭ 98 (+172.22%)
Mutual labels:  motion
Juicer
Juicer is a generic animation / motion library for macOS & iOS & tvOS written in Swift
Stars: ✭ 13 (-63.89%)
Mutual labels:  motion
gloss
a powerful style system for building ui kits
Stars: ✭ 16 (-55.56%)
Mutual labels:  motion
rerunner-jupiter
Extension for Junit 5. Re-run failed JUnit tests immediately.
Stars: ✭ 107 (+197.22%)
Mutual labels:  repeat
preact-motion
A fork of React-Motion to be used with Preact
Stars: ✭ 28 (-22.22%)
Mutual labels:  motion
chronoman
Utility class to simplify use of timers created by setTimeout
Stars: ✭ 15 (-58.33%)
Mutual labels:  repeat

repmo.vim

Rewrite of plugin/repmo.vim, the script is simpler now, and autoloaded.

With repmo, you can map keys and make them repeatable with a key. Repmo is targeted at motions and scroll commands, because for each mapped key you need to specify an opposite key.

For key mapping there are two functions: repmo#SelfKey() indicates remapping off (required when mapping a builtin key to itself), repmo#Key() indicates remapping on (usually for everything else). The indicator is used by repetition keys.

New Feature: Typing [count]; (given you mapped ;) updates the remembered count.

Installation

Configuration

Mappings

There is no plugin file, mappings should be defined in the vimrc.

" map a motion and its reverse motion:
:noremap <expr> h repmo#SelfKey('h', 'l')|sunmap h
:noremap <expr> l repmo#SelfKey('l', 'h')|sunmap l

" if you like `:noremap j gj', you can keep that:
:map <expr> j repmo#Key('gj', 'gk')|sunmap j
:map <expr> k repmo#Key('gk', 'gj')|sunmap k

" repeat the last [count]motion or the last zap-key:
:map <expr> ; repmo#LastKey(';')|sunmap ;
:map <expr> , repmo#LastRevKey(',')|sunmap ,

" add these mappings when repeating with `;' or `,':
:noremap <expr> f repmo#ZapKey('f')|sunmap f
:noremap <expr> F repmo#ZapKey('F')|sunmap F
:noremap <expr> t repmo#ZapKey('t')|sunmap t
:noremap <expr> T repmo#ZapKey('T')|sunmap T

With argument, you can make f remember the count (same for F, t and T):

:noremap <expr> f repmo#ZapKey('f', 1)|sunmap f

Scroll commands work too:

:noremap <expr> <C-E> repmo#SelfKey('<C-E>', '<C-Y>')
:noremap <expr> <C-Y> repmo#SelfKey('<C-Y>', '<C-E>')

Alternative repetition keys (also working in addition to ; and ,):

" repeat the last [count]motion:
:map <expr> <Space> repmo#LastKey('')|sunmap <Space>
:map <expr> <BS>    repmo#LastRevKey('')|sunmap <BS>

Variables

g:repmo_require_count boolean (default 0)

If non-zero, a repetition key like ; only repeats the last motion for which a count was given. This used to be the only available option. If zero, ; repeats any last motion, this is the new default! You can change the value at any time.

If you want the old behavior back, put in your vimrc

:let g:repmo_require_count = 1

Foreign scripts support

If you want to use ; and , for repetition, then this may raise conflicts with foreign scripts. But you can set up repmo to work together with many of these scripts:

Make it work with Fanfingtastic:

" Do not map fanfingtastic keys:
:let g:fing_enabled = 0

:map <expr> ; repmo#LastKey('<Plug>fanfingtastic_;')|sunmap ;
:map <expr> , repmo#LastRevKey('<Plug>fanfingtastic_,')|sunmap ,

:map <expr> f repmo#ZapKey('<Plug>fanfingtastic_f')|sunmap f
:map <expr> F repmo#ZapKey('<Plug>fanfingtastic_F')|sunmap F
:map <expr> t repmo#ZapKey('<Plug>fanfingtastic_t')|sunmap t
:map <expr> T repmo#ZapKey('<Plug>fanfingtastic_T')|sunmap T

or if you like Sneak:

map  <expr> ; repmo#LastKey('<Plug>Sneak_;')|sunmap ;
map  <expr> , repmo#LastRevKey('<Plug>Sneak_,')|sunmap ,

map  <expr> s repmo#ZapKey('<Plug>Sneak_s')|ounmap s|sunmap s
map  <expr> S repmo#ZapKey('<Plug>Sneak_S')|ounmap S|sunmap S
omap <expr> z repmo#ZapKey('<Plug>Sneak_s')
omap <expr> Z repmo#ZapKey('<Plug>Sneak_S')
map  <expr> f repmo#ZapKey('<Plug>Sneak_f')|sunmap f
map  <expr> F repmo#ZapKey('<Plug>Sneak_F')|sunmap F
map  <expr> t repmo#ZapKey('<Plug>Sneak_t')|sunmap t
map  <expr> T repmo#ZapKey('<Plug>Sneak_T')|sunmap T

Notes

The odd term "zap-key" means one of f, F, t, T, ; or , (no text is deleted!).

Requires a not-too-old Vim which correctly handles a [count] typed before an <expr> mapping.

The leading colons are only for readability, nevertheless Vim treats them as whitespace.

Related

Looks like vim-expand-region has a similar purpose.

License

Copyright (c) Andy Wokula. The Vim License applies.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].