
Vy – A Vim-like in Python made from scratch - dajohnson89
https://github.com/iogf/vy
======
ahmeni
TKinter is a bit of a bizarre choice these days, it looks like you're locked
into a non-shell non-native GUI for the benefit of being able to natively
manipulate TKinter objects. Though, looking through the plugins it is nice to
see how simple and isolated the code for each is.

Lack of Python3 support is concerning as always with any modern Python
project.

~~~
y7
Why anyone would start a project exclusively supporting Python 2 _six years_
after the release of Python 3 is beyond me. (GitHub lists the first commit in
Nov 2014).

~~~
hashkb
I don't know the specifics (sort of watching, amuses, from the sidelines) but
the 2/3 schism is still very real.

I'm not fluent in Python at all, and so it seems I have to have both, and if
`pip install` doesn't work then I `pip3 install`. That seems pretty broken to
me.

~~~
dkuntz2
`pip` is dictated by your OS, so you've probably got python2 set as your
default python.

~~~
int_19h
Python itself has established the convention that the "python" binary is
always 2.x, and "python3" is 3.x. Even if Python 2 is not installed at all.
This naturally translated to other tools.

~~~
y7
I don't think this is necessarily true? It used to be, but I sometimes see
"python" being Python 3 and "python2" being Python 2.

~~~
int_19h
It's a PEP.

