Hacker News

Top stories

Live mirror
30 storiesupdated just nowView source snapshot
  1. Android 17 is the first since 3.x to add new APIs without releasing to the AOSP(grapheneos.social ↗)
    288comments
  2. Science Is Open Software(jepedersen.dk ↗)
    6comments
  3. SDCC – Small Device C Compiler(sourceforge.net ↗)
    1comments
  4. Cloudflare Quick Tunnels(cloudflare.com ↗)
    259comments
  5. Saving another 100TB of RAM(cloudflare.com ↗)
    54comments
  6. How to Write with an LLM(sockpuppet.org ↗)
    287comments
  7. Why building a Rust LSP is hard(rust-glancer.github.io ↗)
    5comments
  8. Xcode 27.1 Beta Release Notes(developer.apple.com ↗)
    72comments
  9. The Farnese letter(simonklee.dk ↗)
    5comments
  10. How OpenAI Used Its Own LLMs to Design Its Jalapeño Chip(ieee.org ↗)
    61comments
  11. Photon-Emission-Guided Laser Fault Injection Enables RP2350 Secure Debug(ledger.com ↗)
    59comments
  12. Show HN: Cactus Needle 3: 8-29MB automation models can match DeepSeek V4 Flash(cactuscompute.com ↗)
    78comments
  13. The first new cat species discovered in 100 years(nationalgeographic.com ↗)
    68comments
  14. Show HN: LiveWorld – Every 24/7 YouTube live camera on one globe(liveworld.info ↗)
    21comments
  15. OpenJev(openjev.com ↗)
    249comments
  16. Cache-to-Cache: Direct Semantic Communication Between LLMs (2025)(arxiv.org ↗)
    12comments
  17. Claude Code now reads AGENTS.md if there is no Claude.md(claude.com ↗)
    198comments
  18. Cyclomatic Complexity in C#(ndepend.com ↗)
    15comments
  19. Goroutine Leak Profiles(go.dev ↗)
    discuss
  20. LispBM is a concurrent Lisp for microcontrollers with message passing(lispbm.com ↗)
    1comments
  21. Minimal Phone 2(minimalcompany.com ↗)
    190comments
  22. Warez: The Infrastructure and Aesthetics of Piracy (2021)(archive.org ↗)
    33comments
  23. Gemini hacked three companies in first known breakout by Google's AI(reuters.com ↗)
    15comments
  24. The Implications of Linguistic Illegibility for LLM Security(arxiv.org ↗)
    20comments
  25. Two parallel neural ectoderm progenitors contribute to the developing brain(newscientist.com ↗)
    59comments
  26. Alibaba open-sources AI model that can detect cancer and nearly 150 conditions(scmp.com ↗)
    7comments
  27. Inside ZCode: Silently uploading your Git history to the cloud(ferstar.org ↗)
    94comments
  28. How SpaceX streamlined the Raptor engine(construction-physics.com ↗)
    48comments
  29. C++26: Trivial infinite loops are no longer undefined behaviour(sandordargo.com ↗)
    209comments
  30. A search-and-inference database from scratch in pure Zig(antfly.io ↗)
    17comments

Vis: A Vim-Like Text Editor

355 pointsby 10y agogithub.com
126 comments
10y agoHN ↗

That video needs sound, I have no idea about what's happening.

10y agoHN ↗

