Skip to content

NStefan002/speedtyper.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⌨️ Speedtyper

Practise typing while bored.

📺 Showcase

⌛ Countdown game mode

speedtyper_countdown_showcase.webm

🌧️ Rain game mode

Screencast.from.09-22-2023.01.30.02.PM.webm

⚡️ Features

  • Different game modes:

    • Countdown :
      • Objective: Type as much words as possible before the time runs out.
      • Customize Game Duration
      • Feedback: Receive instant updates on your words per minute (WPM) and accuracy.
    • Stopwatch :
      • Objective: Type an entire page of text as fast and as accurate as possible.
      • Feedback: Receive instant updates on your words per minute (WPM) and accuracy.
    • Rain :
      • Objective: Words fall from the top of the screen, type them before they hit the bottom.
      • Choose the number of lives
      • Customize rain speed

    Coming soon: code snippets: Enhance your coding speed and accuracy by typing various code snippets.

  • Languages: Currently only supports English and Serbian. There is also an option to provide a file with your prefered text.

  • Play Offline: No need to connect to the internet.

  • Distraction-Free Typing: Temporarily disable cmp to focus on the game.

✨ Recommended

📋 Installation

lazy:

{
    "NStefan002/speedtyper.nvim",
    cmd = "Speedtyper",
    opts = {
    -- your config
    }
}

packer:

use({
    "NStefan002/speedtyper.nvim",
    config = function()
        require("speedtyper").setup({
            -- your config
        })
    end,
})

⚙ Default configuration

Full list of options with their default values
{
    window = {
        height = 5, -- integer >= 5 | float in range (0, 1)
        width = 0.55, -- integer | float in range (0, 1)
        border = "rounded", -- "none" | "single" | "double" | "rounded" | "shadow" | "solid"
        -- lhs used to close game window.
        -- can be a string (applies to normal mode),
        -- or a table where the key represents the mode and the value is the mapping.
        -- e.g. close_with = "q" or close_with = { n = "q", i = "<M-q>" }.
        -- mode can be any of "n" | "i" | "x"
        -- nil means no map
        close_with = nil,
    },
    language = "en", -- "en" | "sr" currently only only supports English and Serbian
    sentence_mode = false, -- if true, whole sentences will be used
    custom_text_file = nil, -- provide a path to file that contains your custom text (if this is not nil, language option will be ignored)
    randomize = false, -- randomize words from custom_text_file
    game_modes = { -- prefered settings for different game modes
        -- type until time expires
        countdown = {
            time = 30,
        },
        -- type until you complete one page
        stopwatch = {
            hide_time = true, -- hide time while typing
        },
        -- NOTE: the window height will become the same as the window width
        rain = {
            initial_speed = 1.5, -- words fall down by one line every x seconds
            throttle = 7, -- increase speed every x seconds (set to -1 for constant speed)
            lives = 3,
        },
    },
    -- specify highlight group for each component
    highlights = {
        untyped_text = "Comment",
        typo = "ErrorMsg",
        clock = "ErrorMsg",
        falling_word_typed = "DiagnosticOk",
        falling_word = "Normal",
        falling_word_warning1 = "WarningMsg",
        falling_word_warning2 = "ErrorMsg",
    },
    -- this values will be restored to your prefered settings after the game ends
    vim_opt = {
        -- only applies to insert mode, while playing the game
        guicursor = nil, -- "ver25" | "hor20" | "block" | nil means do not change
    },
}

🧰 Commands

Command Description
:Speedtyper Select the game mode and enjoy playing!

🤝 Contributing

PRs and issues are always welcome.

✅☑️ TODO

See this.

🎭 Inspiration

👀 Checkout similar projects