Skip to content

simta1/cin.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

cin.nvim

A Neovim utility to reduce typing time when solving Competitive Programming problems. It scans your C++ variable declarations and automatically generates cin >> ...; statements.

2026-03-19.12-55-40.mp4

Requirements

Installation (lazy.nvim)

return {
    "simta1/cin.nvim",
    ft = "cpp",
    opts = {
        mapping = "<leader>in",
        types = {
            "int", "float", "double", "char", "bool", "string", "std::string",
            "long long", "long double",
            "ll", "ld", "ull"
        }
    },
}

Configuration (opts)

Option Type Default Description
mapping string|boolean false The keymap used to trigger the plugin in Normal or Visual mode. Set to a key string (e.g., "<leader>in") or false to disable. Only active in cpp files.
types table {"int", "float",...} A list of exact prefix strings used to identify variable declarations. Since it relies on matching the exact starting word, if you use namespaces like std::xxx, it must be explicitly included. You can add your custom types or macros here (e.g., "ll", "ui").

Usage

If you have configured a keymap (e.g., mapping = "<leader>in"), press it in Normal mode (for the current line) or Visual mode (for selected lines). It will scan those lines for variable declarations and automatically append a cin >> ...; statement right after. Alternatively, you can run the :InsertCin command manually.

Example

Before:

int n, m;
string st;

Select the lines above and run :InsertCin (or press your map).

After:

int n, m;
string st;
cin >> n >> m >> st;

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages