How do you exit Vim? The new man’s question turned into a tech meme – the new stack

[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.

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.

How to log out of Vim on the Vim welcome screen.png

And typing Ctrl-C twice in Vim will now pull up a hint at the bottom of your screen.

Vim message (bottom of screen) after Cntrl-C twice

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”)

How to exit Vim - Product Manager way

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.

ps ax | grep vim | grep -v grep | awk '{print $1}' | xargs -n1 kill -9
Commenters on the video responded with exaggerated praise, with one saying they’d been stuck in Vim for a week and another adding, “I just pressed the power button to exit Vim.”

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.

Reddit programming forum celebrates 10th anniversary of request to quit Vim

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.”

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.

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).”

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.

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.”


Feature image via Reddit.



[ad_2]

Source link

Leave a Reply

Your email address will not be published. Required fields are marked *