r/linuxquestions • • Jul 17 '21

Why is VIM so popular among programmers?

So I just moved to linux for programming purposes and what I have seen is that many many programmers who are on Linux... Use VIM as their text editor even if we have many other modern text editors that could do great work.

So my question is why do programmers use and love VIM?

And what things VIM could do that other Ide's and Text Editors can't do?

I have also seen people telling that VIM could speed up your Development process... So how exactly does it help to speed up things?

247 Upvotes

245 comments sorted by

123

u/tuerda Jul 17 '21

Vim's editing paradigm is fundamentally different from any other editor. It is less like a normal text editor and more like a text editing language. It adds a significant amount of abstraction to how you edit text: You essentially "talk to your editor" in a language it understands.

"delete this sentence". "Repeat the last action here". "Capitalize the next three words". Etc.

It also is extremely configurable. This does not mean configurable in the sense of looks and such, but in the sense of functionality. For an example of what I mean: My former phd adviser had a set of extremely excentric preferences of how to format LaTeX documents. He also wanted me to wrap my edits in certain custom LaTeX commands to identify them as things which I changed from the previous version (I still have no idea why he didn't just use diff): Anyway, in vim I set up a keybinding which sent LaTeX documents into "former phd adviser mode". It reformatted the document and loaded a set of custom keybindings which wrapped arbitrary sections of text in the appropriate custom commands. It also changed the colorscheme to remind me I was in this unusual mode. This only happened for LaTeX, and only if I triggered it: No other language was affected.

47

u/Vlad_The_Impellor Jul 17 '21

Plus, it's on very nearly every Un*x like system, even NAS boxes, and it can edit streams. No UI at all.

Let's not forget the pagoda puzzle solving macro example.

25

u/West-Astronaut-412 Jul 17 '21

THIS!!!

If you can get to a command line and nothing else, you can make changes.

14

u/Vlad_The_Impellor Jul 17 '21

Yes! Just ssh into an AWS EC2 server, even with X11Forwarding, and try to start VSCode or Kate. Wah-wah-waaah.

You can't spell "eviml" w/o vim!

7

u/Routine_Part_6503 Jul 17 '21 edited Jul 17 '21

Viscose Remote SSH extension is great, but I agree with you.

Edit: Autocorrect, I meant VSCode

10

u/[deleted] Jul 17 '21

Did you just censor Unix?

20

u/[deleted] Jul 17 '21

[removed] — view removed comment

16

u/GOKOP Jul 17 '21

I thought that's "*nix", "*nixes"

0

u/[deleted] Jul 17 '21

[deleted]

→ More replies (1)

11

u/Vlad_The_Impellor Jul 17 '21

That. Un*x is shorter than

"UNIX, HP/UX, SunOS, Solaris, Irix, AIX, Minix, GNU/Linux, IBM Z, BSD, OpenBSD, FreeBSD, Firefly BSD, DC OSx, Mac OS X, et al."

and requires fewer pixels to be recycled. Dang it! He tricked me.

4

u/[deleted] Jul 17 '21

Edit streams?

6

u/Vlad_The_Impellor Jul 17 '21

Yep "ex mode" it's called, vim works kind of like sed (but with vim's commands/syntax/macros, plus random access file i/o) if file descriptor 0 isn't a terminal.

2

u/dmccammond Jul 17 '21

I haven't seen that example. Do you happen to have a link? I couldn't find it searching Google.

2

u/Vlad_The_Impellor Jul 17 '21

Most package managers install it with the full vim package.

locate -i hanoi

Ubuntu server puts it at:

/usr/share/vim/vim80/macros/hanoi

2

u/[deleted] Jul 18 '21

Uhmm, what would be an example of stream editing?

2

u/Vlad_The_Impellor Jul 18 '21 edited Jul 18 '21

It's hard to input code on a phone. Code block markdown doesn't work for me, but Stack Overflow has me covered.

Edit: vim's ex mode is obviously intended for batch editing e.g., from a find command, but this is my favorite "can YOUR editor do THIS weird thing??" trick.

1

u/[deleted] Jul 18 '21

Right, those are mostly focused on how but I was asking for the use case.

1

u/Vlad_The_Impellor Jul 18 '21

Top of my head? None. Maybe editing a curl stream of arbitrary length to make bulk changes e.g., moving the last 100 lines, of N total, to line 4, before writing the output to disk. That requires random access within the stream. The sed command can't do it, ed can't, awk can w/ difficulty but will likely break trying.

There's no compelling use case, until you need that functionality.

12

u/emlun Jul 17 '21

Exactly. Vim keybindings are not "shortcuts", they are a real-time human-computer interaction language. It takes a while to learn, but once you do you'll never want to use anything else.

And it's not really that it makes me type faster - rather it's that I don't need to interrupt my train of thought to reach for the mouse or some awkward shortcut chord.

That said, there's not really a reason other editors couldn't support that same interaction language (although most attempts at "Vim bindings" I've seen have been poor imitations, only IntelliJ IDEA has come close). These days I'm actually using Spacemacs instead, which is essentially a Vim interface on top of Emacs for the best of both worlds: the superior interaction paradigm of Vim and the legendary customizability of Emacs.

3

u/ase1590 Jul 17 '21

interrupt my train of thought to reach for the mouse or some awkward shortcut chord.

ehhh, that escape key is quite a reach compared to ctrl/alt

4

u/dmccammond Jul 17 '21

One of the first examples usually given for configuration of Vim is to map a leader key and to use the leader key with another key to exit out of insert mode.

I personally use "kj" to exit insert, so it's extremely accessible.

→ More replies (2)

2

u/emlun Jul 17 '21

I have long fingers, so I've never found it to be out of the way. But either way I'm now using a split keyboard where ESC sits just to the right of B.

9

u/voltaic Jul 17 '21

I've been using vim for 20 years, and occasionally have people ask "why?" (Just like OP did here) and your explanation/ description of vim is absolutely spot on. I've never thought to explain it in terms of "talking to your editor", but that's exactly what it is.

3

u/yuyu5 Jul 17 '21 edited Jul 18 '21

This should be the top answer. As a non-vim dev whose asked multiple vim devs (and googled ofc) "why vim over Sublime/IDE" and never got a convincing answer, this is the first time I'm seeing both a clear explanation and a real life example where vim does something other editors don't really offer.

Repeat the last action here. Capitalize the next three words

This is particularly interesting. Idt I know of any editor that has an auto-capitalization function. I find myself needing to handle e.g. snake_case to camelCase conversions occasionally that are annoying b/c Ctrl+Shift+F "replace" doesn't often have a "replace [-_]([-_]) with ::uppercase::\1" option.

What is an example of "repeat last action here?" I can't think of any particular editor function I've used that I'd want repeated exactly as before. Even something like "refactor>rename" requires a new name input that would break if using "repeat last action here."

reformatted the document

I'm pretty good at regex and could probably write a quick script to convert the file formats (I'm assuming writing your vim quick-action is basically the same thing? Idk how vim actions are written). I know sublime can let me add a custom python plugin/key combo only for certain file extensions, so I feel like this is not necessarily better in vim than other editors, but still a good example of why you chose vim, esp with the other points above.

Final question: Does vim have some of the niceties of other editors? Things like code folding, displaying function code docs on F1 press, etc.

Edit: Fix typo

4

u/tuerda Jul 17 '21 edited Jul 17 '21

