I will make a random comparison to latex vs typst (typesetting software). Both incorporate a programming environment, you can write a program right in your document. The difference is that the tex programming environment is a bit unapproachable and not very similar to other languages you may already know, while typst's equivalent is consistent and more similar to languages you know.
Am I the only one who absolutely hates Lua? Its syntax, the fact that variables are global by default unless you local them, `foo = nil` isn't variable assignment but instead variable unassignment!, etc.
There are far better scripting languages than Lua.
But everyone agrees the programming experience in the language is awful.
[1] My son just got into RC planes, so of course I found myself looking at ExpressLRS radios and pulling EdgeTX from GitHub. It's an otherwise straightforward ESP32 board, and there in the app... yup, Lua everywhere.
Simply not true. The power to weight ratio of Lua is amazing. You can keep the entire language in your head easily, and even without LuaJIT it’s crazy fast. It’s great for creating DSLs. As a configuration language it is excellent- in fact that’s how Lua originally came to exist.
I stand by what I said. Lua sucks for coding. The only people who like it are ones who haven't mastered one of the "real" environments.
But it's still ten times better than Vimscript.
I'm convinced that the reason it's so good is because Lua is simply a better language than VimScript, making it easier to make plugins.
Most editors choke at couple MB, Vis can open 10 Gigabyte text files with zero delay.
Is the "Controlled Neovim Terminal" supposed to be some bot you are competing with? At first it confused me. Personally I think the first contact with the game would be much more intuitive without it (it can always be introduced later, e.g. if you plan competitions with other humans on randomly generated levels).
There are only two levels now, right? As I equaled both top scores (possibly optimal?)... when more? ;)
I love my Jetbrains IDEs, but you can take my Vim plugin from my cold dead hands :)
And yes, you can also take my VIM plugin (for Visual Studio) from my cold dead hands.
My latest experience with Vim was helping a friend fixing some import with a React Native project. A quick grep on one terminal (I could have used quickfix) and using the vim fzf plugin to quickly locate the file. VS Code could have done this but the context switching and UI clutter is not great there.
As for emacs, the main advantages lies in the fact that so many great tools already exist there. Things like Occur, Shell Mode and Compilation Mode (relying on Comint, a more general feature for anything REPL), Project, Eglot, and Magit.
Typescript dev ex in neovim is light years ahead of what I achieved in Emacs. Neovim’s lsp integration is better than Emacs imo. Blink.cmp is so fast.
Magit is definitely far superior to anything in neovim though and so is org mode.
But the goals with emacs is to be a complete platform for anything plain text (with a bit of extra widgets). Almost whatever you need the terminal for can be replicated there, and they will share some common convention. Mail, file manager, music players, feed readers, PKM, PIM,… Tect editing is not so great, but text actions are (Slime is the best example).
I use both, but I prefer emacs’ extensibility.
I used Emacs with evil mode for years until switching to neovim last year. It was really great.
First thing I install on any IDE/Editor.
It's interesting how this design was forced into existence by the extremely limited hardware at the time:
TFA>> It was really hard to do because you've got to remember that I was trying to make it usable over a 300 baud modem. That's also the reason you have all these funny commands. It just barely worked to use a screen editor over a modem.
That's why we got commands like d), d{, D, etc. Trying to achieve the goal in one go, without any intermediate redraws.
Having your concentration broken when you're trying to solve a tricky problem can be a huge productivity drain. So in the end, an editor which may only save a keystroke here and there on average can end up being very productive for some people.
But if the 1980s UI Scientists came back with their stopwatches, I don't think the median vi-mode user would "win". Unless they were using a really slow terminal. (obv, we probably have some 1%ers on HN)
I know that I, personally, would not have been able to take some of the notes I took in university if it weren’t for vim and its affordances. Trying to keep up with a fast-writing math professor while typing a complete set of notes in LaTeX would not have been possible otherwise!
> d), d{
That's not two different commands, it's one action (delete) and two different motions (forwards one sentence, backwards one paragraph). Motions work on their own for moving the cursor, but can be combined with different actions and repetitions to multiply the sentences (commands) you can make. As you increase your vocabulary over time (there are a lot of motions and selectors (which are slightly different but used similarly)) you can keep reducing that friction between thought and screen.
As someone down below mentioned, programming is not as much editing text as it is massaging the underlying AST. Proper IDEs (not VSCode) in a hands of a power user who knows what his "hammer" can do (and how to invoke the necessary behaviour) are much more efficient at it compared to any text editor.
That's assuming you're spending all day editing files written in the language(s) supported by your IDE. That assumes a great deal about your programming environment, toolchain, plugins, and configuration. Switch to a different language with different syntax, different idiomatic style, different IDE plugins, and you may be faced with a totally different editing paradigm.
This is where vi shines: the tool is excellent at editing text and is therefore 100% language-agnostic. It can easily handle jumping between files written in different languages, including plaintext files, configuration files, domain-specific language files, and otherwise many other files with syntax that may not be supported by your favourite IDE. Furthermore, it is equally happy working on files that combine different sections written in different languages. Sure, some other editors (such as emacs) and IDEs (such as RStudio) also support this sort of editing, but vi doesn't need any special support for it.
This philosophy, of making text the first-class citizen, in many ways mirrors the Unix philosophy. It also happens to be the case that vi (as well as its ex command line) provides a very convenient command for piping lines, paragraphs, and any other motion you desire through a shell command (or pipeline) of your choosing. This makes it very easy to format text using commands such as `fmt` or `column`, or apply line-numbers using `nl`. This, I believe, makes vi the ideal text editor for developers working on Unix or Linux software.
Now I'm a webdev with everything written in typescript and just use Cursor (basically vscode) with the vim plugin. i miss the tab model from vim a lot, but apart from that the vim plugin is close enough.
Then why does your IDE not look like Scratch?
It is because nobody has found a better representation then text when it comes to editing concrete syntax trees.
Yes, you will rarely reach for d) or d} when editing Java or JavaScript. But the Vi paradigm does not stop at prose. And it does not stop at modern IDE capabilities either.
The Vi paradigm just enables people to do it faster. With less friction.
It was about minimizing the number of redraws, but this indirectly might have led to fewer keystrokes too.
As you mention later in your comment, there are a lot of motions (which could be combined with deletion too). This is probably related to performance too, because they make it possible to achieve something quite specific like c3), with only a single redraw, and three keystrokes.
The "language" is undoubtedly a very good choice on part of Bill Joy. It wasn't necessitated by the hardware constraints, I believe. The separate modes neither. It's just that he would have wound up with less ergonomic key mappings.
Without the modes we would have to suffer using chorded shortcuts with modifiers, but they could still form a language. Think "M-3 C-d C-)" instead of d3).
Without neither modes nor composition (the "language"), it would have been even worse. A large number of single-purpose shortcuts, likely with multiple modifiers; he would have run out of (memorizable) single modifier combinations.
I imagine Vim is only just a local optima too. There are newer editors [0] that are more AST aware that I haven’t been able to fairly evaluate yet (not in the boring corp approved software list).
With Neovim, you get the best of both worlds: it's Vim with AST support via Treesitter and LSP support baked in.
I would like to select first have a visual feedback of what I selected before taking action on it . Helix and kakuone have got this right .
I often find myself going to visual mode to emulate this.
Personally, I tend to use action-selection for small changes (1 to 3 objects), and selection-action for larger ones (as my brain, I've learned, becomes slower at counting above 3). So "delete 2 words" will be "2dw", but to delete the next 5 words I'll reach out for "v".
It's just an extra key press. And you can choose which visual mode you'd like!
After a very short transitioning period (a week or so), I don't have this issue anymore (at all). Keeping coming back to visual mode is probably counterproductive for your transition. So maybe you should stop doing this for some time. Then you'll hopefully find yourself using the visual mode rarely.
This is 1/2 of explaining why vi family is the GOAT. The remaining explanation is that vi family is the only text editor which is able to be used completely without looking at the keyboard or touching the mouse even once. You can not achieve this if you have to use accord commands which are typically binded to what is selected by mouse. No vim-less text editor can ever provide one-click analog of o command (make a new line under the cursor from wherever column the cursor is at the moment of clicking).
It's unbeatable when editing files on a remote server in a hurry and from random places that may or may not have good latency and/or bandwidth.
Can we learn that if you design something for a constrained environment, it will shine when the limitation is lifted?
For instance you don't want to code in assembly Facebook's backend. Blender would also be a completely different program if it was primarily optimized for the 68000. You usually will want different tradeoffs and architectural choices when the target platform drastically changes.
That doesn’t mean it’s actually the fastest tool for the real job. Programming is not text editing
The fact that these tools have stood the extreme test of time is really something.
Another person in the lab came over, invited me to his machine and showed me LaTeX in Emacs. We became friends (he a mathematician, I a zoologist). I bought beer; he brought 'computer wisdom'. Thirty-odd years later, those files are still perfectly reproducible. All of my kid's school reports from elementary onwards... LaTeX.
It's hard to overstress how important is longevity in a toolset.
Side rant on Emacs' keybinds: with orderless and vertico (and marginalia and whichkey) it is almost as fast for me to `M-x dir` as to `C-x d`, and in both cases I get a dired buffer. Aaand, `dired` is magic. History also tells me that it is older than Emacs.
\end{rant}
The main divergence of note is tab expansion.
[0] https://edoras.sdsu.edu/doc/BerkeleyDB/ref/am_conf/logrec.ht...
https://archive.org/details/ADM-3A-User-Reference-Manual-Apr...
(This page, and Figure 1-3 below).
Huh?
While I suppose that one "could" pay for Emacs, the vast majority of users never have.
Then again, I've only been using Emacs for 45 years, so I'm a newbie. (Yes, I started with the Teco implementation.)
> Joy also claims that most of vi's popularity came from the fact that it was readily available and bundled with BSD, while other editors, like Emacs, could cost hundreds of dollars.
Joy was referring to the late 1970s early 80s here and in the context of making VI available when he created BSD and published it for free. Unix operating systems were not freely available outside academia back then.
Of course, TECO is the explicit ancestor of emacs, as emacs was originally implemented as TECO macros. However, I can't find a paper trail giving similar credit to TECO for vi. That said, istuff<esc> is the same in TECO as it is in vi and TECO (1963) well predated vi (1976). RSTS (along with TECO) was used at Berkeley in 1974 before v6 Unix was installed by Ken Thompson on a sabbatical to his alma mater in 1975. Bill Joy started as a grad student at Berkeley that same year. emacs (1976) wasn't ported to Unix until the 80s.
There's no hard evidence and neither Ken Thompson nor Joy has ever mentioned TECO. So I'm probably wrong.
But I still consider TECO to be the ur editor.
Glass TTY terminals were very new in the early 70's. TECO was primarily written to the "Knight TV" system, which was a fancy MMIO framebuffer array hooked up to a PDP-10 that would multiplex a bunch of displays and keyboards. There really was no "terminal" device per se, it was all software. There were other such devices (the MIT one was actually inspired by a similar system at Stanford), but nothing compatible enough to target an editor.
So basically if you were at MIT you'd understand TECO as the pinnacle of editting . But no one else could use it.
By the time Joy started writing vi, the idea of a "terminal" being a serial-connected device speaking a byte protocol with a handful of reasonable operations (position cursor, clear screen, etc...) had solidified. So a portable editor that would work with multiple devices was feasible. Emacs wouldn't get that for a few years yet.
The quick brown fox jumped over the lazy.
The cursor would start before the T. 4C would position the cursor before the q. The 6D would delete quick . Then <esc><esc> would execute the command buffer.These fingers of mine learned TECO before they learned vi and then found vi easier to learn as a result. Besides the basic editing syntax, it was a programmable editor, hence the TECO emacs macros.
Funny thing is that as fondly as I remember TECO, I've tried emacs a few times and have always worked my way back to vi/vim. I particularly like neovim now. I like using ex/command mode for doing bulk editing. Of course you can do the same thing in emacs but I've gotten used to it in vi. I remember programming TECO but I don't remember ever doing programmed editing.
A couple years later, ADM-3A's arrived. And so did a TECO macro that turned TECO into a screen editor! Oh, what joy!
Isn't it a amazing that a macro could turn a line editor into a screen editor?
I also used TECO on my H-11 PDP-11 computer.
[4 [5 [6 [7 [8 [9 +0U7 0,0X4 10U4 [4 ETU4 [4 EDU4 [4 EUU4 [4
^D ET&(128#64#32#1^_)#512#16#8#2ET ED"G 0ED '
@^U5/U9 ET#1ET 27^T Q9^T ET&(1^_)ET/
@^U6/.U8 ZU4 -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' G4 ^Y-2X8 ^YK @O!S! '
Q7-^^."E 0U6 !S! Q5:@S%^EQ8%^[ Q6"N Q6^W ' @O!A! '
@O!A!
'
Q7"D 0U5 < Q5*10+Q7-^^0U5 ^TU7 Q7"D > ' @O!V! '
0U8
Q7-^^A"E -1U8 '
Q7-^^B"E 1U8 '
Q8"N Q5*Q8U5 Q6"E 0U7 .U8 0L
Q8-.%6< 0A-32"L 0A-27"N 0A-9"E 6-(Q7&7)%6^[ -2U7 ' %7 1%6 ' ' C %7 > '
Q5L -Q6U9 0U7 Q6< .-Z; 0A-32"L 0A-13"E 0; '
0A-27"N 0A-9"E 6-(Q7&7)%9^[ -2U7 ' %7 1%9 ' ' C %7 1%9"G R ' Q9; >
0U4 @O!B! '
Q7-^^Q"E @^U4%Command: % M6"F @O!A! ' G4 ^YX9 ^YK @O!C! '
Q7-27"E 0U6 !C! ]4 Q4EU ]4 Q4ED ]4 Q4ET ]4 Q4-10"N ^O ' M9
10U4 [4 ETU4 [4 EDU4 [4 EUU4 [4
^D ET&(128#64#32#1^_)#512#16#8#2ET ED"G 0ED ' -1EU
Q6"N Q6^W ' @O!A! '
Q7-^^R"E G7 @O!A! '
Q7-^^P"E Q4"E .+1U4 ' Q5L Q4-1,.X7 Q4-1,.K G7 0U6 @O!B! '
>
ET#16ET ^^>M5 ^^YM5 23+32^T 0+32^T ^^KM5 13^T
!Z! ]4 Q4EU ]4 Q4ED ]4 Q4ET ]4 Q4-10"N ^O ' ]9 ]8 ]7 ]6 ]5 ]4
Obviously, the TECO programming language was a challenge to understand. Mitigating this is it needed to be extremely compact, as it was used on a 64Kb PDP-11.I'm not sure if that was true.
I vaguely recall it had a line-open / visual mode, like ex/vi, which we didn't use because we were on a dot-matrix line printer / teletype. The ADM-3A had the Ctrl key on the home line; this design made it easy for editors from that period (vi, emacs) to make heavy use of Ctrl.
Thanks to those who posted bits of TECO - I'd forgotten how the character movement was similar to vi. A fellow student in our CS honours year had a semester thesis project analysing the grammar of vi commands and specifying it in a formal grammar. The combination of action x movement is powerful, simple and concise.
Although I had a terminal which could run TECO full screen, I found that too slow and just used it in line mode. You could conveniently reprint surrounding lines by adding a few characters to the end of a commmand (I still have HT <ESC> <ESC> burned into my brain.) The VT52 macro had you typing commands into line 24 like an emacs minibuffer.
I never used it for all my editing, but it excelled at certain things.
The version of TECO we had was the one which shipped with VMS. At some point later on, I think, DEC stopped shipping it, and we migrated to a TECO-inspired full-screen editor developed by another university. Once that arrived, we hard-core TECO users, all 4 of us, were won over within a week.
The TECO macro I posted is the VT52 one.
Me, being just a lowly compsci minor, prefered the full screen editor called FOXE. Was very simply to use and did the job fine for writing/editing programs of the length typical of homework assignments. Don't recall all the particulars to comment on search, replace, etc.
Unfortunately, there is like zero internet info on it beyond: "Little (if any) information is available for this visual editor available for TOPS-20 in the early 1980's. It was similar in appearance to the then new EMACS but had a far simpler command structure."
Also used PFE32 for a while on the Amiga, sad that the source for that never made it out.
[1] I still have Craig Finseth's thesis "A Cookbook for an Emacs" which talks about designing FINE.
I also used PFE32 (on Windows), and for those who may not know, the acronym stood for Programmers File Editor, IIRC :), and the 32-bit version, probably. It was a nice lightweight text editor. One feature it had, that not many other editors might have had at the time, was the ability to open fairly large text files (for that time, at least).
I can't agree more on the beauty of a OS-endorsed scripting language embeddable in every application! Lua might take that role one day...
On the other hand, an Emacs clone (MicroEmacs) actually came with my Amiga 500's bundled extras disk...
Point of order: Minix switched to BSD nvi in 2013 https://github.com/Stichting-MINIX-Research-Foundation/minix...
Not that it matters -- Minix itself hasn't had a commit since 2018 -- but the last five years of its life were spent without Elvis
[1] https://www.rand.org/content/dam/rand/pubs/reports/2008/R217...
Discussion: https://news.ycombinator.com/item?id=17696023 (420 points | Aug 6, 2018 | 259 comments)
Nice read, indeed. Especially the final sentence.
> Also... Emacs sucks!
It always amaze me that I was only introduced to them in my adult life way after Windows, but still for me they are the definition of what computer is.
So this is not really about (personal) nostalgia.
Also in the age of 8K screens, VR, AI and AI ready computers, a lot of people still use and love vi.
Call me crazy but my guess is there might still be vi users in 50 years.
The class's TD was also very interesting. He was 13, a child prodigy in their CS PhD program. I remember when I learned his age, he told me not to tell anyone, it would impact their ability to learn from him.
Nice. So were the HWs split along the usual lines of lexer, parser, codegen, etc? You said it was a surprise, so I wonder how else it was split to actually make it surprising. Or was it hard enough to judge the purpose of the assembly version that it didn't matter?
Besides, the plugin michaeljsmith/vim-indent-object defines a new text object ("i"), based on indentation levels.
ngcc_hk•9mo ago
gustavopezzi•9mo ago
herodoturtle•9mo ago
neitsab•9mo ago