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
- Neovim 0.7+
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"
}
},
}| 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"). |
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.
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;