"repeat the last action here" is bound to . (the period key) by default. It is extremely powerful because "actions" in vim are abstract. For instance, if the last action was "capitalize the next three words", you can then move to a different part of the document to another 3 words which need to be capitalized, hit . and they are capitalized for you. Actions in vim can be quite general: "Within the next 3 lines, search for the first instance of "George" and replace it with "Peter" is an action that can be repeated with .. "Change the word under the cursor to 'water'", "Reverse the order of the next two lines", etc. I find myself using . all the time!

. can sometimes be a lazy man's search and replace, for instance, where you have a couple of different things you want to replace with "some_string" (and not too many repetitions). Rather than writing some complex regex, you just replace one of them, and move through the document hitting . when something needs to be changed.

Vim comes with code folding by default, as well as syntax highlighting, compiler integration, (basic) completion, a built in terminal, macros, . . .

Vim does NOT have LSP static code analysis or autocompletion by default, but this can be added with plugins.

2

u/romainmoi Jul 17 '21

Vim does have an autocomplete by default. It’s based on the existing words in the file (c-n/c-p), line (c-x c-l), files (c-x c-f) and more. They are not as “smart” as lsp ones but they do what you expect them to do, and do it quick and well.

Once you get used to it, it works in a lot of situations such as repeating a variable name, even a better flow then reading the autocomplete list and decide because you know what’s going to happen already without reading.

However, it can’t replace lsp/other autocomplete algorithms that does analyse the packages/variable attributes.

2

u/tuerda Jul 18 '21

Vim has basic completion by default, but not autocompletion. Vim's built in completion is triggered manually.

There are basic plugins like mucomplete and autocomplpop which basically change the built in completion to trigger on its own, but those are plugins too.

3

u/[deleted] Jul 17 '21 edited Jul 17 '21

Vim has macros, which allows you to record your keypresses, bind them to a button of your choice and repeat them. As a beginner I haven’t really made use of them aside from a few cases, but as an example Luke Smith (not that I’m endorsing him) does amazing stuff with them.

You can do code folding with plugins such as SimpylFold (not a spelling error) for Python and I’m sure there are similar plugins for other languages, but idk if it’s natively supported.

2

u/MarkofCorn Jul 18 '21

It is natively supported iirc

3

u/eat_those_lemons Jul 18 '21

As u/skreak pointed out elsewhere it is way faster to edit files remotely (excerpt from his comment)

"Trying to search for a configuration line and make an adjustment on a remote server is just faster and easier than a larger IDE could ever hope to be. vim file; /search; n,n,n; yyp; ^i#<esc>; j; edit line; :wq (open file, find line by search string, cycle through results, copy line, comment out line, edit next line, write and quit."

205

u/username-343-342 Jul 17 '21

Your hand never need to leave the main keyboard. There are shortcuts for everything if you take the time to learn. It’s what is installed on the most primitive systems.

I don’t recall working with another editor that has its own command line or even a command mode apart from entry mode.

64

u/kokocijo Jul 17 '21

I like these features, and it's the main reasons I have an affinity for Vim, as well as the low resource use.

The key bindings are what really sold me. They are really powerful and tend to save me time, especially when doing macros.

47

u/thiagoroshi Jul 17 '21

Open a +500 MiB file instantly always fascinating me

30

u/bmwiedemann openSUSE Slowroll creator Jul 17 '21

Except if syntax coloring is enabled

2

u/killchain Jul 17 '21

Sublime kind of does that too.

1

u/hmoff Jul 18 '21

I use Sublime but it’s relatively slow to open large files compared to vim.

→ More replies (12)

5

u/[deleted] Jul 17 '21

You might also like qutebrowser, then.

2

u/kokocijo Jul 17 '21

Haha yes, I really want to play around with this!

30

u/Mephisto6 Jul 17 '21

People underestimate the primitive system part. Oh, I need to ssh into some weird computer cluster... vim is already there. If I want, I can even put my plugins there without having root access.

6

u/EedSpiny Jul 17 '21

Exactly this. I made the effort to learn it for that reason and developed a fairly portable (to neovim) vimrc.

Do all my dev work on vscode but it's great knowing vim is everywhere. I even have it on my phone.

30

u/sprkng Jul 17 '21

I agree with what you're saying, but I'd word it differently. Other editors have shortcuts, Vim is more like an interactive programming language to edit text

I think Vim is so popular with programmers because it's a very efficient method to work with text, but it's probably too complex and time consuming to learn for non-programmers.

1

u/yuyu5 Jul 17 '21 edited Jul 17 '21

Agreed. I get that vim is one of the fastest editors, which is great for opening >= 500 MB files as another user pointed out, and that it has good key bindings. But so do the other editors out there.

I find lightweight graphical editors (particularly Sublime) about equal in speed and have key bindings that are more user friendly IMO. Yes, you have to hit extra key(s) for some events (e.g. searching a file: Ctrl+F vs /), but that matches every other app so it's more familiar and easier to begin using. On top of that, they have a substantially more click-friendly UI than vim so if a user wanted to do some classic, "slow" editing, they at least have that option whereas they don't with vim. (Side note: I remember seeing someone do a speed comparison between Sublime and VSCode and Sublime blew VSC out of the water, but Idr where.)

Related digression: I had a coworker once that used vim for all his programming. Multiple times I asked him why he chooses it and pretty much the only answer he could give was the key bindings. Any time I brought up the comparison with Sublime, he said he was just more familiar with vim's bindings. Still to this day, I don't understand the preference for a debatably less feature-filled editor over one with more features (defined by the points above). So I'd love to hear some valid points on "why vim."

Edit u/tuerda gave a fantastic answer below. While I don't think the actions described would convince me to switch, they do explain a good "why vim" situation that I haven't heard of before.

1

u/[deleted] Jul 17 '21

Me with a ISO-DE layout having to type SHIFT+7 to get /

1

u/5pectre5 Jul 17 '21

VScode also has vim mode, so you can be way more efficient than in vim alone.

4

u/sogun123 Jul 17 '21

All these vim modes in whatever program I tried never did 100% what i use in vim, so none of them i found usable enough... And went back to vim

1

u/romainmoi Jul 17 '21

Similar experience except the emacs evil is good enough for me. Still not a complete emulation when it gets to more complicated stuff.

29

u/[deleted] Jul 17 '21

[removed] — view removed comment

12

u/Lectraplayer Jul 17 '21

I'll disagree with VIm being best for writing human readable text that requires formatting (novel, etc) it does do everything else so well that it is my primary editor. For creative writing, I find LibreOffice, Google Docs, or (sometimes) Winblows Notepad (with Word Wrap) better for booking.

24

u/[deleted] Jul 17 '21

Latex just entered the room.

7

u/[deleted] Jul 17 '21

I use Markdown. Really simple, has Latex math syntax.

    # write markdown here
    look text
    latex math syntax: $\frac{1}{3}$

3

u/ArsenM6331 Jul 17 '21

I wrote a custom markdown renderer with a bunch of different features from various implementation, MathJax for math, and templating for anything more complex. It's great and works very well.

8

u/Mephisto6 Jul 17 '21

vim-latex = god

7

u/cromo_ Jul 17 '21

I usually prefer vim+markdown for short stuff and evil emacs+org-mode in order to automate the conversion to LaTeX and manage only the frontmatter, the math and the bibliography with LaTeX syntax. I find it more comfortable

→ More replies (1)

