Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 2.02 KB

README.md

File metadata and controls

61 lines (41 loc) · 2.02 KB

Randomize.nvim

Lua Neovim

Welcome!

If you've stumbled upon this plugin, chances are you don't need it. randomize.nvim was created to address a simple yet annoying problem: generating mock data to test a REST API.

While a quick script might work for single use cases, I needed a solution that could speed up the data generation on different CSV files with varying numbers of columns and diverse values requirements. Relying on scripts would have meant cluttering them with numerous if statements to account for all the variations, making the process cumbersome and error-prone.

This plugin provides an easy way to generate random values directly within Neovim, giving you fine control over the data to ensure it's both random and meaningful.

Installation

Using lazy.nvim:

{
    "simone-lungarella/randomize.nvim",
    config = function()
        require("randomize").setup()
    end,
}

Using packer.nvim:

use({
    "simone-lungarella/randomize.nvim",
    config = function()
        require("randomize").setup()
    end,
})

Usage

RandomizeBetween

  1. Select content in different lines in Visual mode;
  2. Run :RandomizeBetween <min> <max>;
  3. The function will replace selected content with random numbers in choosen range.
random-numbers.mp4

RandomizeDateBetween

  1. Select content in different lines in Visual mode;
  2. Run :RandomizeDateBetween <yyyy-MM-dd> <yyyy-MM-dd>;
  3. The function will replace selected content with random dates in choosen range.
random-dates.mp4

License

This plugin is licensed under the MIT License.