prompt-toolkit / pyvim

Pure Python Vim clone.
BSD 3-Clause "New" or "Revised" License
2.52k stars 161 forks source link

Why are most of vim's shortcuts in prompt-toolkit? #53

Closed lunemec closed 9 years ago

lunemec commented 9 years ago

I was trying to add some shortcuts, but I was wondering where are most shortcuts for pyvim. I found them all in python-prompt-toolkit, why is that? You want to provide vim-like shortcuts to all who use prompt-toolkit?

SanketDG commented 9 years ago

I don't know what you mean by shortcuts, but have a look at key_bindings.py. This may be what you are looking for.

python-prompt-toolkit is just a dependency for handling keyboard input.

lunemec commented 9 years ago

Oh I meant python-prompt-toolkit/key_binding/bindings/vi.py There is a ton of common keyboard combinations specifically for vim ... I'm just wandering why are these in prompt-toolkit and not pyvim.. because when you want to edit or add some, you have to do this into another project...

jonathanslenders commented 9 years ago

The reason is that prompt-toolkit, in its core, is a kind of GNU readline replacement. Everything that readline does should be in there. And it happens that readline also implements a lot of Vi key bindings. (Especially the motion and text blocks commands.)

So, this is a conscious decision, to avoid code duplication.

lunemec commented 9 years ago

Thank you.