3

u/s0v3r1gn Jul 17 '21

My issue has always been I suck at rote memorization so unless I use a VIM shortcut a lot I can never remember it.

5

u/-SPOF Jul 17 '21

Your hand never need to leave the main keyboard

That is exactly the answer.

2

u/Candy_Badger Jul 17 '21

I love vim. When I learnt how to use life became much easier. Vim is great.

2

u/ctesibius Jul 17 '21

Emacs has a command line as well. It’s rather different, in that it’s used to invoke names functions or evaluate Lisp. It’s possible to bind functions to keystrokes, but not necessary. There are one or two other editors which have command lines.

173

u/MonkeyJesusFresco Jul 17 '21

it's my default lock screen 🤷🏻‍♂️

7

u/Lectraplayer Jul 17 '21

Dmesg used to be mine--with the Phosphor screen saver.

35

u/jso__ Jul 17 '21

take my fucking upvote and get out

7

u/killchain Jul 17 '21

The getting out part might be a bit tricky...

5

u/moratnz Jul 17 '21

I have mastered it. Which is why part of my copy editing process for word docs is searching for ':wq' randomly scattered throughout.

2

u/killchain Jul 17 '21

Muscle memory is a bitch.

1

u/Fly_Pelican Jul 17 '21

Same here, but :wq!

-29

u/a_cuppa_java Jul 17 '21

What an original reddit comment...

2

u/kaleis007 Jul 17 '21

I don't get it

7

u/Laughing_Orange Jul 17 '21

For new users it is completely impossible to exit vim.

1

u/FruscianteDebutante Jul 17 '21

Somebody link that github page for exiting vim

1

u/kaleis007 Jul 18 '21

Lol. Now that mention it i just tried vim for the first time earlier today and i didn't know how to get out.

1

u/Laughing_Orange Jul 18 '21

My first time I just restarted the entire computer. Couldn't understand what ":q!" was supposed to mean.

1

u/kaleis007 Jul 18 '21

It told me to type that so i did and didn't turn back. I asked no questions and quietly went back to nano

→ More replies (1)
→ More replies (1)

24

u/[deleted] Jul 17 '21

You can do almost anything without leaving the Home Row, it's revolutionary. So much so that many other apps use Vim-style bindings, such as DuckDuckGo, AwesomeWM, and qutebrowser.

5

u/Pandastic4 Jul 17 '21

DuckDuckGo

Wait, really?

4

u/[deleted] Jul 18 '21

You bet, try navigating the results with j and k and changing categories of results with h and l.

2

u/paganpapi Jul 18 '21

Man
Less
Ranger (finally downloaded, holy shit)
On and on..

2

u/[deleted] Jul 18 '21

Well, technically Man does not use Vim bindings... Man uses less uses vim bindings. Ranger is nice too, use it often.

0

u/obvithrowaway34434 Jul 18 '21

You can do almost anything without leaving the Home Row, it's revolutionary.

That's basically what someone who's never used Vim, doesn't know anything about it's history and has only read about it in a couple of blogs would say.

20

u/0mega0 Jul 17 '21

To me, the biggest benefit is being able to edit over SSH easily.

Controversial take: Never taking your fingers off the keyboard is nice, but sometimes thinking about the key combinations etc. takes a few brain cycles away from the problem you’re trying to solve. I’ve been coding in VIM for years and this is still the case occasionally.

8

u/skreak Jul 17 '21

Editing over SSH is absolutely key. I'm a dev-ops engineer and very rarely edit code on my own workstation. I ssh all over the place editing configuration files, source code, you name it. Vim as a light-weight console only utility that is installed by default on every unix-like system for 30 years makes it reliable. The whole 'never leave the keyboard thing' you only get used to when you live in remote console day to day.

I also program much larger projects, generally in perl or python and when doing those things, which are much more complicated development with many files then I move to a remote or local desktop session and use PyCharm or Eclipse.

Vim is the daily driver. Trying to search for a configuration line and make an adjustment on a remote server is just faster and easier than a larger IDE could ever hope to be. vim file; /search; n,n,n; yyp; ^i#<esc>; j; edit line; :wq (open file, find line by search string, cycle through results, copy line, comment out line, edit next line, write and quit.

3

u/[deleted] Jul 17 '21

Its actually not even based in reality. People tout 'keyboard only' as if its actually a speed up, but there's been a lot of research on this topic and the consensus seems to be that people who use M+KB efficiently are the most efficient and complete tasks the quickest.

7

u/oxamide96 Jul 17 '21

That's not what I've seen from research I've read. I saw that keyboard is faster, but by a much smaller amount than people here would think. Can you please refer me to the research you've read?

5

u/dwdwdan Jul 17 '21

Though you also need to look at how many people can use M+KB efficiently compared to KB only. I have no evidence, but I suspect more people are efficient with KB than M+KB

2

u/Synergiance Jul 17 '21

It’s faster to type a command than to take a hand off the hometown, reach over to the mouse, position the cursor over what you want to click, click it, maybe need to repeat this two or three more times, then take your hand off the mouse and place it back on the keyboard.

2

u/[deleted] Jul 17 '21

Revolutionary new data shows that input device capable of selecting anything onscreen just by moving towards it and clicking is more efficient than series of complicated keyboard commands

30

u/jirbu Jul 17 '21

It runs over a 300baud serial line and would even work on a 50yo paper tty or a terminal incapable of cursor positioning in ex-mode.

26

u/FormerTimeTraveller Jul 17 '21

It doesn’t hog resources. You can turn the entire GUI off even and vim is all the same. Thus more CPU cycles for compiling or whatever else you’re doing.

12

u/kcl97 Jul 17 '21 edited Jul 17 '21

I first started using vi, the predecessor of vim, because it was the only editor available in the school server I was using. Its main appeal is that it is everywhere and super light-weight.

I think the thing about vim is that because of its unique editing style and the ability to change to your needs through customization, it is hard to change once you have gotten used to it. Everything else just feel sluggish, slow and ten times harder to learn once you have tasted the power of vim, especially if you ever need to work with ancient hardwares.

I tried to learn Emacs at some point because of LISP, I ended up finding plugin for vim to get the features I need. I tried to use Visual Studio at one time because I was learning Windows programming, only to figure out I don't need it as an editor and I can control it to use it as a debugger only after watching the YouTube channel Handmade Hero. I tried to use Sublime Text because of its multiline editing capability, but I ended up figuring out how to do that in vim too. I have learned over time, the right first step after knowing some cool capability in editor X is to figure out how I can get it to work in vim. The second step is to figure out how to improve it.

In short I think it is basically like an App Store ecosystem. It is available on the system you are using and once you are sucked in, you are in because it works great and sometime even better than anything out there, so why bother.

9

u/[deleted] Jul 17 '21 edited Jul 17 '21

I use Vimium in Firefox and Vim extension in VS Codium. When coding, testing in the browser, and googling for information, I barely need to move my hands. Don’t get me wrong, I still use traditional keyboard shortcuts and use the mouse, but the Vim extensions can enhance the workflow when your thought process is on a roll and you know exactly what you’ve trying to do or look for.

I’m not by any means a vim expert, after all vim enthusiasts would scoff at using Codium or any other text editor. I can definitely see the appeal though as when your hands don’t need to leave the center of the keyboard, your thoughts can flow from your mind to your fingertips more seamlessly.

