Coder Social home page Coder Social logo

showmotion's Introduction

ShowMotion

Ever hammered the {w,W,b,B,e,E,ge,gE,;,,} keys to finally pass over the location you were aiming for?
ShowMotion is a tiny vim plugin to highlight the potential landing places when moving:

  • by words with {w,W,b,B,e,E,ge,gE}.
  • by chars with {f,F,t,T,;,,}

Somewhat inspired by the EasyMotion plugin, this one is only aimed at providing cues about where you'll land, not allowing to select a specific landing place. The pleasant consequence of this is it doesn't break your moving flow, which was the motivation for writing it.

Demo: https://imgur.com/sWUqiF3

Installation:

Plugin Manager Add to your /.vimrc
Vim Plug Plug 'lmintmate/ShowMotion'
dein.vim call dein#add('lmintmate/ShowMotion')
minpac call minpac#add('lmintmate/ShowMotion')
vim-packager call packager#add('lmintmate/ShowMotion')
plugpac Pack 'lmintmate/ShowMotion'
Vundle Plugin 'lmintmate/ShowMotion'
NeoBundle NeoBundle 'lmintmate/ShowMotion'

Configuration

Add these word-motion settings to your vimrc, either the first or the second group (depending on your preferences):

"*** Highlights both big and small motions
nmap w <Plug>(show-motion-both-w)
nmap W <Plug>(show-motion-both-W)
nmap b <Plug>(show-motion-both-b)
nmap B <Plug>(show-motion-both-B)
nmap e <Plug>(show-motion-both-e)
nmap E <Plug>(show-motion-both-E)
nmap ge <Plug>(show-motion-both-ge)
nmap gE <Plug>(show-motion-both-gE)

"*** Only highlights motions corresponding to the one you typed
nmap w <Plug>(show-motion-w)
nmap W <Plug>(show-motion-W)
nmap b <Plug>(show-motion-b)
nmap B <Plug>(show-motion-B)
nmap e <Plug>(show-motion-e)
nmap E <Plug>(show-motion-E)
nmap ge <Plug>(show-motion-ge)
nmap gE <Plug>(show-motion-gE)

Add these character-motion settings to your vimrc:

"Show motion for chars:  
nmap f <Plug>(show-motion-f)
nmap t <Plug>(show-motion-t)
nmap F <Plug>(show-motion-F)
nmap T <Plug>(show-motion-T)
nmap ; <Plug>(show-motion-;)
nmap , <Plug>(show-motion-,)

Known limitations:

  • E fails on highlighting the last character in the line

Thanks:

  • IRC: #vim, sakkemo, bairui, Raimondi and many others
  • Github: itchyny, haya14busa, Pyrohh

showmotion's People

Contributors

boucherm avatar callumhoward avatar itchyny avatar lmintmate avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.