7 ms·
Vy – A Vim-like in Python made from scratch
- OJFord 11y ago> a great chance to substitute vim in the future. Why? What's the advantage over vim?
- kachnuv_ocasek 11y agoPresumably because of its modularity and extensibility. He was probably right, just look at Neovim.
- nailer 11y agoAlso: the modularity and extensibility doesn't come at the expense of vim's traditional portability: Python 2.7 is a fairly low baseline for Unix servers.
- OJFord 11y agoHm, maybe. I quite like the look of 'plugins', even the vi-ness is handled by one. But it seems a strange thing to say in the readme - it's clearly a long way off being close to a contender.
- navait 11y agoSometimes, to attract attention, you need to say things that will get people riled up.
- kachnuv_ocasek 11y agoBram Moolenaar is supposedly the author of that statement, which makes it more so relevant.
- reikonomusha 11y agoThe keys are bound in the plug-in, and that's it. The (very partial) functionality of vi isn't actually present or implemented there.
- bechampion 11y agoi don't think so
- santiagobasulto 11y ago"I'm working on a ncurses based library with a symmetrical archicture to python tkinter". That sounds nice. I'd suggest don't work trying to replace vim in the future. Work to learn and to fix any necessity that by some reason vim is not fulfilling for you. Then the world will say... The project has a good architecture (plugins seem interesting). But it could use some tidying up.
- OJFord 11y ago> it could use some tidying up. Yes.. def beta(area): print 'shit' area.chmode('BETA')
- zephod 11y ago> Everything is very well minimalistic and modular. Lost me by the third sentence. It's not even proofread. I doubt we're seeing the future of text editing here.
- klez 11y agoI guess someone valuing code more than perfection in prose doesn't deserve to be writing code. Remember not everyone speaks English as a first language, and not everyone has the time, the knowledge or the resources to proof-read their project description. And most people don't care that much when they see such errors.
- OJFord 11y agoI agree about grammar. But for me the hardest part in reading the readme is the presentation - such a wall of text, and a lot of it seems to be trying to sell the idea of vim to me, when I'm presumably already onboard with that if I'm looking at a self-described "vim-like" project.
- pvdebbe 11y ago"A wall of text" used to mean a large body of text, unparagraphed and hard to follow. The author's prose may not conform to all points of Strunk & White, but it doesn't look a wall of text to me. (The youngsters these days! :)
- bechampion 11y agomate no matter you're age , that's a wall of text.
- JupiterMoon 11y agoPaste it into vi/m or a faithful clone then perform the following command. :%s/\n//
- 11y ago
- qznc 11y agoLooks similar to http://www.vixn.org/ http://www.vixn.org/
- emilssolmanis 11y ago> [..] on top of tkinter which is one of the most productive graphical toolkits. > .. > [..] on top of Tkinter that is such a great graphical toolkit. Right. About as great as pulling teeth. Not that there's many alternatives, of course...
- jofer 11y agoTkinter actually isn't _that_ bad. I've written several fairly large applications with it. You have to re-invent the wheel for several things due to its limited number of "widgets". It used to look very non-native, but that's been largely fixed. Other than that, though, it has a worse reputation than it deserves. Sure, I'd rather use Qt for something large, but honestly, for a quick-and-dirty gui, it's hard to beat Tk. You can get something reasonably nice looking (at least with recent versions) and reasonably cross-platform very quickly.
- bch 11y agoWhat sorts of widgets are missing that you are wishing (no pun intended) for.
- jofer 11y agoYay, puns! :) The first thing that comes to mind are help tooltips (a.k.a. balloons). There are a few third-party libraries, but none of them that I'm aware of get it quite right (especially for tooltips on menu items). There are couple of other common widgets as well, but I'm having trouble thinking of them at the moment. At any rate, there aren't too many (and ttk helps immensely in this regard), but it's something you miss coming from Qt. On the other hand, being able to put a minimal, but very usable gui together with just a few lines of code is a real strength of Tcl/Tk. (Though I usually use Python+Tkinter as I tend to write scientific applications.) There's a lot to be said for the right level simplicity vs batteries-included.
- bechampion 11y agoTk in 2015! its alive!!
- xmstr 11y agoLooks interesting but why not Python 3.x?
- jdimov9 11y agoBecause there is no good reason to use 3.x and 2.x is the natural choice that makes perfect sense?
- michaelmior 11y agoWhy is 2.x the "natural choice"? I'm not saying it's a bad choice, but you seem to be treating it as a given.
- metalliqaz 11y agoEnormous install base.
- zokier 11y agoFor text editor specifically I'd imagine the improved Unicode/bytestring handling would be a benefit.
- njharman 11y agoThere are many good reasons to use 3.x
- synparb 11y agopyvim (https://github.com/jonathanslenders/pyvim https://github.com/jonathanslenders/pyvim) is also a pretty slick vim clone in python that uses the python prompt toolkit (https://github.com/jonathanslenders/python-prompt-toolkit https://github.com/jonathanslenders/python-prompt-toolkit)
- blux 11y ago> The source code of the syntax highlighting plugin is about 80 lines of code. Which is not that big of an achievement considering it depends on pygments for syntax highlighting...
- michaelmrose 11y agoI don't believe Bram said it would replace vim I think he took something out of context.
- shadowmint 11y agoCurious, want to try it yourself before you flame it to death for being in python 2 or claiming to be remotely plausible as a vim substitute? git clone https://github.com/iogf/vy cd vy virtualenv . ./bin/pip install untwisted pygments ./bin/python setup.py install You'll probably want to edit /vyapp/plugins/toggle_mode.py to use a KeyPress binding that is valid for your platform at this point, or you'll get: _tkinter.TclError: bad event type or keysym "Apostrophe" ...and finally, ./bin/vy Right, now you can start playing wading your way through https://github.com/iogf/vy/blob/master/INTRO.md https://github.com/iogf/vy/blob/master/INTRO.md and try to understand the command syntax. Good luck! Vim clones are a dime a dozen; this is actually an entirely different thing, and although I can't imagine actually using it for anything... it's interesting to see people work on different approaches to text editors. A simple hackable python text editor may not be useful in the long term for anything (for all the reasons about distributing python and python performance limitations), but its certainly viable for prototyping interesting features.
- jdimov9 11y agoTell me again about those "python performance limitations".
- dbbolton 11y agoDevil's advocate: relative to C (which vim is written in), Python 2 is considerably slower, especially with CPython as its interpreter. Optimization is also tougher. Personally, I admit I'm not sure that the difference is significant for this particular project.
- Skunkleton 11y agoHonestly, python might perform better overall. Not because C is slower than python (ha), but because python probably outperforms vim script. Especially likely because vim plug-ins can be fairly complex.
- 11y ago
- florianletsch 11y agoHm, why do most of his files end with 10 to 15 blank lines of whitespace? Is that a thing or was he just sloppy?
- leetNightshade 11y agoI don't think it's "common", but people do it so they can scroll to the last line and have it appear near the top of the page. It's a matter of personal preference. Some editors allow you to scroll that far without the extra lines, many don't.
- thinkpad20 11y agoWhat editors don't do that? I'm only familiar with Emacs and Sublime which do. I'd hate to use an editor that didn't. Hopefully he added that functionality to Vy :)
- reikonomusha 11y agoAm I wrong in thinking that this is a Tk Text widget (or possibly several), with a selection of functions atop? Plugins for the most part are just key press callbacks which manipulate this Text widget and associated state? I know every project must start somewhere but this doesn't seem to have considerable substance for a purported next gen vi(m), and given its heavy reliance on pre-made tools (like text areas), without much abstraction, it seems like it would be hard to get over the hump to make it competitive with existing editors.
- mden 11y agoSome of the cleanest code I've seen! Pretty fun skimming through files and functions.
- reikonomusha 11y agoThere's lots of field mutation in the assortment of classes and functions with no documentation. Also lots of stuff that resembles this: for ind in chain: val = execute(ind, event) if val == True: opt = True elif val == False: opt = False return opt
- stevebmark 11y agoInteresting project. Vim is riddled with issues and we badly need a replacement (coming from a dedicated Vim user). Currently VimR and NeoVim are in the lead for tackling some of the hard problems (async calls, a real plugin system, obvious features like fuzzy finder with good UI integration, etc). I found this part amusing: "What did Bram Moolenaar say". After using Vim for a few years, and seeing his design choices, I wouldn't personally be interested in his opinion of an editor!
- alphakiller 11y agothis is cool. https://youtu.be/HXvjh1p7gSY https://youtu.be/HXvjh1p7gSY