As the producer of the "video" (it is actually ASCII, you can copy paste stuff out of it) I agree, here is an annotated version:

    - x/pattern/  extracts stuff from the text, creates a selection for every match
    - some normal vi motions are used to modify the selections, "o" to move the
      cursor from one end of the selection to the other, "w" to move the cursor
      to the start of the next word
    - y/,/ similar to x/ but create a selection for everything which does not match,
      hence splitting the existing selection  into multiple ones
    - \ trim selections i.e. remove leading and trailing white space
    - v/Vis keep all selection not matching Vis
    - g/F|C keep all selection matching F|C
    - + rotate selection contents on the same line
    - v/Com keep all selection not matching Com
    - + rotate some more
    - ESC clear selections, ESC remove all cursors
    - x/pattern select different regions
    - .,/^\} extend selection by searching in forward direction until the first match
      of } at the start of a line
    - { i/#if 0\n/ a/\n#endif/ } insert some text before every selection with i/text/
      and append some text after every selection with a/text/
   
    - change file, select similarily indented code block using a text object: vi<Tab>
    - x/\w+ extracts all words from selection
    - Tab align selections
    - C-c remove first selection column (i.e. remove first selection on every line)
    - Esc clear selections, switch to normal mode, move to next { with f{
    - i<S-Tab> goto insert mode and align cursors

    - search a variable, select it with C-n
    - C-n select next match
    - C-x skip this match, that is clear it and select next match
    - C-n select next match
    - c vi change operator, delete selection, switch to insert mode
    - rename the variable, switch back to normal mode
    - undo the changes
10y agoHN ↗

it is actually ASCII, you can copy paste stuff out of it

No offense to your texteditor, I'm a vim enthusiast and after installing vis just now I really liked it, but that I can copy paste from that screencast caught me really off guard, and it's the height of my day today.

Sure, in hindsight it seems obvious, but ... that's pretty cool!

... not sure what that says about me, maybe I don't wanna know.

thanks for pointing my eyes that way!

10y agoHN ↗

I say it says you're an engineer. :D

Only engineers see stuff like this and go "aw, cool!"

Incidentally the "video" is a small pile of JSON - filter for XHR in the devtools to find it, the URL uses an expiration system so a direct link would break. (Aaaand I just learned they implemented VT100 in JavaScript... the JSON is full of actual, real, escape sequences...)

(If you haven't seen it, you might also like: https://github.com/TheMozg/awk-raycaster / https://news.ycombinator.com/item?id=10896901)

10y agoHN ↗

Looks promising, and support for huge files is a weak point in vim, so I gave it a try. My usual workflow with big logfiles is to zoom into certain types of messages with e.g. :v/error/d and back out with u, and alternatively jump from one occurrence of a string to the next with *. That doesn't seem to work, so for the moment it's not the right 80% for me. But I do think it's a worthy project, so I'll keep an eye on this

10y agoHN ↗

:help :v will tell you:

:[range]v[global]/{pattern}/[cmd] Same as :g!.

Where:

:[range]g[lobal]!/{pattern}/[cmd] Execute the Ex command [cmd] (default ":p") on the lines within [range] where {pattern} does NOT match.

So :v/error/d will delete all lines that don't contain the string "error".

10y agoHN ↗

Which neatly maps to grep's -v option that does the same.

10y agoHN ↗

I always thought "-v" meant "verbose" traditionally in Unix command line options.

10y agoHN ↗

Oh! I've been messing about with a bit of splitting up of C++ classes into seperate headers as a bit of a test and I recently did a:

  sed -i "/#include <vcl\/button\.hxx>/d" $(git grep -l "vcl\/button\.hxx" *.hxx | grep -v precompiled)

Knowing about a :v might have been helpful...

10y agoHN ↗

Everything involving searching is currently probably very slow for large files, this is especially true for backward searches. The reason being that we currently rely on the regexp engine of libc and thus have to copy the underlying text to a contiguous memory area.

Navigating large files with motions like 50%, 70% should however be instantaneous. Navigating by line number is again somewhat slower, because the file actually needs to be read in this case.

Aside from that :v/ has a different meaning in vis.

10y agoHN ↗

Obviously, structural editing like that of SAM. Vim also does not have native support for multiple cursors.

10y agoHN ↗

The editor core is written in a reasonable amount of clean (your mileage may vary), modern and legacy free C code enabling it to run in resource constrained environments. The implementation should be easy to hack on and encourage experimentation (e.g. native built in support for multiple cursors). There also exists a Lua API for in process extensions.

10y agoHN ↗

Sam expressions for manipulating text. This is a blub thing - if you haven't seen them you might not realise what you're missing out on. Try to imagine an editor where the core idea is a better-sed-than-sed.

Two well-known editors to come from the ed tradition: vi and sam. Vi is an obvious evolution - make it 2d. Sam did this as well, but its main focus was developing the expression language. For example, so you can chain expressions together for text manipulation. Another comment mentions multiple cursors.

But sam also has plan9 culture. It strongly encourages the mouse with an interaction that I've found to difficult to adjust to.

Vis seems to unify the best bits of vi and sam, from a unix user's perspective.

If anyone reading this knows sam or vis fluently, it would be helpful to have a youtube video for each of sam and vis in the the style of the recent Russ Cox video on acme.

[I'm struggling to get this vis thing to build and run, tips? Debian stable. I downloaded libtermkey, configure, make make install. Not thrilled about this - would rather it create .a and .h files I could copy it into the vis dir. Now when I run ./vis it says, "error while loading shared libraries: libtermkey.so.1: cannot open shared object file: No such file or directory".]

10y agoHN ↗

Generalized library troubleshooting: make sure you installed the -dev of whatever package through apt-get, and try running sudo ldconfig (it is supposed to happen automatically). If you did not use apt, check your library search path.

10y agoHN ↗

Afaik NeoVim attempts to stay compatible with existing vim addons.

10y agoHN ↗

Neovim is one huge undertaking. So far they did wonders. Along libreoffice it's one of my favorite projects in spirit.

10y agoHN ↗

Reposting an answer from a related thread.

The main difference is that vis is written from scratch while neovim inherited an old and hard to maintain code base. This allows vis to experiment with various ideas:

- native multiple cursors/selection support

- structural regular expression support

- different core data structure resulting in efficient large file support

- LPeg based syntax highlighting

- Lua as an in process extension language

- client/server design (not yet implemented)

without having to care about backward compatibility and legacy systems. Of course this has also some drawbacks for example there is no existing plugin ecosystem etc

10y agoHN ↗

Great! I remember last time I looked at Vis it wasn't so far along (it had no Lua integration AFAIK).

When I started submitting code to Neovim my biggest desires for it were (1) Lua extensibility (2) A clean codebase (3) Compatibility with (most) Vim plugins.

Perhaps ZyX-l's Vim to Lua project (for Neovim) could help with (3) at some point, if that's desired.

An LPeg based syntax highlighting was also something in the back of my mind, though way down the priority list. Fantastic to see it implemented, it truly is the right choice (Neovim uses Corsix's C99 LPeg parser for its testing framework, automatically exposing headers in a way LuaJIT's FFI groks).

Does it build with LuaJIT? (Sorry for the perhaps stupid question, I've just glanced at your comments here and the terminal "video".

Keep up the good work.

10y agoHN ↗

Does this kind of PEG parser deal somewhat decently with partial or incorrect syntax trees?

10y agoHN ↗

The parser will match the specified grammar exactly, like it should. You could of course specify a grammar that is broader than the actual language you are parsing.

10y agoHN ↗

Well, I am vaguely aware of the existence of "incremental parsers" and "tolerant parsers", and a code editor necessarily works on code that's only partially correct...

10y agoHN ↗

Does it build with LuaJIT?

I'm not sure. I think a few Lua >= 5.2 dependencies have crept in, but it shouldn't be difficult to fix this if desired.

LuaJIT's FFI is indeed very nice, but it is unfortunate that Lua has essentially been forked after the 5.1 release. The current C->Lua interface has been manually written.

10y agoHN ↗

evil-mode lets you do things like "insert this text into the same position in a block of consecutive lines" using rectangular selections. I find it occasionally very helpful. It's a little clunky though: you make the selection, press I, edit the first line, press esc, and then the other lines get edited the same way. (I'm not sure what "the same way" means if you delete a bunch of text or move the cursor around while editing.)

I haven't used multiple cursors, but I imagine they'd let you do that, but with the other lines getting updated in real time, and without requiring the insert points to be neatly aligned.

Maybe other stuff too.

10y agoHN ↗

This looks nice! Will keep and eye on it, give it a shot for few weeks when I finish with faculty.

10y agoHN ↗

Yes from a design philosophy standpoint vis is closer to kakoune than {neo,}vim. The implementation is quite different though (no C++, no boost, no home grown scripting/extension/syntax highlighting language).

10y agoHN ↗

I don't use either, but to be fair, I wouldn't call vis's requirements lighter than kakoune. Vis needs Lua and libtermkey (which according to its author is EOL'ed) at build and run time.

10y agoHN ↗

Kakoune is a fine editor.

Regarding vis, Lua is optional (you lose syntax highlighting though). libtermkey is a 3 file library and despite what the author claims it works, is useful and could be maintained in the vis repository if necessary.

If you think anything C++ related is lighter than something C based, then we just have to agree to disagree.

10y agoHN ↗

Dunno about libtermkey but I wouldn't worry too much about the Lua dependency. Lua is very portable and lightweight and the entire Lua interpreter and standard library are just a couple hundred kbs. You always have the option of linking them statically if you really need to.

10y agoHN ↗

Looks very good.

Definitely going to give it a try. Currently I'm using Neovim and I like a lot the embedded terminal feature. I wonder how easily this can be recreated using a Lua plugin.

10y agoHN ↗

I wonder how easily this can be recreated using a Lua plugin.

It's probably a better idea to use tmux/screen/dtvm for terminals rather than embedding a terminal in a minimal editor.

The TODO list mentions asynchronous event loops, that's necessary to do any plugins with external processes neatly.

10y agoHN ↗

Well. Having a terminal as a buffer makes it possible to copy/paste into/from the terminal.

Also autocomplete from all the buffers is working. It's really convenient.

And implementing a repl integration is trivial.

10y agoHN ↗

You can also make a command that inserts a file into the current tmux buffer, which is technically a much more straightforward solution than reimplementing terminal emulation, I think.

10y agoHN ↗

Fair enough. Though, I've tried vim/neovim inside a tmux session, and the terminal in neovim. And I find the latter(my personal opinion) to be more fluent to use.

There's only one .nvimrc to manage as opposed to also, tmux's file. Also, when I was using it, tmux it didn't support 24bit colors.

Again, that's a trade off, for the maintainer of the editor, it makes sense to make it as simple as possible. But this means that the user of the app will have to manage a part of the complexity, of setting up and maintaining a tmux instance.

About terminal integration, I think neovim does it by embedding libvterm, which takes care of handling the terminal part. This might be an oversimplification though.

10y agoHN ↗

There's only one .nvimrc to manage as opposed to also, tmux's file.

Yes, this is definitely a trade-off.

I tend to have a global .vimrc and .tmux.conf with some sensible default settings and on top of that, I do ad-hoc per project config files that have keybindings and other definitions unique to the project configuration. E.g. run a certain test suite with a keypress.

The neat part in this is composability. The editor is just a component that you embed in your tmux. You might have other "components", such as a debugger or REPL or a file browser (ranger/midnight commander) in there too. This doesn't work as nicely if the "top level" is a text editor.

I'm really fond of building these per-project ad-hoc "IDEs" out of terminal and editor windows because I work with a really diverse set of languages and tools and no single IDE or editor plugin suite would cover all my use cases without hurting the others.

10y agoHN ↗

There exist plans to use a client/server architecture, delegating window management to your windowing system or favorite terminal multiplexer.

This is from Vis's Github page. It looks like Vis's author thinks the same way as you. And I get it, it's the Unix philosophy. Though the embedded terminal is the single biggest feature I chose Neovim, over Vim. And that's just my opinion.

Will give it a try though, to Vis, and some terminal multiplexer. See if I can make it work.

10y agoHN ↗

Excellent. The more vim the better. I would like to see many of the core vim patterns replicated in other editors:

  - modal over chords
  - text objects
  - the vim "language" which ties it together
  - all the other good stuff, did I mention text objects ?

There is a reason vim has more users today then ever before: once you learn the deceptively simple language you can have deep conversations with your editor.

10y agoHN ↗

I am very glad that most IDEs have either native or plugin based vim-modes.

10y agoHN ↗

I actually like the fact that NeoVim is working on VimL to Lua translation so you can write plugins in Lua. Emacs has had LISP from the beginning. Maybe we can soon fight back with a real programming language.

10y agoHN ↗

The vim language would be better if it wasn't full of exceptions that have no reason for existing (e.g. `Y` is `yy` rather than `y$`, or `cw` and `ce` being equivalent while `dw` and `de` perform different actions).

10y agoHN ↗

What would be the advantage of using it over vim? I am just curious. One thing I found is huge file support that would be definitely good but not sure about the rest.

10y agoHN ↗

The promise is that given it's a new, modern codebase, it could quickly outpace vim in capabilities and usability. Vim's legacy is what is holding the editor back from major improvements.

10y agoHN ↗

So, the better question would be what advantages there are over Neovim :), but it has already been answered in another post.

10y agoHN ↗

It sounds like you are saying it is better just because it is being written from scratch. I don't plan on contributing or writing any plugins to Vis (or vim) so I don't really care about what the 'guts' of the project look like as long as it does what I use it for (text editing). What motivation would I have to install Vis and deal with the mental overhead of switching (I am sincerely asking)? I have the same concerns with NeoVim. Maybe I just need to wait a decade for the ecosystem to catch up.

10y agoHN ↗

Yes. I would absolutely not advise to switch over at this point in time, unless you want to support the project. In its current state, I suspect it will be a poorer experience than vim and neovim.

10y agoHN ↗

What are the major improvements that cannot be added to Vim due to its legacy codebase? Honest question from a longtime vimmer.

10y agoHN ↗

One thing that comes to mind is that vim doesn't support multithreading very well or at all, when it comes to plugins. This is one of the issues Neovim is tackling.

10y agoHN ↗

I noticed similar problems with medium.com links where the stuff after the inserted hashtag leads to multple submissions of the same link.

10y agoHN ↗

Not in this case. It's the exact same url

10y agoHN ↗

"similar problems with medium.com links where the stuff after the inserted hashtag"

I always strip anything after the hash, checking the link still works. Medium adds this info, in my opinion, for tracking.

10y agoHN ↗

One of these days, I'm going to sit down and try out this, emacs-evil, and neovim. Side-by-side. Need to figure out which one I like most.

10y agoHN ↗

I feel you. I want to like neovim, I really do. Same thing with this. I even want to just use emacs+evil. But since I've picked up spacemacs (~3 months ago) I can't really use anything else. I'm already pretty hooked on orgmode, and the consistent keybindings that spacemacs provides are wonderful.

10y agoHN ↗

I just switched from vim to neovim to evil. I can't see myself ever going back. (Neovim was basically just vim with async support, and terminals, but as a tmux user, that didn't really grab my attention).

There's a lot more polish in the integrations for emacs than vim, likely as a result of literally everything in the editor being a function call that can be hooked into.

The only thing I miss is solid tab functionality (there's a short of hack I've seen so far, but feels too rough for me). But honestly, with projectile + heap, I barely miss that.

Company-mode far outpaces the auto completion options in vim (though to be fair to the plugin authors, apparently they need to resort to major hacks to perform some of the things they do). Just as an example, when you autocomplete a function call, it populates the arguments and let's you tab through completing them. This same functionality sits as open tickets in the major vim autocomplete plugins, with a response of essentially "this is really hard to do in vim, hopefully we can figure something out in neovim".

It's worth the 2-3 days to make the switch and set yourself up. Also, a recommendation -- autostart emacs in server mode and use enacsclient to connect to that for all your editing needs.

10y agoHN ↗

Damn, thanks for the detailed comment. Pretty inspiring. I'm going to see whether I can switch over this weekend.

10y agoHN ↗

What's wrong with buffers? (Not attacking, just genuinely curious)

Like you, I loved my vim tabs. But "state" is what changed my mind.

In a few keystrokes, sure I could switch tabs. Right, right, right, right, there that's the tab I want. But it's coupled to my project state: if I close a tab, there goes the muscle memory for that session. Now it's "right-right" to get to the thing I need instead of "right-right-right".

Buffers are invariant to your session state. In a few keystrokes, I could just search for the buffer by the first few letters of its filename.

I routinely keep >500 buffers open in emacs. Ten projects, half a year of journal entries, a few dozen mail messages. Having all those things available in the same number of keystrokes no matter where I am is immensely helpful.

It's like Huffman coding for your workspace.

10y agoHN ↗

I tried out evil some time ago, and while it was very nice, it glitched out regularly - I would (mis)type a key combination and suddenly I'm dropped to Emacs and feel completely lost. Has this happened to you?

On a side note, one of those days I'll just have to drop everything for 2 weeks and just learn Emacs.

10y agoHN ↗

More people should definitely try out sam and 9term as examples of how much code/features you don't really need and can still get real work done.

Personally, I wish sam had even less complexity and features than it currently does and thus be more understandable and hackable. Also, never going back to a normal terminal again, "dumb" terminals are awesome.

And actually, this experience has lead to a philosophy of software where I think the "dumb"er a piece of software the better and more reliable/performant it is likely to be. So I'm also hugely skeptical of the current Deep AI efforts leading to anywhere good.

10y agoHN ↗

As much as I love visualizing my code with Intellij, the thing is huge and clunky.

Nothing beats the simplicity of Sublime and the good'ol Terminal.

10y agoHN ↗

Unless it's vim and the good ol' terminal. :-D

10y agoHN ↗

Quite a few IDE's have the inherent flaw of being super bloated.

10y agoHN ↗

One of many reasons I prefer to build using Sublime as opposed to a big IDE.

10y agoHN ↗

There are some "political" aspects too, in that AI and VR aim for maximal resource consumption—the more power, the cooler.

10y agoHN ↗

9term/Unix is still not as lean as something you'd get with a more integrated environment like Oberon or Lisp. Just think of the many ways of parsing arguments and input. Ad-hoc languages wherever you look.

10y agoHN ↗

Exactly. When you want to exchange data, it's much preferable to have typed/tagged representations. If not that, then one should strive to at least avoid regex "parsing" everything. The exception is that plumbing is okay because it integrates output from all kinds of programs that already exist, but if you have control, it's a lot better to have short prefixes like, say, bug:BUG123, git:COMMITID, pkg:DISTROPACKAGE, etc. But these short prefixes miss namespacing. Anyway, this is only true for acme and friends and in Oberon elements are rich and not plain text.

10y agoHN ↗

Yeah, every programmer at one point has to make her own argument parsing library. Nope, there is no one syntax that fits all use cases.

While there are thousands of ways programs can parse arguments (and that's great!) there is only one argument passing mechanism in Unix (plus environment variables for implicit static things and file descriptors for streams).

Unix doesn't care how you parse your arguments, and that's why it is lean, and why it has been successful as a development platform.

Donald Knuth: "I define UNIX as 30 definitions of regular expressions living under one roof."

10y agoHN ↗

Just jumping off your last sentence: "Simplicity" and "Transparency" are orthogonal.

In the case of deep learning, all current state-of-the-art models can be expressed as nothing more than matrix multiplication, addition, and clipping. That's all you need. It's so simple: multiply, add, clip. Multiply, add, clip.

But the model isn't transparent. It's clear what each step is doing (multiply! add! clip!), but it's not clear to the human why that's necessary.

10y agoHN ↗

I agree there are a lot of interesting ideas in 9term/sam/acme and Oberon (which was the initial inspiration for the project). In the future I would like to experiment with integrating a few more, but unfortunately time is a limiting factor.

10y agoHN ↗

Yeah. I've been using Acme for awhile now. While Acme itself is nice, what I really like is the B/E editor embedded in it. It's just a very simple editor that can be extended with _external_ programs.

Finally, I've come to appreciate using a mouse with my editor. Until I completely got rid of using most keyboard shortcuts (other than the most basic ones), I didn't realize how much cognitive taxes I was paying to retain and context-switch among different families of keyboard shortcuts. Mousing is so much more uniform.

10y agoHN ↗

They are the utility scripts to start an editor window in Acme. B is async whereas E is sync (so that it can be used for the EDITOR env variable for software like git).

Not sure what they stand for for sure. E is probably editor. B might be buffer?

10y agoHN ↗

What?? I've gone the opposite direction on mousing.

10y agoHN ↗

A great trivia bit about Sam is that it's the first full screen editor Ken Thompson switched too, and he still uses it today[1]. Ken Thomspon wrote ed (in addition to being the primary original author of Unix).

[1]: http://m.slashdot.org/story/50858

10y agoHN ↗

I've never tried sam, but I used to do all my unix coding in nano, because it was simple enough that I never had to think about how to use it. I prefer simpler tools, generally, since I don't want to think about the tool; I want to think about the work I'm doing with the tool. People do amazing things with emacs, and to a lesser degree also with vi, but I simply don't want to spend the time it would take to learn such a complicated interface when I clearly don't need such a powerful tool to get my job done.

I eventually wrote my own editor, which is effectively just a text-mode window manager wrapped around a simplified nano clone which uses the control key bindings I'm familiar with from non-terminal environments. I'd be reluctant to recommend it to anyone else, since it's such a specific implementation of my own personal taste, and it has a handful of minor problems I've never bothered to fix that might cause someone else significant irritation; but it suits me. It's a very comfortable feeling to know all that can be known about the tool; I never have to waste a moment trying to remember how any of it works, and can direct my full attention through the tool to the work I'm actually trying to do.

10y agoHN ↗

I note that with the exception of the sam code (which unfortunately uses the Lucent Public License Version 1.02, this editor is very liberally licensed (ISC/MIT/CC0).

If the sam code is optional or easily replaced, this could evolve to become a serious, modern text editor with a truly liberal license (something surprisingly absent from the current landscape, to the best of my knowledge - I've done a couple searches for an editor that could be embedded with an LGPL project, and the choices were pretty limited. This looks quite interesting.

From a portability standpoint, is there any chance of creating a native Windows version using something like http://www.projectpluto.com/win32a.htm ? That was another kicker when I was searching previously - only the really big editors like vim/emacs appear to have Windows ports...

10y agoHN ↗

For a standalone piece of software, what about licensing matters for your use cases?

10y agoHN ↗

It's right there in his comment:

I've done a couple searches for an editor that could be embedded with an LGPL project, and the choices were pretty limited.

10y agoHN ↗

Close, but it doesn't appear to be active (the version you get from the download link is from 1996?) and it's using the 4 clause BSD license, which (as I understand it) poses GPL compatibility problems.

10y agoHN ↗

A good point. I didn't specify in my initial comment (and I should have) but one of our other criteria is to be able to build everything with just a C/C++ compiler. So we'd have to bundle/bootstrap Go just to build the editor, which I believe is too heavy to be practical for that (unfortunately).

10y agoHN ↗

Kudos to the developers for listing non goals. Too many software projects lose focus and become bloated because they take on features that are secondary to the main purpose. Projects may refrain from listing non goals for fear of excluding people who may want some of those features.

And looking at the list, there are some pretty nice features excluded. For example network support, or editing compressed or tar files. I guess the expectation is that these can still be accomplished by leveraging commands outside the editor. This is a clean approach.

Okay, but no diff mode? vimdiff is fantastic! And I'm not sure how you recover that functionality without multiple workspaces. Maybe the answer is you don't. Use vis for normal editing and pull out vimdiff only when you need it.

10y agoHN ↗

concerning vimdiff: one of the goal is to get vis to also work in server mode and be embeddable. it should then be possible to create a diff tool that uses vis for the editing.

10y agoHN ↗

That sounds fantastic.

Very often I find myself editing outside of vim and wishing vim style editing were there. Recreating optional vim key bindings for every app that has text is clearly not realistic. Getting as many things inside of vim as possible is just tantalizing enough that a lot of people (myself included) try it. It's better than nothing, but results in some very hacked together tools.

Embedding vim (or in this case, vis) inside of other things would be a much better solution.

10y agoHN ↗

So instead of the vim philosophy of embedding every functionality within vim, this potentially embeds vis in every functionality? I actually like that--much more composable.

10y agoHN ↗

I believe (and I may be wrong) that the vim philosophy is actually to embed vim in things rather than embed things in vim. They've just lost track of that a little over time.

See also :help design-not: 'Vim is not a shell or an Operating System. You will not be able to run a shell inside Vim or use it to control a debugger. This should work the other way around: Use Vim as a component from a shell or in an IDE. A satirical way to say this: "Unlike Emacs, Vim does not attempt to include everything but the kitchen sink, but some people say that you can clean one with it. ;-)"'

10y agoHN ↗

You're right, and I sold vim a little short there, compared to something like emacs.

More accurately, I meant that when someone wants to combine vim with a functionality they tend to implement it as a plugin with vim as the host and interface. I won't speak for anyone else, but my vimrc tends to accumulate a lot of behavior such that it's still a kitchen sink--it just wasn't included with the initial distro.

10y agoHN ↗

The great thing about vim is that it'll always be there as a fallback.

I keep a file with my passwords, encrypted with Vim's builtin encryption. Neovim removed that feature. If I ever switch to neovim, I can still use vim when I need to open that file.

10y agoHN ↗

Maybe it's even better if you migrate your password file to a credible implementer of crypto. Like gpg.

10y agoHN ↗

Or, perhaps a password manager like 1password.

10y agoHN ↗

TIL that Vim supports encryption out of the box. Thanks :)

10y agoHN ↗

For a non-vim user - can you describe what vimdiff is please?

10y agoHN ↗

vimdiff is a mode within vim to compare differences between buffers. It allows side-by-side comparisons like modern GUI diff tools by showing buffers in different 'windows' (vim screen splitting). You could also open multiple window in this mode to make vimdiff behave like a 3-way merge tool. It also has commands to pick hunks from different buffers into the merge buffer.

10y agoHN ↗

Why is this better than neovim? How many modern "vi"s do we need?

10y agoHN ↗

This seemed interesting and I'm glad they posted their "Non goals". For me, and I would assume many others, plugins (which apparently is part of the 20% they don't plan to support) is one of the most critical features to any good text editor. This is one area where I think they may want to reconsider.

10y agoHN ↗

I imagine this would be a non-starter for a lot of people, it definitely is for me

10y agoHN ↗

"Plugins" can mean many things, ranging from dynamically loading parts of the app to having an embedded scripting language.

I'm fine with a text editor without plugins as long as the editor can neatly interface with external applications. I used to use some Vim plugins but I found them to be more trouble than they're worth. Now I have vanilla Vim with only some syntax highlighting additions.

Rather than embedding my workflows into the editor, I'd like to embed the editor in my workflows. I don't want to run terminal apps from inside the editor, but I do want to run external apps and get the results in the editor. E.g. Vim has :make and :grep that work with the quickfix list, but this can also be done by invoking make or grep in the shell and piping the output to vim (+ some command line options to read the quickfix from stdin).

For my use, the feature that Vis needs the most is the client-server model, so I can use tmux to manage windows and open editor windows in any terminal session. That, coupled with some helpers to run external apps should do more than 80% of what I'd use editor plugins for.

10y agoHN ↗

I was gonna complain about the lack of binaries, which will instantly make me skip your project, until I saw this:

On Linux based systems make standalone will attempt to download, compile and install all of the above dependencies into a subfolder inorder to build a self contained statically linked binary.

You'll still need the entire compiler toolchain, and 'libtool' on Ubuntu. I got as far as the ncursesw dependency before I gave up.

10y agoHN ↗

Yes the lack of binary packages is a known problem.

The whole project is still somewhat in flux, feel free to contribute by filling a packaging request to your favorite distribution ...

Historically it originates from a community which is comfortable building from source.

10y agoHN ↗

Probably I am wrong but there seems to be no folding support?

10y agoHN ↗

I'd like to suggest trying integrating the syntax highlighter from JOE for speed, but JOE is GPL...

Also, I'm not sure how large the Lua/LPeg state is, but for JOE we found the highlighter is more accurate if you retain the state of each line (or every n lines), and start parsing from a real known state. It looks like Vis starts parsing 16K before the start of the window.

https://sourceforge.net/p/joe-editor/mercurial/ci/default/tr...

10y agoHN ↗

Thanks for writing the JOE editor. I've been using it for simple text editing tasks (commit messages, etc.) now that I've moved over to a Linux system. I appreciate its simplicity.

10y agoHN ↗

I shall add to your thanks. Joe's the first thing I install on any new box or server and has been my default "quickly edit this thing" editor for a decade and a half now.

Thanks, Joe author!

10y agoHN ↗

Thanks for the hacking file, it is a good read for people like myself who are interested in text editor implementations. If time permits I will try delve a bit into the joe code base.

As for the syntax highlighting in vis, yes it currently is stateless and only considers a fixed range of text prior to the start of the window. Having no state at all simplifies some things and allows vis to highlight even extremely large files at the expense of the occasional glitch. In practice it seems to work reasonably well.

This approach also requires that the highlighting is fast, because nothing is cached, it is completely redone after every cursor motion. I'm quite happy with LPeg so far, it is convenient to express grammars in a high level language like Lua. It also supports nested grammars nicely, but due to the completely stateless approach taken by vis this is currently not fully exploited. As an added bonus there were already ~100 lexers (of admittedly varying quality) available for use.

10y agoHN ↗

Every good programmer should write their own text editor, I think, much as each Jedi must build their own light saber. It's the tool that a programmer will spend a disproportionate amount of their time using, and they should know it well. And it's fun to do, and easy (c. 7KLOC or so for mine).

10y agoHN ↗

from https://github.com/martanne/vis/issues/140 it seems like vis doesn't yet support language-specific autoindentation. this is a must-have feature for me; i'm surprised it wasn't more of a priority for them given that this seems to be targeting programmers.

10y agoHN ↗

Tabs should not be a "non goal" if you support window splitting.