Giter Site home page Giter Site logo

ugbi's Introduction

Ugbi

Ugbi is a Vim plugin that provides critical unimplemented functionally that some people (only me) say is the best plugin ever developed. While I was perusing the Vim documentation for autocommands, I discovered UserGettingBored. I immediately knew something was wrong because it is impossible for anyone to get bored while using Vim. After many sleepless nights, I attempted to trigger the event by repeating the same key 42 times. The anticipation grew upon each click llllllllllllllllllllllllllllllllllllllllll then, as I originally expected, nothing happened. This further solidified that it is indeed impossible for a user to get bored in Vim.

But wait, there was a second line in the documentation. It said Just kidding! :-). It was at that moment that I realized someone meant to implement Samuel L. Jackson in the vimaverse. It has been a grueling 46 years, but the hard work has finally paid off. I'd like to thank my sponsor, that random person on Reddit r/vim.

                        UGBI - UserGettingBored Improved

                              by Mike Smith
                    Ugbi is open source and freely distributable

                             Help poor children in Uganda!
             type  :help iccf                     for information

             type  :q                             to exit
             type  :help UserGettingBored or <F1> for on-line help
    
    
    
    
                                                        UserGettingBored
UserGettingBored                When the user presses the same key 42 times.
                                Just kidding! :-)
                                

Demo

ugbi

Setup

Installation

Install using your favorite package manager, or use Vim's built-in package support:

mkdir -p ~/.vim/pack/mkesmithgh/start
cd ~/.vim/pack/mkesmithgh/start
git clone https://github.com/mikesmithgh/ugbi.git
vim -u NONE -c "helptags ugbi/doc" -c q

Using vim-plug

Plug 'mikesmithgh/ugbi'

Using Vundle

Plugin 'mikesmithgh/ugbi'

For the best experience, use VIM version 9.0 or greater compiled with the +termguicolors feature.
Use a terminal that supports truecolor and enable the termguicolors option in your Vim configuration.

set termguicolors

Compatibility

Ugbi is compatible with Vim 8.0 and greater. If you are using a version less than 8.0 then the plugin will not work.

Usage

Only alphanumeric [a-zA-Z0-9] keys in insert mode trigger a count that is used by this plugin. This is done by remapping the keys in insert mode to trigger the plugin. To trigger the plugin, open a buffer and repeat the same character 42 times in insert mode.

Commands

Command Action
:UgbiEnable Enable the plugin and setup keymappings to intercept alphanumeric characters in insert mode.
:UgbiDisable Disable the plugin and remove keymappings that intercept alphanumeric characters in insert mode.

Customization

" Enable the plugin
" Enabled by default, set to 0 to disable and 1 to enable
" After setting to disabled, you will need to run the comman UgbiDisable or restart Vim
let g:ugbi_enabled = 1

" Show the current number of repeated characters while typing
" Disabled by default, set to 0 to disable and 1 to enable
let g:ugbi_show_count = 0

Ackowledgements

  • Samuel L. Jackson - The inspiration, couldn't have done it without you Sammy!
  • Tim Pope - Excellent reference for Vim plug-in development.
  • artem - Used to generate ASCII art in truecolor.
  • text-image.com - Initially used to render ASCII art but size of art was too large to fit in a normal sized screen.
  • baleia.nvim - Plugin worked perfectly for highlighting. However, it is only available on Neovim. I was able to reference nvim_buf_add_highlight() to discover similar functionaly in Vim matchaddpos() to positionally highlight instead of using a regex.
  • Colorizer - Initially attempted highlighting with this plugin. Although it worked, there was bad lag due to regex matching.
  • AutoComplPop - Plugin referenced for intercepting keystrokes.

ugbi's People

Contributors

mikesmithgh avatar

Stargazers

João Fernandes avatar Aaron Uriel Guzman Cardoso avatar  avatar Merlin Attila Fejzuli avatar ColdMacaroni avatar  avatar Jans Heikkinen avatar Anuj Dhungana avatar  avatar Tim Tyrrell avatar EJ avatar Ano Rebel avatar Mike Iversen avatar Dmytro Sych avatar Tom Moulard avatar Richard Li avatar Aravinda Rao avatar Nick Caniglia avatar Aaron avatar Olivia (Zoe) avatar mluna avatar  avatar  avatar Kalix Zee avatar Andrew M. avatar Charles Chiu avatar Axlefublr avatar

Watchers

 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.