[https://www.python.org/dev/peps/pep-0394/](https://www.python.org/dev/peps/pep-0394/)

The long-term plan is to make "python" version-agnostic. But for the time
being, it is acknowledged that compatibility with Py2 is too important to do
it just yet.

------
flukus
Makes an interesting comparison to kakoune
([http://kakoune.org/](http://kakoune.org/)), at nearly every point the two
projects took the opposite decisions.

I'm really not a fan of pip as a delivery mechanism though, if it isn't ready
to be packaged properly then git clone and make instructions would be better.

~~~
sevensor
That's an interesting point! I switched over to Kakoune a couple of months
ago, from vim, and I'm delighted with it. The idea that what vim needs is
Motif widgets and more Python scripting (2.7 no less!) -- it's the exact
opposite direction, indeed.

~~~
flukus
I ended up switching back because I haven't had time to bring it up to the
level of vim and the extensions I have, particularly dbext. It's programming
model is interesting though, most of my work could be ported but there are
still a few that I don't think can be replicated, like the templating plugins.

~~~
sevensor
I think it would have been a lot harder to switch if I had made heavy use of
extensions. The only thing I go back to vim for at this point is vimdiff.
Kakoune doesn't have anything quite like it at this point, and I'm fine with
that. There's enough room in my head for both as long as I don't have to
switch too often.

------
Jeaye
Simply put: What does it offer which [neo]vim does not?

> Python is such an amazing language; it turns vy such a powerful application
> because its plugin API is high level naturally.

Ok, so you really like Python.

> You can take the best out of vy with no need to learn some odd language like
> vimscript or emacs LISP; since vy is written in Python, you use Python to
> develop for it.

Ok, so you _really_ like Python.

I'd note that Vim also allows writing plugins in Python, so that alone doesn't
warrant an entirely new editor. My biggest problem with this is that it
doesn't explain what it provides which other editors do not. As such, I'd
label this as the author thought "I love Python and want to make an editor
which is all about Python, ignoring all existing Python-supporting editors and
IDEs."

That shouldn't be enough to get people using it, though. It's not ubiquotous,
like Vim; it doesn't have the plugins and wholesome environment of Emacs; it
doesn't have the comparable refactoring/debugging/project management features
of modern Python IDEs; it doesn't even claim to provide anything new.

~~~
daenz
> I'd note that Vim also allows writing plugins in Python

Shameless plug, I wrote Snake
[https://github.com/amoffat/snake](https://github.com/amoffat/snake), which
makes writing plugins in Python much easier.

~~~
Lxr
I've been looking for something like this, thanks!

------
marmaduke
There's another one over here:

[https://github.com/jonathanslenders/pyvim](https://github.com/jonathanslenders/pyvim)

I've used Vim for years but on cli only as one of many jobs, fzf pydoc grep
find ssh etc etc. I don't quite understand the GUI approach but that's ok

------
iso-8859-1
See also [https://github.com/yi-editor/yi](https://github.com/yi-editor/yi) in
Haskell , which has vim keymap bindings

------
cheriot
Projects like this make me wonder why all the for-profit IDEs can't implement
better vi/emacs modes.

edit: I'm thinking of IntelliJ and realizing I've not used other for-profit
IDEs much.

~~~
sleepychu
Do you use the vim plugin? I find it pretty good. What's missing for you?

~~~
cheriot
I do use it. Aside from missing plugins of course, Crtl+o to go back to
previous cursor locations is unpredictable and Ctrl+p to complete the word if
it's appeared in the file. There's also some weirdness in multiline mode.

~~~
sleepychu
Ah. Maybe the difference is that I don't author much content in web.

------
35bge57dtjku
> vy is built on top of Tkinter which is one of the most productive graphical
> toolkits

I thought everyone always says it stinks and lacks better components.

------
akkartik
Any users of it around? Does being in Python make it seem less responsive than
regular Vim/Neovim?

~~~
Johnny_Brahms
I doubt you will notice much during regular editing. I once wrote a text
editor in chibi scheme which I would estimate to be slower than python,and it
was snappy despite doing all redraws and such itself.

What you will notice is of course the GIL. Once any plugin starts doing enough
work there will be noticeable lag unless Vy supports plugins using
multiprocess python.

I have been toying with writing an editor in guile scheme and despite using
_very_ suboptimal data structures and algorithms everything is instant up
until maybe 10 simultaneous cursors in a 30kb file.

Due to the shitty implementation (really just a first draft), that was
actually creating a new buffer for every insert.

~~~
Waterluvian
Isn't atom single process? I don't recall any plugins ever seriously hogging
it out. Sure you can't get paralleism with the GIL but you can still get
concurrency. It's not like these things weren't doable before we got multicore
machines. Just requires sensible plugin design.

~~~
Johnny_Brahms
Edit: Emacs is a great example btw. It is single threaded, and a lot of it is
written in elisp, which is slow and makes emacs have noticeable lag if you
turn some features on. The question was whether it was instant, rather than
usable.

\----------------------

First and foremost, atom has pretty much noticeable lag, even for someone like
me who thinks emacs is instant (which it isn't).

I agree that it requires a sensible plugin design, but the GIL will only get
you so far. I haven't used atom much, but I suspect the heavier plugins rely
on async tasks, which can be implemented using python's threads, or for python
3.4 and later using asyncio. This takes me to my next point:

People also under-estimate how FRIGGIN FAST v8 is. JS executed in v8 (or node)
will run so many laps around cpython it makes a web-technology-hater (but
whatever floats your boat!) like myself cry and bang my head to the wall.
People seem to think that they play in the same league. They do not.

------
gigatexal
Python and TK and a viable app? I'm impressed. Kudos to the author.

------
real-hacker
I have written a toy vi clone in python, based on curses,
[https://github.com/RealHacker/python-
vi](https://github.com/RealHacker/python-vi). That's nothing compared with Vy,
which obviously is a much more serious project.

------
wmu
Seems to be python-focused, but looks really nice.

~~~
mkosmo
That'd make sense. Written in python, for python (at least initially) since
the author likes python :-) Looks like a neat start to a new project. The
built-in IRC client made me chuckle, though.

~~~
dotancohen
> The built-in IRC client

I thought that this was a clone of Vim, not Emacs.

~~~
flukus
AHEM,
[http://www.vim.org/scripts/script.php?script_id=931](http://www.vim.org/scripts/script.php?script_id=931)

~~~
mkosmo
No updates since 2005, designed for 6.2... Holy cow you had to go dumpster
diving to find that script. I love the guy's changelog, though! :wq

~~~
flukus
It was the first one that came up on google. I did see someone create a more
recent one over on r/vim though.

------
filereaper
heh, you know... emacs is 'just' a wapper around a lisp interpreter in a
similar fashion.

------
jwilk
-EPARSE

"Vim-like" is an adjective, so where the noun it's modifying?

~~~
kaushalmodi
That was my first thought too; either the OP meant to write "Vim clone", or
forgot to put "editor" after "Vim-like".

~~~
gjm11
It's really not unusual for an adjective to be used to mean "thing described
by this adjective".

Laptop (computer). Roguelike (computer game). A glass of the house red (wine).
Tabloid (newspaper). Convertible (car). Mobile/cell (phone), though these days
people usually just say "phone". Etc.

------
poisonarena
awwwww... :( python 2.7

