Code Monkey home page Code Monkey logo

vim-eazy-timer's Introduction

vim-eazy-timer

Basic timer plugin for vim. First attempt at writing a vim plugin.

Usage

There's only 3 commands: ETimer, ETList, and ETCancel. The commands are pretty self-explanatory.

  • ETimer: set a timer, requires 1 argument to specify the duration
  • ETList: Lists timers that are currently active (timer ID -> duration)
  • ETCancel: cancels all timers that are active

Creating a timer

Just run :ETimer <duration>, where <duration> takes a format like 10s, 500ms, 1h or 15m. Some examples:

  • Set a timer for 2 hours: :ETimer 2h
  • Set a timer for 15 minutes: ETimer 15m

Setting one timer doesn't affect the other timer

Actions when timer expires

The default behaviour is a simple Timer expired message being echoed, and calls timer_stop on the timer. You can specify a custom callback function by setting g:etimer_callback = 'MyCallback' in your .vimrc. The callback takes one argument (the timer id).

Cancelling all timers

ETCancel takes no arguments, and is equivalent to call timer_stopall().

See active timers

ETList just lists the actual timer ID's and their duration. Example

:ETimer 15s
:ETList

Will output something like:

3 -> 15s

TODO's

  • Add information on when the listed timers were set, seeing how much time is left
  • Allowing ETimer to take a second argument for a specific callback
  • Make ETimer take -nargs=+ args, so we can set several timers at once

vim-eazy-timer's People

Contributors

evodelavega avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.