Skip to content

2KAbhishek/exercism.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

23 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

License People Stars Forks Watches Last Updated

Exercism Meets Neovim πŸ’ͺ🧠

exercism.nvim in action
exercism.nvim in action

exercism.nvim integrates exercism into Neovim by providing a set of commands and keybindngs to help you solve exercises faster.

✨ Features

  • Browse and choose exercises from the entire exercism library from within Neovim
  • Quickly test and submit your solutions
  • Review your existing solution for an exercise
  • Simple keybindings and commands to make your workflow faster

⚑ Setup

βš™οΈ Requirements

  • exercism-cli installed and configured
    • Make sure to login with exercism configure
  • tmux-tea (optional, recommended) for separate tmux sessions for each exercise
    • Use set -g @tea-default-command 'nvim' for a better experience

πŸ’» Installation

-- Lazy
{
    '2kabhishek/exercism.nvim',
    cmd = {
        'ExercismLanguages',
        'ExercismList',
        'ExercismSubmit',
        'ExercismTest',
    },
    keys = {
        '<leader>exa',
        '<leader>exl',
        '<leader>exs',
        '<leader>ext',
    },
    dependencies = {
        '2kabhishek/utils.nvim', -- required, for utility functions
        'stevearc/dressing.nvim', -- optional, highly recommended, for fuzzy select UI
        '2kabhishek/termim.nvim', -- optional, better UX for running tests
    },
    -- Add your custom configs here, keep it blank for default configs (required)
    opts = {},
},

πŸš€ Usage

Configuration

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
    icons = {
        concept = '', -- Icon for concept exercises
        practice = '', -- Icon for practice exercises
    },
})

Commands

exercism.nvim adds the following commands:

  • ExercismLanguages: Lists all available languages, select one to list exercises.
  • ExercismList [language]: Lists exercises for the specified language, if not specified, uses the default_language.
  • ExercismTest: Runs tests for the current exercise.
  • ExercismSubmit: Submits the current exercise.

Keybindings

Here are the default keybindings:

  • <leader>exa for ExercismLanguages
  • <leader>exl for ExercismList
  • <leader>ext for ExercismTest
  • <leader>exs for ExercismSubmit

You can change these by setting add_default_keybindings to false and adding your own keybindings.

Help

Run :help exercism.txt for more details.

πŸ—οΈ What's Next

βœ… To-Do

  • Add tests

β›… Behind The Code

🌈 Inspiration

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.

πŸ’‘ Challenges/Learnings

  • I build exercism-fetcher to fetch exercises from exercism's github repos.
  • Reused knowledge from octohub.nvim, not too many challenges here.

πŸ” More Info


⭐ hit the star button if you found this useful ⭐

Source | Blog | Twitter | LinkedIn | More Links | Other Projects

Releases

No releases published

Sponsor this project

 

Packages

No packages published