Harvard University used to teach an assembly language class back in the 80's, taught on a mainframe - a VAX 11/780 or similar I seem to recall. This was an open enrollment class, available to evening and summer students. That class was, well it as Assembly, so it was difficult. The homework assignments were odd, seemingly unrelated. At the midterm, the professor handed out a makefile that combined every assignment to date, and if you did your homework correctly, a mini version of Vi was produced. The rest of the class with polishing that version of Vi, all in assembly 11/780. Taught me one hell of a lot!
It's incredible how good of a design Vi is. Try this experiment: Busybox includes a tiny clone of vi with a reduced feature set. It's very stripped down when compared to Vim or even other vi clones, but as a pure text editor it's still more powerful than most modern day IDEs.
I love my Jetbrains IDEs, but you can take my Vim plugin from my cold dead hands :)
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.
>> It's incredible how good of a design Vi is.
>It's interesting how this design was forced into existence by the extremely limited hardware at the time
Can we learn that if you design something for a constrained environment, it will shine when the limitation is lifted?
We're only seeing the rare examples that worked out well.
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's a great point. On modern systems, there's a false economy where editor stunts are not going make most people a significantly faster programmer. (Although some ppl just like them, e.g thinking they are "more powerful".) But on a very slow terminal, these things really did make a huge difference.
For people who love vi/vim, it's not really about being "a significantly faster programmer." It's about reducing friction between the changes you want to happen and them happening on screen. Editors with a lot of friction (that make you do lots of intermediate or repetitive steps to accomplish a task) can be really annoying to use. For some people, minor annoyances can be very distracting to the point where they take you out of your comfort zone and break your concentration.
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.
I don't think it's even so much about keystroke count as it is the "commands" are more like a language that you can keep getting better in. For example, from above:
> 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.
> I don't think it's even so much about keystroke count as it is the "commands" are more like a language
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.
And these commands are useless for programming unless you format source code in a very specific way, adding white space such that everything is split into "paragraphs" that can be thought of and operated on as a single unit.
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.
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.
Yeah, vim was invaluable when I worked in the semiconductor industry. Lots of perl, TCL, SKILL (a lisp dialect) and giant verilog netlists. Languages which don't really have proper IDEs or great all in one tooling.
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.
> As someone down below mentioned, programming is not as much editing text as it is massaging the underlying AST.
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.
Yes, I'd say the composability of commands is vi's key feature. I can't remember any but the most common shortcuts in other editors. In vi I get so much more bang for the buck since I have easy access to all the commands I remember multiplied by the motions I remember.
Absolutely, some people just love vi. Sometimes it fits their mental model, other times someone told them "real programmers use vim/emacs" and so they internalized and studied it. That's why most modern editors still have a vi mode. Obviously it works for 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)
That may be true because 1980s UI scientists were most concerned with building efficient and intuitive UIs for the vast majority of people, not for 1%ers.
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!
I’m not sure. Command based editing opens more doors than just optimizing keystrokes. There are edits I somewhat regularly do with Vim macros that save me minutes of typing and cognitive burden of examining refactor locations. It’s probably not going to be make or break, but I do think it’s significant in a p > 0.05 sense.
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).
I don't think it's fair to talk about "shortcomings" and "getting it right": it's a different approach and we must agree that personal preference will diverge.
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 the same for selections, but motions are a little different. To use an example from above, d) is "up to" the next sentence (excludes the first character of the next sentence), while v)d moves the cursor onto that first character and so includes it when deleting.
> That's why we got commands like d), d{, D, etc. Trying to achieve the goal in one go, without any intermediate redraws.
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).
I have used VI for many, many years and honestly use perhaps 25% at best of its abilities. But still I get comments about how fast and smoothly I can use it from other developers. Which I think speaks to how powerful even the basic editor can be.
And yes, you can also take my VIM plugin (for Visual Studio) from my cold dead hands.
Same here. Tbh, you're comment just inspired to do a deep dive on VI. Wonder how much more productivity I can squeeze out if I spend an weekend focused on it.
The productivity comes from not having to think about your editing while simultaneously realizing that you can do some complex editing really easily. I use Emacs and Vim both (I prefer Emacs) and It's quite nice when you can streamline some quick code edits.
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.
I think Vim and Neovim is better suited as editors, meaning quick launch, fast localization of files and fast editing actions. And I like plugins that support this philosophy.
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).
It is worth knowing pure vi to some extent. To the point you raise, it's pretty much guaranteed to exist on any system you're on. That's not true of anything else, even vim
I can count on one hand the number of times I’ve had to use vi or nano and not had another option in 15 years programming. Optimising for that use case is not an efficient use of time.
Same, except it goes back 30 years, but it sucks when that one time comes up. I'm not suggesting one becomes a wizard. I'm suggesting understanding basic commands.
I would say it’s incredible to see the quality and “durability” of Linux/Unix tools. The other day I wondered “how old is grep”, looked it up and realized that I use a piece of software that’s over 50 years old on a daily basis.
The fact that these tools have stood the extreme test of time is really something.
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.
TECO was just a DEC line editor, not entirely unlike ed/ex. The idea of TECO managing a display terminal (i.e. the environment in which emacs was written as a bunch of macros) came much later, and really only existed at MIT.
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.
TECO was a character-oriented editor. Also, it was widely available on RSTS, RSX, RT-11, ... and other DEC systems in the mid-70s. There's a character cursor. So if you opened a file with:
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.
I started with TECO (Text Editor Character Oriented) on Caltech's PDP-10 back in 1975. There were no glass ttys, just DECwriters and ASR-33s (ugh). I.e. TECO was a line editor.
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?
We had TECO on our DEC VAXes running VMS in the early-mid 1980s. It had a ”VT52” mode (as you say, a macro), and at least one of the terminals on my desk supported those escape sequences. Wikipedia says the VT52 terminal was made from 1975 to 1978, so those macros were probably fairly early. By this stage, TECO distribution was fragmented with various incompatible versions around, so probably some lacked that macro or other full-screen macros.
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.
A lot of the "elite" compsci students at my college in the early-ish 80s were still using TECO on our DECSYSTEM 2060 but some of the cool-kids were trying that new Emacs thing ;)
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."
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.
It could also be invoked on VAX/VMS under the name “MUNG”, which was said to stand for “Modify Until No Good”. I think that style of invocation did something slightly different than using the TECO command, like creating a new file.
At the time, I was told that a student once claimed that TECO was a complete programming language. He was challenged to write a FORTRAN compiler in TECO, and did.
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 was a TECO user on RSX-11M, then switched to FINE (Fine Is Not EMACS :-)) on Top 10 & 20. When I started at Sun I started using vi but on the Amiga I continued to use MicroEMACS which felt a bit like FINE[1]. After Sun I pretty much stuck to vi because it was so much faster over a remote X11 connection than EMACS was.
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.
>Also used PFE32 for a while on the Amiga, sad that the source for that never made it out.
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).
Vim is awesome! For my hobby project, Vimgolf.ai , I am trying to make it easier and more fun to learn vim by being gradually introduced to the different motions. I am eventually trying to create different bots to create a standard of difficulty for each level but that is TBD at the moment.
> The creator of MINIX, Andrew Tanenbaum, asked the community to choose between Stevie and Elvis to be adopted as the main text editor for their OS. Elvis was chosen and it's the default text editor on MINIX until today.
Up to now I have been using elvis exclusively, rather than vim, both on Windows and Linux - I never saw the need to switch, since elvis does everything I need. I just retired it last month, when I upgraded some systems to the latest release of Debian Bookworm and the elvis graphic interface started crashing the whole X windows manager. I have the source code, but I don't have the patience to recompile and debug it.
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 ancestor of all those full screen terminal editors is the RAND editor, which was on Unix around 1974.[1]
Few people outside the DoD research community saw it, because it wasn't free and only worked on some terminals. Functions were triggered by dedicated function keys, not key combos or a command line, and it was customary to use something with 8 to 10 function keys, such as the HP2645A. You could split the screen, edit two files, and do cut and paste. Way ahead of its time.
I used the rand editor in early 80s & loved its “infinite” quarter plane model. Dave Yost enhanced it quite a bit and called it the Grand editor. But it was hard to maintain as it relied on K&R C. Eventually I gave up and went back to vi.
I bought a used one for my use at home while working on a university degree. And as another comment noted, vi would still be usable with a 300 baud (or 1200, I can't quite remember) modem. You could limit the visible "window" into your file to five lines on screen, so it didn't take so long to refresh. Alas, no longer have the ADM3a (but my kids when younger did use it as a play typewriter for a while).
In a, thankfully past, role working remotely for an antipodal organisation with badly configured networking; often, the lag between typing several characters on the keyboard and those characters appearing on my screen could be measured in seconds! Vi key bindings were a godsend as I could send commands (eg global search & edit etc) and be confident they were being applied before recieving a (delayed) visual update. I feel my experience seems to echo (albeit slightly) that of Bill Joy's vi development on a 300 baud modem!
There was another editor for the Amiga, possibly only known to the users of Matt Dillon's DICE compiler, that integrated so well with ARexx that at a certain time I suspect ARexx code surpassed the core C code. The name's DME and the source is still available.
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...
And that I suspect originates with ASCII Control-H = backspace (cursor left), Control-J = line feed (cursor down). Control-K and Control-L don't match but weren't so important that they couldn't be repurposed by an early display terminal.
while neovim is great and I intend to switch even, some time down the road, it caused a not-really-compatible fork and diverted the efforts, I wish them to be merged however hard it will be.
I am maybe just a year or so down from the switch from vim to neovim, but lua is a game changer. It's like, it's easy to configure stuff yourself now. Better plugins are written because the tools are better, or at least so I'm convinced.
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.
vim9script is much more approachable while still being native to Vim's internals and idea of text editing. I don't know about using it for things like LSPs though, perhaps an expert could chime in.
You are absolutely not. In point of fact pretty much everyone hates Lua except the handful of folks integrating it. It has a huge lead in terms of embeddability and performance vs. competitors like Python. So you see it show up in little C applications[1] again and again and again because everything else is just too much of a hassle.
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.
> But everyone agrees the programming experience in the language is awful.
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.
DSLs and configuration languages aren't "programming experience" though. (Also that's oversold, you should be on a lisp if that's the design goal, Lua is a distant second.)
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.
I've been playing with Rust a lot in the last few weeks, and I have been pretty happy with the Rust plugins available for NeoVim. It gives me most of the features I would want from a "real" IDE, but of course it's still Vim, so all my configs and other plugins still work.
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.
If you follow any discussions around development, it seems the chance of this happening is essentially zero. I feel that they will continue to diverge into completely different editors.
Hard to say, but as it stands, but my view is that that the typical nvim users want Vim as a full-fledged IDE with little effort whereas Vim users still want Vim largely as a text editor. And of course there are already a whole bunch of incompatible differences between them that would only be noticed by the more "power" users I suppose.
My first text editor has been vi on NCR Unix machines back in 1986 and DEC Ultrix in 1988. I fell so deeply in love that I joyed only when I could get a "copy" of vi.exe from MKS unix-like toolkit for DOS. That file only.
It's a bit dishonest imho to quote out of context. Here's the full quotation:
> 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.
As a slight aside if you want unabashed joy for 18 hours, take Pikuma's Raycasting Engine Programming course. One of the best courses I have taken and I don't do many courses because I have stuff to do. Also it's in C.
I was surprised to see this on pikuma… I guess “ Also... Emacs sucks! ” is ok to end the blog entry. To me it is just hard to use 2-3 figures and it seemed hard for inventory as well. That sucks.
Author here! I remember struggling with the decision of adding that last sentence or not. But at the end I was sure most readers would get that it is obviously a joke. Maybe a bad one but still a joke.
I loved the ending! Glad you kept it in. I’m sure the emacs folks will appreciate the humour in it. And they’re welcome to write their own article on the history of emacs and end it similarly. They’ve probably got a binding for it.
I read it as sincere, gratuitous and unfounded mud-slinging, which made me end this remarkable article on a pretty underwhelming note.
We all have different senses of humor, mine would have needed some caption here :'-)
I love my Jetbrains IDEs, but you can take my Vim plugin from my cold dead hands :)
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.
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.
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.
> 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.
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.
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.
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!
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).
[0]: https://helix-editor.com/
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!
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.
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).
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.
The fact that these tools have stood the extreme test of time is really something.
That doesn’t mean it’s actually the fastest tool for the real job. Programming is not text editing
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.
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.
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.
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."
The TECO macro I posted is the VT52 one.
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.
I'm not sure if that was true.
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).
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
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.
Besides, the plugin michaeljsmith/vim-indent-object defines a new text object ("i"), based on indentation levels.
[1] https://www.rand.org/content/dam/rand/pubs/reports/2008/R217...
[2] https://terminals-wiki.org/wiki/index.php/HP_2645A
On the other hand, an Emacs clone (MicroEmacs) actually came with my Amiga 500's bundled extras disk...
The main divergence of note is tab expansion.
[0] https://edoras.sdsu.edu/doc/BerkeleyDB/ref/am_conf/logrec.ht...
[1] https://en.wikipedia.org/wiki/Berkeley_DB
1: http://www.cygnused.de/index-en.php
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...
https://archive.org/details/ADM-3A-User-Reference-Manual-Apr...
(This page, and Figure 1-3 below).
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 it's still ten times better than Vimscript.
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.
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.
https://github.com/martanne/vis
Nice read, indeed. Especially the final sentence.
> Also... Emacs sucks!
Discussion: https://news.ycombinator.com/item?id=17696023 (420 points | Aug 6, 2018 | 259 comments)
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.