exercism.nvim integrates exercism into Neovim by providing a set of commands and keybindngs to help you solve exercises faster.
utils.nvim for utility functions
termin.nvim for terminal support
exercism-cli installed and configured
exercism configure
tmux-tea (optional, recommended) for separate tmux sessions for each exercise
set -g @tea-default-command 'nvim'
for a better experience-- Lazy
{
'2kabhishek/exercism.nvim',
cmd = { 'Exercism' },
keys = { '<leader>exa', '<leader>exl', '<leader>exr' }, -- add your preferred keybindings
dependencies = {
'2kabhishek/utils.nvim', -- required, for utility functions
'2kabhishek/termim.nvim', -- optional, better UX for running tests
},
-- Add your custom configs here, keep it blank for default configs (required)
opts = {},
},
exercism.setup({
exercism_workspace = '~/exercism', -- Default workspace for exercism exercises
default_language = 'ruby', -- Default language for exercise list
add_default_keybindings = true, -- Whether to add default keybindings
max_recents = 30, -- Maximum number of recent exercises to keep
icons = {
concept = '', -- Icon for concept exercises
practice = '', -- Icon for practice exercises
},
})
exercism.nvim
provides a unified command interface with tab completion:
Exercism languages
- Lists all available languages, select one to list exercisesExercism list [language]
- Lists exercises for the specified language, show exercises for default language if not specifiedExercism test
- Runs tests for the current exerciseExercism submit
- Submits the current exerciseExercism open <language> <exercise>
- Opens a specific exercise directly in the specified languageExercism exercise <exercise>
- Opens a specific exercise directly using the default languageExercism recents
- Shows recently opened exercises in a fuzzy searchable listHere are the default keybindings:
Keybinding | Command | Description |
---|---|---|
<leader>exa |
Exercism languages |
List all available languages |
<leader>exl |
Exercism list [language] |
List exercises for the specified language |
<leader>ext |
Exercism test |
Run tests for the current exercise |
<leader>exs |
Exercism submit |
Submit the current exercise |
You can change these by setting
add_default_keybindings
tofalse
and adding your own keybindings.
Run :help exercism.txt
for more details.
I really like exercism but the back and forth between the browser and the terminal was a bit annoying. So I decided to integrate it with Neovim.
⭐ hit the star button if you found this useful ⭐
Source | Blog | Twitter | LinkedIn | More Links | Other Projects