There’s definitely a learning curve though, and it’s not necessary for 99% of users, including coders imho. Micro is also an awesome minimalist text editor with more traditional keybindings that I also use from time to time as Vim in the terminal doesn’t copy and paste from other documents(at least not out of the box). And micro does just that.

In fact, I’d say micro is ideal if you’re talking minimalist coding text editor that is superior to editors such as geany or bluefish, but that’s just my two cents.

Codium though, is ideal for 99% of beginner coding use cases if you have the needed extra memory resources (which most people do running modern hardware, 4gb of RAM will run it, albeit a bit laggy).

5

u/joojmachine Jul 17 '21

kudos for micro, it was my first real step into terminal text editors, then I spent some time learning vim and now ended up switching and daily driving neovim, specially due to it working with clipboard OOTB if you have xclip installed

2

u/[deleted] Jul 17 '21

I haven’t experimented with neovim yet, though I have it installed. Gonna have to experiment with it at some point. Any major differences you notice off the bat when compared to regular vim? Any insights/observations would be appreciated!

2

u/joojmachine Jul 18 '21

it doesn't make much of a difference beyond the working clipboard if you compare both OOTB, at least for my use case (only editing config files and messing with PKGBUILDS sometimes) but neovim (specially 0.5) has a lot of plugins exclusive to it, due to new functionalities that come with it

8

u/Angry_Grammarian Jul 17 '21

I'm not a programmer; I'm a writer and I use vim pretty much exclusively. I like never taking my hands off the keyboard. I like the fact I can open a 75,000 word novel in about .3 seconds and since I write it with markdown any given chapter is just a few moves away (the document opens with the chapters collapsed under their headings). I like that with markdown and pandoc, I can export to pretty much and file format an editor might want, and then have to do only minimal tweaking after that. But here's what I love:

I added this line to my vimrc:

inoremap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u

So, now if I'm typing and make a mistake, I type Ctrl+l and it automatically fixes that mistake and then the cursor hops right back to where I was. Pretty cool. Sometimes the fix is the wrong word, but not very often.

1

u/[deleted] Jul 17 '21

Can you break it down?

5

u/Angry_Grammarian Jul 17 '21

The important bit is:

