Skip to content

Instantly share code, notes, and snippets.

@nakagami
Last active October 6, 2024 12:28
Show Gist options
  • Save nakagami/fce934cae71a1d7857548b14a61a4a57 to your computer and use it in GitHub Desktop.
Save nakagami/fce934cae71a1d7857548b14a61a4a57 to your computer and use it in GitHub Desktop.
author date
Hajime Nakagami<[email protected]>
Sep 27, 2024

Introduction to pyvim

Do you use vim?

I have been using vi clone for over 30 years.

Currently, I use vim as vi, which comes by default with the OS.


Do you know pyvim?

Yes, pyvim is a pure python vim clone.


Original pyvim

https://pypi.org/project/pyvim/

  • pyvim (and python-prompt-toolkit) has written by Jonathan Slenders
  • pyvim seems experimental package to show the functionality of python-prompt-toolkit.
  • A new version of pyvim has not been released in a few years.
  • However, I saw great potential in this package as a vi clone!

Fork

https://github.com/nakagami/pyvim

  • I have made it work with newer version python and dependent packages.
  • I tried to make it work as much as possible the same as vi/vim.
  • The key bindings I use on a daily basis work pretty well, now.
  • But internally, I applied many monkey patches to python-prompt-toolkit.
  • The purpose is different from the original pyvim, now.
  • If any of the key bindings do not work, please create a github issue!
  • Of course I will be happy if you send me a pull request.

Demonstration

Install pyvim and required package(s) in your python environment

docker run -it python bash
pip install git+https://github.com/nakagami/pyvim >/dev/null
pip install janome >/dev/null
pyvim demo.py

then write your code

from janome.tokenizer import Tokenizer
t = Tokenizer()
print(t.tokenize("すもももももももものうち"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment