Skip to content
programavimas.xyz docs

Neovim plugin

Solve problems in Neovim – install the Programavimas plugin, sign in from the browser or with a code over SSH, run and submit, and read every test's result.

Living in the terminal? The Programavimas plugin brings your courses into Neovim: problems in a sidebar, the statement next to your code, and your solutions as ordinary files on your computer. Running and submitting work exactly as in the browser – your code goes to the same judge and never runs on your computer.

It’s the twin of the VS Code extension: the same account, the same solution folders and the same results, so you can switch between them whenever you like.

Neovim with the Courses sidebar on the left, a C++ solution in the middle, its statement on the right with the problem's facts and formulas, and the sample results below

You need Neovim 0.10 or newer and curl, which macOS, Windows 10 and later and most Linux systems already have. Nothing else.

  1. Add the plugin. With lazy.nvim, add this to your plugins:

    {
    "AidasPa/programavimas.nvim",
    opts = {},
    }

    With Neovim 0.12’s built-in manager instead:

    vim.pack.add({ "https://github.com/AidasPa/programavimas.nvim" })
    require("programavimas").setup()

    Any other plugin manager works the same way with AidasPa/programavimas.nvim.

  2. Restart Neovim and run :checkhealth programavimas. Every line should be OK except “Not signed in”.

  1. Run :Programavimas login.

  2. Your browser opens Allow “Programavimas for Neovim” to use your account? Sign in first if you aren’t. The page lists what the plugin can do – see your courses and problems, run and submit your solutions, see your submissions – and what it can’t: see other students’ work, or change your password or settings.

  3. Select Allow and return to Neovim. It says Signed in as ….

Over SSH, or no browser? Run :Programavimas login device. Neovim shows a code and an address: open the address on any device – your phone will do – sign in, enter the code and select Allow. Over SSH this is what :Programavimas login does by itself.

The plugin never sees your password: the app gives it a key of its own, which you can take back at any time (see Account and signing out).

The first time you open a problem, Neovim asks Where should solutions live? – the current folder, or another one you type. Inside it, each problem gets a folder of its own, in course order:

solutions/ the folder you chose
algorithms-11/ course
01-search-and-sorting/ topic
01-binary-search/ problem
main.cpp your solution (main.py for Python, main.cs for C#)
input.txt your own input, sample 1 to start with
.programavimas links the folder to the problem
  • A new solution starts from your newest work on that problem – the draft the browser saved or your latest submission, whichever is newer – or else from the starter code.
  • Saving also saves your draft on the server. :w sends the file to the server, so the browser and VS Code open the same code. When you open a solution or come back to Neovim, a draft saved elsewhere since comes into the file if the file has nothing new (you can undo it); if both changed, you choose which to keep or compare them first. :Programavimas sync checks now; ☁ in the status line means the server has your file as saved.
  • Folders and files are never moved or deleted. Unsaved changes are never replaced without asking.
  • The same folders as VS Code. Point both at one folder and switch editors whenever you like.
  • Keep the hidden .programavimas file. It links the folder to its problem; you can rename or move the folder itself.
  • Another folder later? Run :Programavimas folder. Existing folders stay where they are.

:Programavimas opens the Courses sidebar: your courses, their topics with deadlines, and every problem with the same states as in the browser – ○ not started, ◑ some tests pass, ✓ solved, ◌ not open yet. Press Enter on a topic to expand it and on a problem to open it; ? lists the other keys. Excel tasks open in the browser.

To find a problem by name, run :Programavimas open: a list of every problem of your courses to search (in Telescope, fzf-lua or snacks if you use one).

Opening a problem opens your solution file and, beside it, the statement: the problem’s facts on top – limits, input and output files, languages, deadline, attempts left – and below them the statement as the browser shows it, drawn to fit the window: formulas, lists, tables and code, and each sample’s input and output side by side. Press Enter on a link or an image to open it in the browser. If you read Markdown with a plugin such as render-markdown.nvim, the setting statement = { render = "markdown" } shows the statement as Markdown for it instead.

In a solution file:

Keys Command What happens
localleader r :Programavimas run Runs the statement’s samples. As often as you like; not graded.
localleader i :Programavimas custom Runs your program with the input file next to it: input.txt, or the problem’s own file such as duom.txt.
localleader s :Programavimas submit Submits for grading and uses one attempt, without asking again.
localleader p :Programavimas statement Shows the statement.
localleader l :Programavimas language Switches to another language the problem allows.

localleader is Neovim’s local leader key (\ unless you changed it). Want keys of your own for these commands anywhere in Neovim? :help programavimas-suggested-keys has a ready set under leader p. Attempts, limits, assessments and deadlines work as in the browser: see Running and submitting. Unsaved changes are saved before the code is sent.

Results appear in a window below the code while your program is checked – waiting, compiling, testing 7/12 – and then:

  • After running the samples: each sample’s input, the expected output and yours, with the differing lines marked and the first difference spelled out.
  • After running with your input: your input beside what your program wrote.
  • After submitting: the verdict, your points, the attempts left and every test – hidden tests included, once your submission is judged. Press Enter on a test to show or hide its data.

Compiler messages appear as diagnostics in your code. :Programavimas submissions lists your recent submissions; choose one to see its results again.

The plugin can also show the problem, the judging step and the attempts left in your status line: see :help programavimas-statusline.

:Programavimas account shows who you’re signed in as, with Open in browser, Change solutions folder… and Sign out; :Programavimas logout signs out at once. Your solution files stay on your computer.

To disconnect the plugin from the app’s side, open Settings → Security → Connected apps and select Disconnect (see Account security).

The plugin’s messages follow your account’s language (Settings → Preferences). :help programavimas describes every command and setting.

What you see What to do
“curl wasn’t found” Install curl with your system’s package manager, then restart Neovim.
The browser doesn’t open when you sign in Neovim shows the address: open it yourself. Over SSH, use :Programavimas login device.
“Couldn’t reach the server” Check your internet connection and try again. :checkhealth programavimas says whether the server answers.
The problem says to use the browser Its allowed languages can’t be edited in Neovim yet. C++, Python and C# can.
Nothing happens on localleader r The keys work only in a solution file of a problem folder. Open the problem with :Programavimas open, or run :Programavimas run.