[s -- go to last spelling mistake

1z= -- pick first option

`] -- move to the last insert position

a -- append text

<c-g>u -- inserts an undo break

20

u/Drazson Jul 17 '21

(Non-user)

I have the notion that it's a vocal minority instead of the majority preferring it.

In any case, others here have listed a lot of good reasons to use it.

As I understand it mostly the keyboard-only approach to one's work could accelerate things once you get used to it. I am not entirely sure how much you save from not using the mouse but maybe I'm underestimating it's practical value.

8

u/sdgengineer Jul 17 '21

I use nano, but I have played with vim and vi, in a past life to see why people like it. YMMV.

3

u/dwdwdan Jul 17 '21

I think if your using it all day every day it probably does save time overall (not much each time but it adds up). It probably also protects against RSI somewhat, you don’t have the repeated motion of moving your hand to the mouse

1

u/[deleted] Jul 20 '21

I'm from India and we were taught about vim (along with other linux/gnu and FOSS stuff) in school. That was my first intro to it but I never got around to use it until much later, although it was forever burned into my memory that such a text editor existed that didn't let you edit the text straight away, saving and quitting was unintuitive and was a nightmare to navigate (the hjkl keys didn't click for someone only recently introduced to computers). At that time, I was under the impression that vim was some kind of an integral part of the free software movement. Yeah the textbooks weren't really that great.

0

u/obvithrowaway34434 Jul 17 '21 edited Jul 18 '21

I have the notion that it's a vocal minority instead of the majority preferring it.

Which is why OP posted this loaded and vague question (that you'll find probably as the first or second hit when you google anything about Vim) in this subreddit. They clearly are not interested in the answer to this and I can't imagine how knowing why Vim might be popular helps someone as popularity has often nothing to do with usability or the reason to choose an editor for work. Either way you're not getting an objective answer in a place where people evangelize Vim on a daily basis (but you'll sure get lot of upvotes if that's what you were after).

0

u/ptoki Jul 18 '21

Yup. The same notion. I see many people using other editors as preferred and use vi or vim because they for some reason have to.

I NEVER, repeat, NEVER saw a person who uses vim and uses the basic shortcuts while working in IT for almost 20 years and being heavy linux environment immersed.

NEVER. Not even one vi/vim enthusiast among the 200 people I saw working. NOT EVEN ONE.

-9

u/CartmansEvilTwin Jul 17 '21

This. I have never in my life met a real vim user.

In fact, I would argue, besides some sys-admins, hardly anybody uses terminal editors anyway.

4

u/ipe369 Jul 17 '21

probably depends on your work

Last place i worked I couldn't find anyone not using vim, maybe a couple emacs nerds. That was a C/C++/ASM job - current web job, everyone uses GUI editors. Obviously using java with vim is a bit masochistic, you won't find too many people using vim there.

1

u/ptoki Jul 18 '21

Obviously using java with vim is a bit masochistic

How come? vim is so damn perfect! why java is making it unusable?

Joking. I also never meet a vim enthusiast. And I know why: Its hard to learn.

1

u/ipe369 Jul 18 '21

I don't think anyone who uses vim claims that vim is 'so perfect' & works under any circumstances, you seem super mad about a community that doesn't exist

→ More replies (4)
→ More replies (15)

2

u/shameless_caps Jul 17 '21

I work in an environment of devops/developers/dbas and 95% of people use vim for all developing tasks. I use it very often as well if I'm writing something simple but I often use Geany for larger, more complex projects- which I tend to finish with vim anyway. The sheer usefulness of having the ide installend in the server wins every time.

2

u/CartmansEvilTwin Jul 17 '21

The real question here is: why would you need an IDE on a server? Servers should not be used like that.

I get that it can be useful to do admin stuff on remote servers, but development should not be done remotely over SSH.

1

u/shameless_caps Jul 17 '21

Because if I'm writing ansible which will run from a gateway node, I just write it on the gateway and can run it immediately without needing to git commit push pull every little change. Like this I quickly find the code that works and then commit push for next time.

2

u/CartmansEvilTwin Jul 17 '21

Alternatively, you could just use a local testbed. Or do test deployments from you local machine.

Admittedly, if you absolutely have to use this setup, a remote editor is useful, but if you look two comments above, that's sys-admin stuff.

→ More replies (1)

11

u/FaliedSalve Jul 17 '21

When I sat down at my first programming job, I was shown vi. The guy who showed it to me said "it's not so much a learning curve, as a learning cliff".

I hated it. But after a while got used to it. Once you jump off that cliff, you realize how darn convenient the thing is. You modify your config file. You create some shortcuts. At one point, I had every keyword in the language I was using to auto-lower case.

No other editor lets you indent the next 12 lines of code with just a couple keystrokes. Or copy 5 lines, put it in a buffer, copy 10 lines into another buffer, open a 2nd file and copy 12 lines from there, close file 2 auto-returning to file 1, then paste all of those in, in any order you want without constantly repeating the same "select... copy.. .paste... select... copy..." commands over and over.

We got some new developers at one place I worked who hated vi, so we did some friendly competition. Short answer, the vi team blew the doors off the other group.

Yeah, I'm a fanatic.

I don't even use it as much as I used to, but for simple scripts and text files, it's just useful.

4

u/der_meisenmann Jul 17 '21

No other editor lets you [...]

Well there's that one lisp interpreter ...

1

u/NekoMadeOfWaifus Jul 17 '21

Do you now use Vi or Vim?

3

u/FaliedSalve Jul 17 '21

Vim. Same taste. Lest than 1/2 the calories.

1

u/ptoki Jul 18 '21

No other editor lets you indent the next 12 lines of code with just a couple keystrokes.

This is controversial. Its not about the number of keystrokes, its about time and effort plus no errors.

I can justify text with notepad++.

I can record a macro and repeat it.

I can use a plugin to format the code the way I like as a whole or only part of it.

And I can do this quickly. No need to learn anything, No need to remember the keystroke. Which is hard for many people while clicking here and there is a lot more memorable for many.

I am in no way making your way of work any way lesser! My point is that the evangelisation and generalisation that "vim is good because..." is simply not universally true just as its not true that "notepad++ is better because...".

1

u/FaliedSalve Jul 18 '21

then use notepad++

I do too, sometimes. And Eclipse. And Intelij

People like emacs too. But... I'm sticking to my point.

If you don't want to take the time to learn it, sure. In my case I had to. I felt the same way when I was forced to. "Why don't they let me use... <insert GUI editor here>"

The learning curve is rough. But once you get there, it is hard to compete with.

1

u/ptoki Jul 19 '21

If you don't want to take the time to learn it, sure.

Its not about me. Its about this projection of someones preference onto general perception and kind of PR.

The right way to present the situation is:

Vim offers no mouse interface with flexibility but it relies on different approach to text. Here would be some examples of things you do frequently, the way its better than some other popular editors and note that it takes this much time to remember the shortcuts.

This way the person who asks knows the benefits, the details from under the hood and the costs. And knows if the examples are any close to what they do with text.

Instead we see just blank statements that vim is great and maybe few edge case examples.

Result? noone is convinced to move to vim because its good. If people move (also stats in this thread here) its caused by hostage situation (the team uses it, no other editor on servers, im fucked, learned vim and I am happy now).

And as for the hard to compete with after learning it, I slightly disagree. I have never saw a comparison of editors in that regard. No blog, no youtube video, no merit based posts about how one editor compares to another.

The usual way to pick favourite editor is either by force (as explained above) or by just settling on an acceptable choice after short trial of few editors or by looking for very specific and individual set of features (like indentation, coloring, block editing, hex editing etc).

Almost nobody picks their editor by comparing multiple aspects.

So how do you objectively decide that once you get there its worth? If someone dont use fancy features and after learning vim realizes that its not usable, is it worth?

My point is: vim/emacs/latex/whatever enthusiasts claim its worth to learn but they dont mention that it may be useless knowledge. The counter balance is: Not everyone needs it. Just like not everyone needs to learn gardening.

14

u/[deleted] Jul 17 '21

I like VIM because it doesn't need a GUI, so I can connect to a server and not feel crippled.

-6

u/Drazson Jul 17 '21

Can always use nano. Your configurations won't be present on the said server so maybe having vim instead confuses you.

I do understand the point, but it's not exactly a point for vim.

8

u/yoloswag90 Jul 17 '21

Not every system has nano installed.

Currently our production servers which run CentOs do not come with Nano installed.

1

u/Drazson Jul 17 '21

I thought vim and nano were both things everything shipped with, good to know.

→ More replies (5)

4

u/[deleted] Jul 17 '21

Or I can work faster in VIM knowing the basics. I generally use PyCharm or VSC for bigger projects, but all my work on my pi is nVIM through SSH, as are any small config changes / minor code tweaks on my primary system.

VIM is just plain fun to navigate.

4

u/[deleted] Jul 17 '21

My main reason for using vim is because I can use it on pretty much any remote Linux machine. I keep customisation to my vim setup minimal for the same reason.

I'm not good enough for it to make me faster but I'm at a point where its not slowing me down either. Some people are crazy fast and absolute vim wizards though

4

u/coolie4 Jul 17 '21

For me, the main thing is it works in the terminal, which means I can SSH into a headless server and use the same editor with the same customization as my main PC.

7

u/[deleted] Jul 17 '21

I dunno, I know loads of programmers and only a few use Vim.

Rather: Vim is popular with redditors that are also programmers.

3

u/THERajat08 Jul 17 '21

its more like a life style at a point

2

u/[deleted] Jul 17 '21

It comes with a decent layout, doesn't use much resources, and has extensions that can reduce the amount of time programmers spend writing code.

Its just plain useful and then also has the vi commands which allow very quick navigation between multiple files. It can take quite a bit of time to master but the speed increase is well worth the effort.

2

u/gnosys_ Jul 17 '21

For the remote access use case, its great. For handling enormous files, its great. For an expressive editing interface that is basically fancy search and replace, it's great. It's easy to write extensions for, and so has a lot of plugins to extend its functionality for language specific features or modifying the interface. And its ubiquitous, so if you're on a foreign machine (like your girlfriend's mac) you can always be productive.

2

u/[deleted] Jul 17 '21

It works really well over ssh, and maps pretty closely to your intentions as a programmer (e.g. working in terms of code blocks and bracket pairs, etc.)

2

u/Stormdancer Jul 17 '21 edited Jul 17 '21

One of the most-frequently-asked questions, fosho.

First, next time a programmer tells you they love VIM, ask them those questions. Ideally, do this in a group of programmers. Bring popcorn.

Why do I in particular use (and love, which is different) VIM? Because it's small, fast, and pretty much guaranteed to be on every machine I have to work on. Do I love it? No. There is no WP or IDE that I love.

What does VIM do that other IDEs & text editors cant do? Not a damn thing. It's just there.

Can it help speed up things? If you're fast with it, yes. VIM never requires use of the mouse, so you never have to take your hands off the home keys. Every time you have to use the mouse, it takes more time.

2

u/verdana_lake Jul 17 '21

I hate mouse, it's that simple, even though i can't live without it.

2

u/cromo_ Jul 17 '21

If you learn the vim way, you can apply that to a lot of stuff, even not editor-related. You can live without leaving your keyboard:

  • You write with vim/neovim

  • You manage files with ranger or similar

  • You manage windows with i3, dwm or other tiling managers

  • You theorically could browse the web with the right vim-oriented tools.

You became fast.

0

u/[deleted] Jul 17 '21

This.. Vim-keys are used everywhere.

Qutebrowser.

0

u/[deleted] Jul 17 '21

[deleted]

1

u/cromo_ Jul 17 '21

So relatable: to me is about the navigation through the page with "hjkl". Sometimes they override that too

1

u/[deleted] Jul 17 '21

I dunno... just like using it.

1

u/[deleted] Jul 17 '21

Some f*****g features....!

1

u/iluomo Jul 17 '21

If you're working with a coding language where you have brackets around functions, this will let you find the opposing bracket by highlighting one and hitting SHIFT+% if I'm not mistaken.

This isn't my only reason, just one no one else has mentioned yet.

Well, that and jumping to line numbers.

1

u/jashAcharjee Jul 17 '21

Short answer: simple, fast, lightweight, modular, highly configurable and finally the feeling of a SUPERIOR Accomplishment (Due to the fact that you are configuring it own).

PS: I use neovim and I have a custom config for that too.

1

u/Exnixon Jul 17 '21

I screwed around with Vim for years before I took the plunge and made it my main editor. The thing that made me take the leap is that I injured my wrist, and the stress of moving my hand back and forth between the keyboard and mouse was keeping it from healing.

The learning curve was steep but once I had a basic sense of it, I was far more productive. Learning Vim is like playing a video game---you customize your .vimrc and you develop muscle memory and you gain new abilities and you git gud.

1

u/ambirdsall Jul 17 '21

Vim’s keyboard shortvuts can be extremely efficient for navigating and deleting text; and for programming, those are much more frequent activities than inserting new text. Also, vim lets you take the cognitive effort of placing a mouse at point A and dragging it to point B (or mashing an arrow key X times) and replace it with your muscle memory for some easy-to-type logical command. It’s really nice once you get used to it.

1

u/TheCharon77 Jul 17 '21

It's easy to move left or right to the next N words.

Macros

Works over ssh

Clipboards. Lots of them

1

u/[deleted] Jul 17 '21

Shortcuts

1

u/michaelpaoli Jul 17 '21

nvi/vi is much better :-) In any case ...

vi is highly optimized for use - it does what it does - text editor - exceedingly well and is highly optimized for use and very well designed. Also, UNIX design philosophy - it does one thing (text editor) (exceedingly) well, and essentially that only, and plays well with others - notably most any UNIX, etc. program - e.g. read in from or write out text or parts of text from/to files, programs, etc., even run text or chunks of it through program and replace that text with the output of the program, etc.

And, yeah, my highly experienced vi fingers tend to fly across the keyboard - not uncommonly with coworkers looking at what I did on the screen and asking, "Uhm ... how did you do that?". Yeah, so much "finger memory" it can be challenging for me to slow down enough to break it down and explain it - many commands so "automatic" to me I'm able to well do them without thinking step-by-step of the various pieces that may be involved. So, yeah, quite optimized for use.

I also know folks that have used EMACS for years ... then used vi ... and switched to vi. EMACS - way too much use of Meta key - not nearly so efficient on the typing.

"Oh my gosh, but vi is hard to learn!" - sure, it ain't trivial to learn and learn well. But as I say, it's optimized for use - not quick learning. But if you do any serious amounts of text editing - you'll spend a lot more of your time editing text than learning the program to edit it - so ... which do you want to optimize? What you'll be spending most of your time doing? Or optimize a bit of what you do to start, and then far from optimized with everything thereafter? Rather like folks that complain "difficult to install" - would you rather install a tool that's crud but easy to install, or one that's some more work to install but an exceedingly excellent tool that you'll used or years - if not decades - or more.

1

u/zoharel Jul 17 '21

And what things VIM could do that other Ide's and Text Editors can't do?

I notice that nobody has answered this question for you. You'll likely notice that as well. There's a good reason, though you should have an answer anyway, and the answer will explain why you didn't get an answer. Nothing. No text editor does things that other text editor's can't do these days. Editing text has been a solved problem for a very, very long time. You can do all your text editing with WordStar and it will be fine.

That's not to say that vim isn't pretty great. It's excellent. I use it all the time, myself. It's memory and CPU-efficient, does proper syntax highlighting, does proper, regex-based search and replace, and literally every other thing you might possibly want, while not ever requiring you to move your hands off of the keyboard, but it's not as if these features aren't available elsewhere. It's just easy and convenient to get them all in vim.

1

u/addicted_a1 Jul 17 '21

with an old pc i can feel difference in loading ram , i can open many files without feeling difference but vscode takes lot of ram. If u can practice vim make ur daily habbit then u will love it fast looks pro. Vim with extension still lot faster than vs lot more features

1

u/alheqwuthikkuhaya Jul 17 '21

Vim is almost more of an idea than a text editor. The vim keybindings work for practically anything where you need to move and edit. I have vim keybindings in my browser, and even though I use VSCode a lot now, I still have Vim keybindings in it. I can't not have them because I'll start hitting hjkl out of instinct. And that's before you get into entering commands.

1

u/[deleted] Jul 17 '21

n(vim) rules

1

u/billFoldDog Jul 17 '21

Vim is available on every linux system I use and I can configure it in the blink of an eye by copying over my vimrc.

1

u/Fly_Pelican Jul 17 '21

!G is my main reason. Want to add the first two columns in the document you've got open? !Gawk... screwed it up? Undo it and try again. :r! Is pretty good too.

1

u/[deleted] Jul 17 '21

Because you don’t have to install it and can expect it to be present anywhere.

1

u/[deleted] Jul 18 '21

Because vim isn’t so much a fixed editor as much as it is an editor that you can program to be the editor that you want. Including all kinds of IDE functionality.

1

u/theguywithacomputer Jul 18 '21

I know this won't be popular but I have asked quite a number of actual professional software engineers and they all use Windows with WSL now. They also either use Visual Studio or Visual Studio Code.

Don't get me wrong, if you want a server you use Linux. If you want to do a lot of other things in the information technology field like pen testing you use a hardened version of Linux. But Vim and Linux, when being discussed online, is mostly used by enthusiasts.

1

u/theInfiniteHammer Jul 18 '21

Vim is the absolute greatest thing to be invented since vi. You just have to experience it to know why. Here's a playlist I made about it that will show you the power of vim: https://youtube.com/playlist?list=PLogZUlUedQpayHBT7pZ9nHf7q9T3HxIsX

You must install it and use it.

1

u/ptoki Jul 18 '21

Its not. Many people use it but a lot of others dont use it at all. They use mcedit, geany, eclipse or vscode or a lot more others.

1

u/flavius-as Jul 18 '21

You need to learn only a few mnemonics and concepts to combine. When you combine them, you get exponential editing power.

10 movements + 10 text objects + 10 commands gives 1000 possible operations with only 30 things learned.

1

u/djbon2112 Jul 18 '21

For me, as both a sysadmin and developer, and pretty much echoing a lot of other comments in one:

  1. It's everywhere. Even if you don't have full VIM, you have VI on basically every *NIX system ever. It's the same whether I need to write code, or make a quick edit to a config file on...

  2. It works perfectly in any terminal - local, over SSH, in a virtual console, etc. Any system via any connection it's there and works just the same. GUI editors have benefits but are hard to run remotely.

  3. The text editing functionality is superbly simple once you know it (cue "rebooted my machine to exit Vim joke"). I've been using it for over 10 years now and I've still only scratched the surface, but some of the most basic functions like dd/yy/p to delete/yank/paste lines or characters, macros, search-replace, etc. are just so quick and simple to use versus most GUIs that need you to take your hands off the keyboard and use a mouse.

  4. The advanced functionality like macros, programability, customization-as-text with .vimrc, etc.

So far all of these are pretty general. For programming specifically...

5. Its syntax highlighting, to me, is far nicer than most other programs. I can't really put my finger on why, but I just prefer it for most of the languages I program in (BASH, Python, C#).

6. IDEs are, IMO, bloated messes of non-features. VIM is simple until you need it not to be, then it gives you a ton of tools to do what you need. While I'm not philosophically hung up on the "Unix philosophy", VIM is somewhere that it works quite well. It's therefore extremely quick and runs on a potato if you need it to.

1

u/abraxasknister Jul 18 '21
  1. Doesn't matter, the only thing that matters is if you like it. If I had to give a reason I'd say it's because it's a programmers editor and not an IDE, which means that it's configurable and extendable to do what you want it to do while staying out of your way (ie exactly the same reason why emacs or VSC are popular).

  2. Nothing. All editors and IDEs can do the same things, given enough config, so that's the wrong question. The right question is "what about Vims approach to the programming task makes it desirable to use it?" Which is something you need to answer yourself. What makes Vim special is the modal approach (that can be copied to other platforms) and that the way Vim is configured interleaves very intimately with the modes (which can't be copied easily).

  3. The same way any tool speeds you up: when you know it well.

1

u/chennyalan Jul 18 '21

WHY VIM

Source: https://www.reddit.com/r/ProgrammerHumor/comments/338tx5/vim/cqiyma2/

TL;DR: If you don't use Vim, do not read this post. Or if you read it, do not believe it. Keep using what you enjoy using now. Do not go down the Vim rabbit hole.

Vim is a disease. I know this, for I suffer from it. It is a mind-altering ailment that permanently rewrites your concept of text editing, preventing you from ever thinking in the way you used to. When you're infected with Vim, all other modes of editing text become deeply unsatisfactory to you. Other editors will look like tricycles to you. Even worse, you will find endless frustration in being unable to explain Vim to someone that isn't already infected themselves.

I'm a dev team leader, and I do not push Vim on my junior members, for that should be criminalized. Two things can happen when you try to learn Vim: either you fail to master it, in which case it was wasted time, or you succeed, in which case you can never go back, even if you want to.

So, what is so great infectious about Vim?

1. Modal editing.

Most editors are in a perpetual "if you start typing now, what you type will appear on the screen" mode. This is "insert" mode in Vim, and it is not the default mode. Vim users will switch in and out of this mode to type. But the rest of the time, they are in other modes, usually one called "normal" mode.

What is normal mode? When in normal mode, letters you type will not be text entered on the screen, but rather they are commands. It's like your entire keyboard has become a command panel for manipulating the text in many complex ways, rather than editing the text character-by-character.

Lest you think normal mode is something that just gets used here and there: Vim users will spend most of their time in normal mode. They will enter insert mode to type text, and then immediately exit insert mode. It's that fundamental to the Vim experience.

Visual and Visual Block mode also exist for selecting areas of text in order to perform actions upon them.

2. Text objects and editing commands.

Normal mode wouldn't make much sense on its own, if the act of editing text was a character-by-character action like it usually is. One of the core things about Vim is that the single character ceases to be the only fundamental object in text editing. Vim elevates words, sentences, lines and paragraphs into first-class objects.

Text objects are important because the facilitate actions being performed upon them.

Part of why Vim is hard to explain is that any single editing command is usually not all that impressive upon its own. If I have the text:

"something in quotes"

… and I want to replace what's inside quotes, I can use the editing command ci" (mnemonic: "change inside quote"), which will wipe out the text inside that quote, and put me into Insert mode to type new text.

By itself, that's not very impressive. Sure, it's faster than using the mouse to highlight the text and hit the Delete key, but it's not that much faster. What you have to understand is:

  1. everything becomes a fast, streamlined text edit command like this. This is a tiny example, and here's some more small examples but every common edit action you'd take can be boiled down into a snappy command like this, and…

  2. the edit actions can become very complex. An individual command, like the one I demonstrated, is a tiny thing. But these commands are meant to be composed together into much bigger operations. Much like how programming itself can take complicated manual tasks and turn them into simple repeatable routines, complicated manual editing tasks can be turned into simple repeatable Vim actions.

Why this is useful is hard to explain. It's kind of one of those "nobody can be told what the Matrix is" sorts of things. You don't really get it until you fully experience it yourself. Vim users often describe the act of editing text in Vim as feeling like you're programming text, rather than just editing it.

3. UNIX is your IDE.

If you are using Vim in a GUI window, I would argue that you're only half using Vim. Vim is really the editor part of an IDE, and that IDE is the UNIX base system. It is a tool you use in conjunction with UNIX utilities in order to manipulate text. You can pipe a buffer of text into a UNIX tool, and have the transformed text returned to your buffer. This isn't just possible, it is idiomatic. Likewise, your "project browser" is your UNIX shell itself. Particularly when paired with a terminal multiplexer like tmux, Vim and UNIX make for a complete, portable, language-agnostic development environment.

4. Vim springs eternal.

As I said in another comment: Vim was here before your IDE. Vim will be here after your IDE is long gone. Vim will outlast your job, your career, your marriage, your life.

Learning Vim means you learn an environment that you can (and, once the disease sets in, will) use for the rest of your career. Long after everything else you know has gone to dust, Vim will be there. Some version of Vim will be running on whatever computer triggers Armageddon.

5. Vim is composable.

Vim is far from the only editor with plugins. But while most editors have a larger "out of the box" footprint and a smaller amount to which they can be configured and overridden, core Vim is a very small, tight package, upon which you build the editing environment you want with a very deep and powerful level of customization. Vim is a core around which you build your personal editor.

6. Vim operates at the speed of thought.

People talk about Vim saving keystrokes and mockingly comment on how that will add up to entire seconds of time saved. It is correct that the value of efficient editing is not best measured in time saved. But what should be familiar to programmers is reducing the interruption of thought. We programmers have plenty of rants and comics about the pain of even brief interruptions of our thought processes. Well, what you don't realize until fully down the Vim rabbit hole is how you are putting up with thought-interrupting manual editing actions that become streamlined into oblivion in a Vim environment (and thus, those tasks you didn't think twice about before are completely intolerable to you now).

7. Even more crazy stuff than I know.

I'm still falling down the hole. Years into my fall, I am still finding Vim features which are entirely new to me, which further impact my ability to manipulate a text buffer in new and efficient ways. If it's conceivable, someone has probably already thought of it and made it possible in Vim. Much like Zombo.com, the limit is your own imagination.

TL;DR #2: Look, I said to stay away. It's a bit like Operation: Mindcrime. Don't ever trust the Vim needle, it lies.

Coda.

Some of this post uses a bit of exaggeration for humorous effect. This is /r/ProgrammerHumor after all. So don't pick any of the hyperbole apart in comments, please.

1

u/5pectre5 Jul 18 '21

Ok I guarantee you that I can write a desktop app in Qt 6 faster with my toolset than you in vim!

1

u/brad_shit Jul 18 '21

Because its simple yet extremely versatile, plus vi or vim will be present on any *nix installation.

1

u/tru0067 Jul 24 '21

There are lot's of great answers here, but I haven't seen the one answers which happens to be the biggest reason for me: usability on a laptop.

I split my dev time between my PC at home and out and about on my laptop. In my experience VIM is the only text editor which can still be efficient while being forced onto a trackpad. Being able to to everything quickly and efficiently all without the mouse is such a huge factor. And with lower resource consumption it also runs fast, even on the lower specs of a laptop.

1

u/bru74lw1z4rd Jul 17 '21

Much faster than graphics editors.

For example 500 mb txt file opens immediately, when gedit need time to open this file.

3

u/[deleted] Jul 17 '21

Dunno, I open 2GB files in Sublime regularly and its fine?

2

u/Drazson Jul 17 '21

This is practically irrelevant.

If you have a huge log file you tail it or something, if you have a small code file you use an editor.

0

u/iluomo Jul 17 '21

If you're having to actually sift through a log file as opposed to watch it fly by, it becomes relevant.

Also, in VIM you can have it highlight one or more search terms not to mention take you to them

1

u/CartmansEvilTwin Jul 17 '21

And why do you need to do this regularly? If you often have to search huge log files and don't use some actual, proper log aggregator (Graylog), you're doing something wrong.

2

u/Drazson Jul 17 '21

This was more or less what I was thinking about, yet it's not in my job description to know in depth so I might be very very wrong.

1

u/iluomo Jul 18 '21

Didn't say I did it regularly, but boy was it helpful those few times in the last several years I needed to

1

u/mdedonno Jul 17 '21

you dont leave the keyboard, hence have direct link between the brain and the result on screen (move, edits, ...). the context switching between the keyboard and the mouse was a problem for my workflow.

moreover, since I have an ergonomic keyboard and I dont leave it, I have waaaaay less pain in the wrists.

1

u/ishan9299 Jul 17 '21

First vim speeding up the development process is a wrong statement. It does not the person who said that has no idea about developing software probably. What vim does is it makes the process of editing text text easy if you are willing to learn it. The next point would be even vscode has shortcuts in it which can speed up the editing. My argument would be vim does that the better if not best the basic keybindings in vim have a grammar so if you get a hang of it you won't have to remember anything. Plus with the release of neovim 0.5 I really don't even have a reason to install vscode on my machine. The only thing I miss on linux is a debugger like the one visual studio has on windows(which I am using now btw).

1

u/obvithrowaway34434 Jul 17 '21

You just created a post with a loaded question about Vim's popularity in a Vim subreddit. It's pretty clear what you're trying to achieve here (and it seems you're succeeding). The answer to your question is it's popular among programming enthusiasts, high school students and college undergrads who love to debate endlessly on fads like "Vim vs. Emacs". Which is why there are so many responses to this question. Professional programmers use whatever tool that makes their job easier or what their colleagues are using in their workplace. And most of them use some form of IDE. Very few professional programmers actually use Vim as their daily tool not only because it requires a lot of setup upfront but it may require different setups in different OS, keyboard layouts and so on. Even people like Bill Joy who invented Vi said Vi was designed for the 80s and people should really use a better tool at present.

0

u/[deleted] Jul 17 '21

I use it as a notepad to edit config files on my Linux system. I feel like I will never get the hang of it because I didn’t learn typing the traditional way and vim shortcuts are designed for traditional typists. I only use tho or three fingers max on both hands.

1

u/Michaelmrose Jul 17 '21

If you are only typing with 2-3 fingers you aren't typing nontraditionally you are typing incorrectly and regardless of choice of editor should someday make it a priority to force yourself to type correctly until it becomes a habit.

-4

u/kokoseij Jul 17 '21

its macro thing I assume? I don't use it. but people have been telling that experienced users could speed up their work speed a lot with correctly set macros.

-4

u/5pectre5 Jul 17 '21

I don't think any reputable programmer uses vim to write actual applications anymore. It's not an ide and you would be seriously inefficient using it to write serious apps. It's really good for scripting, tiny apps, quick fixes, lookups, and small changes though.

3

u/Michaelmrose Jul 17 '21

The stackoverflow developers survey seems to contradict your feelings on the matter.

https://insights.stackoverflow.com/survey/2019#development-environments-and-tools

I used 2019 because 2020 doesn't actually have a section on the survey for editors/ides and 2021 isn't out.

In case you aren't aware many popular editors have a rich ecosystem of plugins and said plugins and often offer much the same functionality one would expect from an IDE

1

u/5pectre5 Jul 17 '21

Yeah 25%, how is that popular?

1

u/Michaelmrose Jul 18 '21

Look at YTD Market Share Dynamics on

https://www.goodcarbadcar.net/2021-us-vehicle-sales-figures-by-brand/

the most popular car maker has less than 25%. This is entirely common for any market which is highly divided between many options. Indeed 25.4 is barely lower than 31.5 for the second most popular option.

What YOU said is that no reputable programmer uses vim in fact millions do. This proves that you haven't the slightest clue about the topic. If one views your post history this is entirely in line with the rest of it where you express strong opinions about topics you seem to know little about. Consider listening more than you speak for maximum learning.

-1

u/MrGOCE Jul 17 '21

TRY NEOVIM!

-1

u/[deleted] Jul 18 '21

I'm that guy..... who uses and likes nano. lol

2

u/Heclalava Jul 18 '21

Yeah I prefer nano much more than vim, gedit etc

1

u/[deleted] Jul 18 '21

A lot of folks use vim to show off. I think it is more work than nano and gedit.

0

u/[deleted] Jul 17 '21

[deleted]

2

u/zpangwin Jul 18 '21

This more than any other reason. It is powerful if you learn how to use it, but I can get by fine with sublime-text or even xed most of the time. But when you need to ssh into some old crusty Solaris server at work and can't use a GUI / install your own apps? When you are downstairs at home and realized you fucked up a line in your sama config on your upstairs server but still have ssh... vi will be way more powerful to use than pico/nano and less obnoxious (IMO) than emacs (but I suppose emacs fans probably think the reverse) and it be preinstalled on just about every Linux/unix/BSD system I can think of.

If you never need to ssh / edit files in the terminal, then you can probably get by with whatever IDE / programming text editor you like. But it is handy to know just in case you need to edit something in a non-graphical environment, which does come up here and there when you program professionally.

0

u/[deleted] Jul 17 '21

[deleted]

3

u/[deleted] Jul 17 '21 edited Aug 29 '25

[removed] — view removed comment

4

u/dwdwdan Jul 17 '21

I think it depends how your brain works, for me, a modal editor just makes sense, so vim is a lot more intuitive to me. (Once I got the hjkl movements I mean)

2

u/GOKOP Jul 17 '21

Nano only does basic stuff that every basic editor does. You can't delete entire current paragraph, you can't copy and paste the current line extremely quickly. Also I don't think nano has macros

3

u/inkman Jul 17 '21

Nano Editing

Ctrl+K Cut current line into cutbuffer

Alt+6 Copy current line into cutbuffer

Ctrl+U Paste contents of cutbuffer

→ More replies (6)

0

u/abraxasknister Jul 18 '21

No, since nano isn't good at editing text.

9

u/[deleted] Jul 17 '21

[removed] — view removed comment

6

u/zoharel Jul 17 '21

most of them use vscode.

Well, that's certainly not my experience, though I admit it's oddly popular at the moment in certain areas. It's also a Microsoft product written in Javascript, which is bound to make it a tough sell with the Unix people, for good reason.

0

u/[deleted] Jul 17 '21

[removed] — view removed comment

3

u/couchwarmer Jul 17 '21

Maybe five years ago. These days the multiple Java teams at work would probably disagree. VScode and IntelliJ tie for most used, leaving Eclipse in a distant third.

1

u/zoharel Jul 17 '21

Eclipse has been quite popular in general as IDE-type things go, and it has a good bit more longevity at this point than vscode. Still, I'd be surprised if no Java grogrammers used vscode. There not the pickiest of people as far as I've seen.

5

u/Drazson Jul 17 '21

No idea why you were downvoted, I was thinking along the same lines so I will have to order that downvote myself!

2

u/[deleted] Jul 17 '21

Vim is mega popular with redditors. Reddit isn't the real world, people would do well to remember that sometime.

1

u/[deleted] Jul 17 '21 edited Aug 29 '25

[removed] — view removed comment

1

u/Michaelmrose Jul 17 '21

Emacs has tramp which lets you edit local files with sudo and remote files with or without root privileges.