Vim mode in REPL command line

I’ve really wanted to have vim bindings in the REPL for a while, and took it upon myself to give it a proper try. I’ve spent some time developing a package which emulates vim bindings in the REPL, it may be of use to some people here. It’s not perfect, but it checks off a lot of the vim basics. I would be very pleased to have feedback, feel free to try it out and to share your thoughts!

Some of the features implemented so far are:

  • Navigating with motions (h j k l)
  • Basic editing (e.g. dw, cw, x)
  • Editing text objects (e.g. diw)
  • Undo/Redo with u and C-r

Some of the bigger pieces I’d like to still tackle are

  • registers, including copy and paste from the system clipboard
  • unicode. The implementation is pretty naive right now and assumes that 1 char = 1 character width, which makes for some odd behavior when dealing with unicode characters.
  • improved documentation

This project started as an exercise in learning Julia way back during the pandemic, and it’s continued to be something I’ve chipped away at since then. Starting at the end of 2022 I began putting in an effort to polish it up, to take it from “a script I hack on” to a piece of software I would really want to use every time I use the Julia REPL. I’ve also been thrilled to have contributions that have really made the package actually usable (thanks @MilesCranmer!)

I do use it daily now - it still has warts and problems, but I find that being able to use my vim muscle memory is worth the occasional issue it causes. It’s progressed to the point where I’m at least comfortable telling people to try it and only being mildly afraid :sweat_smile:

Cheers!

17 Likes