[ad_1]
A decade ago, a programmer asked on Stack Overflow how to get away from the decades-old open-source text editor Vim, and the question has since become a cultural staple of the modern development experience.
Perhaps it’s proof that the 50-year-old text editor continues to be popular – it’s now part of the developer community’s collective experience. (Vim is a 1991 clone of Bill Joy’s V editor, created in 1976 to serve as a visual mode for an earlier line editor. It was included in the original Berkeley Software distribution. [BSD] Unix, released in 1978 and has been in the Unix/Linux developer’s toolbox ever since.)
But it also speaks to a larger truth, an appreciation and recognition that managing Vim requires taking the time to educate yourself on its shortcuts and functionality. Maybe there’s some secret pride in being as powerful as Vim – there’s still a learning curve. Getting stuck in Vim, a decades-old text editor, is common if not universal for struggling first-time users.
So here’s a quick story: Last weekend I had a class of 7 students learning JavaScript. I wanted to open a file in Terminal to show what was in it and did the usual:
vi filename.txt
I spent the next 15 minutes trying to log out of Vim on 7 different machines.
– Tomasz Łakomy 🌩 cloudash.dev 🇺🇦 (@tlakomy) August 27, 2018
Basically, it’s an important task that can’t always be implemented in a predictable way. While typing in Vim, it won’t accept stop commands like “q” until you hit the escape key – and then commands like “quit” are preceded by a colon.
As the wise Linux Graybeard once pointed out, Vim is no different from Microsoft Word as both have two modes. One is command mode for saving files, adding formatting, stopping the program itself, and so on. And there is an editing mode where you can write your code, book proposal etc. The trick is to learn how to switch between the two effortlessly.
Yet, many novice users have difficulty exiting Vim, with the instructions now appearing on the welcome screen when the software is launched – even before the help command.
And typing Ctrl-C twice in Vim will now pull up a hint at the bottom of your screen.
But as the years went by, the problem became the loving target of some gentle geek satire. GitHub currently shows 77 contributors to the repository titled “How to log out of Vim”. For example, he suggests that one of the best ways is to edit your shell’s variables file so that “vim” is mapped to the vim startup command and times out and expires after exactly 600 seconds. (“Make sure you save regularly”)
A 2019 YouTube video shows a more robust solution. It involves killing the default vim process (using Ctrl-Z ) and listing all active processes (using ps ax ), pushing all processes that contain the string vim — checking that grep process (which also contains the string vim ) — then using Awk to get the results. The xargs command to format will kill the Vim runtime.
The chosen way out #vim?
— Josh Boyd (@joshboyd) September 20, 2018
Knowing ourselves
There’s also the fun of knowing when geeks stumble when reminded of how common the problem is.
Ten years ago someone asked, “How do I get out of Vim?” on Stack Overflow – and the question has been asked 4,786 times (and bookmarked over a thousand times by Stack Overflow users) in the decade since. The answers to the question have been lovingly preserved and refined over the past 10 years. And while it took almost five years to reach 1 million views, it received another 1.7 million views in the five years since — a total of 2.7 million.
Last week, Reddit users couldn’t resist celebrating the question’s 10th anniversary. After the original question’s URL was posted on the Reddit programming forum, it received more than 5,000 votes — and another 660 comments.
However, mixed in with the comments was some genuine appreciation for the Stack Overflow answer. One commenter commented: “This answer made me think of Vim exactly ten years ago.” “Ten years later, it’s still one of the best serendipitous software decisions of my CS journey.”
And another commenter felt that Vim shouldn’t be given its name for its steep learning curve, as it “sometimes happens to innocent users trying to commit to Git.” I reckon that covers at least half the views for the question.
The question received special recognition on the Stack Overflow blog in May 2017 – when it reached a special milestone. “You’re not alone…” writes David Robinson, Data Scientist at Stack Overflow. In the five years since this question was asked, there are over a million other developers who are stuck in Vim and can’t escape without help. That actually accounted for one in 20,000 visits to Stack Overflow questions.
“That means there are about 80 people an hour during weekday peak traffic hours who need help getting out of Vim.”
“If you win, you can exit Vim.”
“What’s the game?”
“Exit Vim”. pic.twitter.com/vapdZlhUNK— SwiftOnSecurity (@SwiftOnSecurity) April 29, 2020
The demographics of stickiness in Vim
Robinson can’t help but admit that the question itself has now reached the level of barely a techie meme.
I left it out of Vim. I buy a new laptop every time.
– Paul J Stales 🧑🏻💻 (@pauljstales) August 3, 2022
But the post dives into the demographics of those million views (“honor for this milestone”). Interestingly, the country representing the highest percentage of Vim-related inquiry visits in 2017 was Ukraine (followed by Turkey, Indonesia, Pakistan, Vietnam – and then Russia). The United States is ranked #21 (behind Australia and above India).
Robinson also calculated the top visitors to the Stack Overflow area (based on local accounts) with the aim of breaking down Vim exits by “core programming technology”. The results? “The developers most likely to stick in Vim are front-end web developers: they mainly visit tags like JQuery, CSS, and AngularJS. They are followed by Microsoft developers (C# and SQL Server) and mobile (Android and iOS).”
I’ve been using Vim for about 2 years now, mostly because I couldn’t figure out how to get it out.
– I’m a developer (@iamdevloper) February 17, 2014
The article assumes that Microsoft developers usually work with a full IDE, and may not be familiar with simple text editors like Vim. In contrast, developers who are less likely to be stuck in Vim have their primary programming language C, C++, Python, or Ruby — languages that Stack Overflow’s data scientists believe are often written with text editors.
But they don’t completely rule out the idea that having demographic data captured in Vim is a very common practice. And the jokes just keep on coming – crediting first-time Vim users for that unique and confusing experience.
How come I’ve never seen another Vim “joke” coming out?
– Chantastic is off 🥾 (@chantastic) April 24, 2021
Amazon’s Kindle Store offers a 23-page e-book on the subject – which the author has divided into 19 chapters. (“Finally, a way to crack Vim’s hacking puzzles without leaving a trail of destruction behind you.”) A top-rated review calls it a “show-stopping masterpiece” and gives the 23-page e-book a full five stars. , possibly-humorous review.) “This book is a definitive treatise on one of Vim’s most common and least-understood features, but it reads quickly and effortlessly. It will stand the test of time.”
Another reviewer entered a fake owl in the title of their review. “Tried it first and exited Vim. Would buy again. “
Another joked, “I can’t wait for the second edition of How to Find and Use Vim Help.”
But alas, one reviewer awarded only four stars. “I would give this book 5 stars but I can’t figure out how to close it.”
#come out pic.twitter.com/VNd9XsSiTd
— DEV Community 👩💻👨💻 (@ThePracticalDev) June 28, 2016
Feature image via Reddit.
[ad_2]
Source link