Ameba Ownd

アプリで簡単、無料ホームページ作成

Why vim is better

2022.01.11 16:08




















Transitioned from BBEdit to vim a couple years ago. Living in the terminal is an upgrade in itself, especially with tmux in the mix. A company, in the end, is always self-serving. Git control? Have you heard of Org mode? Have you read the calc manual? I think this is a bit harsh on vim.


Still, through extensions, vim offers autocomplete, code actions, refactoring, syntax highlighting, linting and the like. There are people that think Atom, Pycharm or VScode are better than vim or emacs. They either work in management or are tech journalists. Things that only programmers need to do like changing the first character of each line in a section of code, or repeating the last thing you did multiple times, or using regular expressions in search and replace.


An IDE is an integrated development environment. This contains lots of tools a programmer needs such as a text editor, a compiler, a run environment, probably a visual GUI editor, some sort of source code control. You can use it in any IDE. I never leave comments on things like this, but this blog post seems heavy on opinion and light on empirical evidence. You already have to learn your tool and plugins no matter what environment you use.


Hate using an editor that requires a mouse. Slows down my input, thinking etc but then I discovered vi in and used it every day since. I even set visual studio up to use it despite the limitations it then has.. I tried to use pycharm, php storm, vscode, but all of them seems too heavy to me, with vim my feeling is that the editor is really light.


This is a stupid post and reeks of ignorance. Vim can do anything any modern IDE can do if you want it to but.. The operating system is the ide. Vim is the editor. Vim can do code completion, colored highlighting, auto-indent, inline doc, jump-to, search and replace, run a terminal, execute terminal commands and insert results into file, multiple buffers, multiple panels with resizing and rearranging. All your IDE features were in vim first.


Atom is essentially a vim-inspired editor written in JavaScript with emacs style keybindings. How many times do you lift your hand from the keyboard and reach for the mouse in a coding session? And a big advantage of vim debugging using e. VeBugger, is that the exact same keybindings will work with different debuggers.


That means transitioning to a new language does not mean a muscle-memory overhaul. The same goes for autocompletion, finding references etc. Now, I use vim for both of these languages and the transition is seamless. Vim is more than an editor, vim is a language and a tool to translate intent into code. I can 2p to paste something twice, or 12yy to copy 12 lines. I can edit multiple lines at once, and substitute text using advanced regular expressions. All without any plugins.


I can move freely through the document without my wrist leaving the home row of the keyboard. Putting it short, learning vim gave me a super power being able to control the computer in the speed of thought. If you want me to switch to your editor, and tempt me with a vim mode, then you need to give me something in return. All the plugins I have fancied in VSCode or Atom has equivalents in vim either by plugins or just being native. And the only thing can see being awesome in VSCode over both Atom and vim is the git integration.


But again just using the git cli gives me more features, and allows me to simply type in what I want into my shell, and it will be done. VSCode and Atom are not like the new Playstation, where I need to purchase the new system to be allowed access to buy the new games.


VSCode and Atom are trying to take the fundamental graphical editor, designed for the computer illiterate person who does not want to learn how to command the computer, and tacking on programming helping features. This is great, I would have loved to have VSCode when I was in elementary school writing my first programs in notepad. So why change from a program designed to efficiently translate intent into code. To a methodology of writing where its simply designed to allow a computer illiterate being able to enter text into their computer?


Why change from vim to VSCode with the vim mode plugin, when it will use two magnitudes more memory, be slower, and require me to move the mouse around for the menu items? You need to give me something more than the new editor looking fancy, and telling me that my editor is out of date for me to want to switch.


It should be noted that most people who ended up using with vim have used IDEs before but finally moving to vim. I have personally used many IDEs in the past, and also liked them, no question. I nevertheless switched to Vim bindings at some point because that was faster for certain things. I even have my zsh configured to use vim bindings. You might say I have vim in the terminal stages pun intended.


Which can all be done in Emacs. Arguably Emacs has the best git interface of any program magit. Did you know SO runs in Windows?


I mean do you expect to learn how to be a power programmer from Windows people? I hate Google for suggesting this garbage article. All hail magit — it is truly a thing of beauty. These authors obviously have no idea what Emacs and even modern Vim are like to use. Agreed Atila. I think the big difference between most IDEs on the one hand, and vim and emacs on the other, is that IDEs typically target only one or two programming languages. That forces developers to learn how to configure and use multiple IDEs in order to be efficient.


I agree about Magit; in Vim there is a port called vimagit, which is also top-notch. Visual Studio and various other IDEs are doing half-assed attempts to match this. It is disappointing to see that Visual Studio thinks that svn names map to git actions, making their version very confusing to use.


Wow, what an acerbic gauntlet thrown to the users of Vim and Emacs — shots fired. I do wonder: are the authors sad that the Vim-vs-Emacs wars are cooling down, and want to stir up a new war? I started programming no more than 5 years ago. I started to use VSCode and whatever that looks pretty. I was hearing a lot about Vim but never tried it until I did. It was an eye-opener to the speed I could reach while editing code. Its such a huge inconvenience to go back and forth from the mouse.


Vim allowed me to shred my code while keeping my fingers at the home row. Sorry vim is not arrow keys but hjkl for single character movement.


If hjkl are arrow on your keyboard thank vim. I wish there was a 5-minute edit window here for when I post while half-asleep. Not really. How many people expected to learn something then realized 5min was wasted from their lives reading this? An similar article could make the exact same kinds of arguments, and be just as woefully misguided:. Why are so many IT professionals using Ubuntu and Fedora?


Why do F1 racecar drivers use custom racecars carefully optimized to their driving habits? Why do more advanced users invest time and energy to become more efficient than most people? But for those of us who want and need to be more precise than our mouse can be on screen, vim and emacs are the most widely available options.


Honestly, the people I see using IDEs are mostly working on legacy systems, and people using vim or other text editors are working on vanguard technologies. To a large extent, IDEs are training wheels. They lessen the cognitive load, facilitate adoption of unfamiliar technologies. But, like training wheels, they also limit you. I find some of the history behind the Emacs vs Vim debate rather interesting, but I was not even born in the 80s.


I found vi on my own during high school, I graduated in , and after climbing the rather steep learning curve, I now use it for almost everything. Most of the so-called modern tools do a lot for their users. And in my experience, I have seen many programmers that do not understand what their editor is actually doing. A good example would be managing git repositories.


Vim and Emacs both are extremely customizable, and any feature that one desires can most likely be found in a plugin. Also, the latest release of Vim is only from last year. Rather, I think the big divide is more of a philosophical approach; do you want it to do everything for you? Or do you want something that stays out of your way unless you tell it otherwise. I think the worst IDEs are the domain-specific ones because then you end up with like six different IDEs because they are very opinionated on what languages or tools they work with, specifically all the terrible embedded ones like uVision from Keil.


Also no mention of ultra edit. That was my go-to for a while in the early 90s on windows systems. Notepad is trash. For one thing, vim is always there well vi is , but emacs very rarely is. Vim is usable by anyone familiar with the key bindings whereas emacs without your personal customizations can be a nightmare.


For another thing, vim vs emacs is a meme that does not really reflect reality. One of the most popular plugins for emacs is evil-mode which brings in the vim key bindings. I came to both after being an avid visual studio, crimson, jedit, sublime text which I lectured on , intellij, and atom user. In fact most people I know making the switch are young developers. So why did I move to emacs over the darling of the hour vscode? Ever notice how vscode has no golden ratio mode?


No ability to position the terminal the same way as other windows? To split and rotate windows at will? I use it because for the most part, it makes me far more effective than the alternatives. There is much to be annoyed with in emacs and vim, but the newer IDEs need to mine then a heck of a lot more for ideas before I jump so again. I can easily switch to Kanji or ancient greek and create Anki cards to help me with both.


I can extend the editor and the UI, override anything to create a domain-specific editor for stuff no one is ever going to produce a commercial product to support.


Emacs is the Unix Philosophy taken to the ultimate extreme — it does one thing and does it well. Did I miss something? That is what Vim gave me, a way of thinking. Honestly what I want is the Vim-way of editing mixed with the modern way of organizing my editor. For now Visual Studio Code with vim mode is a quite pleasurable experience in my opinion. I have a unique take as someone that is just starting out in their coding journey. I dont really care what others find easier.


Its what I find easier and more comfortable. Not sure criticizing people for wanting to stick with whats fastest and easiest for them to use makes any sense. The article is low key trying to start something, but people getting angry over it clearly enjoy a fight, too. I have been programming for 25 years. Never once did I think that fingers were the bottle neck.


It was always the stuff between the ears. If typing is taking most of your development time, you are probably not doing it right. Modern editors and IDEs are great. The older editors are too archaic and have key bindings and design constraints based on limitations of the eras when they were developed.


The only proper use for them is in terminals where better alternatives are still not available. They are good to have around, just in case, but rarely the optimal choices. They are fallbacks. Use rmate with a modern editor. VNC in unless you are constrained by the network. Use productive tools, not tools that just have you doing busy typing to make you feel more productive.


People often confuse furious typing with productivity. Why do programmers use them instead of IDEs? Because they are IDEs. Game over. Back to IDEs. Knowling that I can break out basic vim whenever needed, like on a server.


Author makes a lot of baseless claims. Developer in 30s, work with many developers in 20s. Almost all of us use vim because it is so much faster once you know how to use it. All of us have used IDEs and rejected them. Vim offers power, speed, and fine grained control.


It can be customized and extended to anything modern IDEs do faster with lower resource usage. Not as clumsy or arbitrary as an IDE, it is an elegant tool for a more civilized developer.


Vim is a safe haven for every developer who has ever finished typing a line of text and stared despondently at the screen while the IDE struggled to display it a bloody character at a time. Vim is a swiss-army-knife that is not miserable to use over SSH. Vim and emacs are tools for developers who would prefer a more efficient tool that requires effort to learn how to use over a less efficient tool with a lower skill threshold.


My development environment is the terminal emulator. It already has the maximum degree of git integration possible. It can literally do anything git can do, and if you know how to use it effectively, it can do so faster than the IDE. Try buiding a phone app with vim. With vim I can have a consistent editing environment between all of those, including my own computer. However, to just say that vim, emacs, nano, etc are outdated points to a somewhat narrow perspective on the issue.


For new programmers, vim and the like can certainly be a bit awkward to start with when compared to Atom and other IDEs. The authors are talking about emacs and vim like they stopped being developed in the 70s. I have yet to not find support for a language or an environment while working with vim. Emacs is the epitome of customizable. Not to mention the sheer amount of hotkeys, macros, and extensions that you accrue over time using a single editor.


We get it… you like shiny things, just keep using it. Visual Studio streamlines just about every aspect of developing useful software, and vim streamlines every facet of actually inputting and editing text. I want vim to help me navigate text and type, which it helps me do really, really well. Who cares? You like VI, use VI. You like Emacs, use Emacs. Pick your poison. I find a multi-pane terminal configuration with Vim the most powerful development environment for my current needs.


I occasionally fire up VS Code to work on Jupyter notebooks. Trying to open a data file of a few tens of megabytes on these modern magic editors, you will find that the program will just freeze. I also once tried Atom, which was unbearably slow to just start up. This is really weird. Have you tried Emacs lately?


I has support for LSP, code completion, git, multiple-cursors, project management, linting, real-time LaTeX preview, etc. You can edit it as regular text, search in it, etc. When you save it, your edits are propagated to the underlying files. I did a grep for the name of the function, placed one cursor on each line of the result, used a keybinding to flip the arguments on each line, saved, and I was done.


The only difference with Atom or VSCode is that the whole IDE is built around text, which means that you can interact with all of it with normal text commands.


Vim is great. Everyone wants great editors and everyone wants a thriving editor scene. Making it even better, if you want to do something programmatic with that web browsing, feed reading, email, whatever it is: typically having it implemented in Emacs makes it possible to further script as needed. To get extensions in most other editors requires either building a plugin or calling out to an external process.


For instance, if for some reason you wanted to write a server for testing your web code in real time, you would write it in some other language like Node and then have your typical IDE call Node… but in Emacs you can literally just pull down the web server package and spin up your server in the editor. Though you just about could.


Simplest possible example, think adding tags to your headings and being able to search by tags. Small feature, more handy than it sounds. You can actually add arbitrary programmatically accessible data, and timestamps support various scheduling tools. Some people learn Emacs just for Org Mode, and while I will say it took me a while to learn it, I can also say I recommend as strongly as possible giving it a try.


Back in the day I was writing code for mainframes, workstations, PCs, and even the odd embedded microprocessor system. Uhm, screen latency? Even Vim users break out an IDE from time to time. But all the featuritis does indeed come with an usability price. Not everyone can put up with it all day long, whether they realize it or not. I have used simple editors like geany, gedit even notepad sometimes. I have used heavyweight IDEs like eclipse, netbeans, visual studio, aptana studio, intellij etc.


The i found visual studio code, and i thought, wow, its great, i have finally found something simple but feature rich or at least has the features i need. I have used vscode for nearly 2 years. I loved it. Then came in Microsoft, started to mess around things. In a simple one python script editing session, i found my computer hanging over and over again. After investigating, i found the reason was the ms python language server was taking nearly 6GB of ram.


It was just little script, a Qt application. Very tiny script to be honest. But the ms language server was eating up every bit of ram it found. May be it was some bug may be something else was wrong with it. I was getting frustrated about it.


It wasnt just the ram, vsocde and its extensions were killing my processor too. So i started looking for something else. I know about vim and emacs from way back, but never used them in anything other than command line editing. I started learning emacs, from tutorial to intro to elisp.


Soon i realized, emacs is not an editor! Its a freaking editor framework! So i stayed with default emacs and built up from that. Now i am using a lot of packages, customized to meet my needs. I could even use different language server for different buffer even for the same language.


I had to use eglot for a python script as lsp was too slow or incomplete with any supported server for that script. It was a simple gtk app. Anyway, the daemon mode is too cool. And the org mode! Damn, its just awesome. I am still discovering stuffs about emacs, and the more i am learning the more i am impressed by the extensibility of it. I have uninstalled vscode, wont touch it again. The idea of telemetry within an editor and its extensions, bothers me. I have used vim, its awesome too.


But i think i am gonna be stuck with emacs and i will keep loving it. First a few points about your article itself. Also a few points you conveniently, or because for lack of knowledge? And spent as much time in it as in an IDE? Man is it fast. For everything else? For goods sake be glad that there is choice. Vim invented properly composable commands that are only now starting to get properly appreciated.


Muscle memory works both for you and against you — some people have no idea how irritating it is when programs like Gimp will not open a file when you press ALT F O but fail to take your finger off the ALT key before pressing the O.


I agree. The new generation of programmers really need to pull up their socks and actually learn Emacs or Vim. I use vim a lot, after you get over the steep almost vertical! But the reason I learned vi was because I had to. Stuck in a cold data centre with a sev 1 at 2 a. You could be pretty sure that everything but vi was stripped from the production servers and worse ksh was in vi mode. Once you know how to cook, use your favorite knives, but stop spitting on the other ones. Waste of time. You forgot one thing — each developer has different needs.


Many IDEs, like Visual Studio or the ones from Borland or Jetbrains, tried to be an all-in-one development environment, not only an editor. For a beginner, the ability to discover and use all that, in an intuitive way, was the main advantage.


What a ridiculous article. Thanks to its communities both vim and emacs are easily as powerful as modern IDEs plus having the potential benefit of being heavily customizable.


I tried a bunch of IDEs at different companies already but there is always something that I find inefficient or even annoying about them which makes me come back to vim. But why? The other IDEs are all the same and are not better at all. There is a reason vim is still here and every other old editor is gone yeah emacs has not a lot of users left. This article does not explain at all why vim is still around.


It does argument for a statement it denies itself. This is highly subjective and unscientific. VIm is still a thing because it is another better approach to text editing. No new IDE has it. Even the ones with vim keybindings only emulate the approach and will never be as good and mighty in it. The mistake you do is seeing a text editor in vim. It of course is a text editor, but it should not be seen as one.


It should be seen as a text editing language. You just tell vim what you want to do with the text: c hange w ord, d elete w ord, y ank p aragraph. And so on. It is easier to remember and easier to think of.


It does not break your flow of thoughts. Plugins do work the same. I use IDE and vim. The Jetbrains products PyCharm, et. I use vim in a terminal for quick and dirty edits, or working through an ssh session. I use PyCharm for more complex tasks or debugging. I still use Emacs for some things and vim for others. Glad I know them. I usually use Visual Studio Code for PowerShell development and Visual Studio for C for various reasons including supporting existing code bases that were developed with those tools.


There are advantages and disadvantages to everything and there are no exceptions. If you love Lisp as a friend of mine does, you may absolutely love Emacs, for instance. Also in my development group, most programmers are barely proficient to start. It helps us generate more uniform coding. He is Emacs Window Manager. The power is unlimited, trust me. Which one is still useful? The reason experts continue using the tools they trained on is because they are experts.


And, so, she goes back to the violin. Text editing is insanely efficient in vim once you have the right plugins in place. For git integration, vim-fugitive is excellent so much so that when I do have to use IDEs I still switch to vim for staging hunks of code and resolving merge conflicts. By doing so, instead of dropping my pinky to the CTRL key constantly not a comfortable key to hit , I can stay in the home row all day without tiring myself out.


Food for thought…. I use Vim for the last 5 years, with some plugins, and I love Vim. I have linters, git integration, colors preview in CSS. I have experience with IntelliJ products, Atom, VSCode, but I love that Vim is easy on system resources also saves the battery , can be found everywhere, effective. And Vim is free, open source.


I usually see a demo with some feature that looks like the killer one that will make this IDE my new favorite too. I have always come back to vim for several reasons and I would imagine, emacs users will say the same. It may work a bit different but in the end gets the same result.


Anyone that has been developing software for more than a few years most likely has several languages under their belt. Collectives on Stack Overflow. Learn more. What are the benefits of learning Vim? Asked 12 years, 8 months ago. Active 5 years ago. Viewed k times. Not having to switch between keyboard and mouse is definitely nice. It is totally worth the effort.


Learn vim ; — Kyle Walsh. You can learn basic vim forget about vi in couple of minutes, just type vimtutor in terminal and you'll be set with the basic - what you learn in the next 20 years is all up to you. One of the best investments I ever made. I created this game to help my seven year old nephew learn to move around quickly in Vim: kikuchiyo. I found moving around the most difficult part to get used to. Hope the game helps speed you up, if you need help : Good luck!


Active Oldest Votes. I've been using vi and vim also for some 20 years, and I'm still learning new things. Yes, I'm always learning new things in it too. Still my favorite editor too. I wonder if that is a good thing or a bad thing. Anyway, if you wanted RISC, you went with vi instead of vim, right? Paperflyer: I had the same thoughts. If you still haven't mastered it after 20 years, that's a headache I'm not sure I want — Dinah.


How so? It means that while it has so much features you can keep learning, but you don't have to learn them all to be more productive. Show 7 more comments. Could I live without it? Is it useful? Reasons for Learning vi is guaranteed to exist on all Unix systems and exists on most Linux ones as well. You don't have to be a master. Just learn The basics: How to switch from command mode to insert mode i How to switch from insert mode to command mode Esc How to navigate up a line in command mode k How to navigate down a line in command mode j How to navigate left a character in command mode h How to navigate right a character l How to save a file :w Enter write How to exit without saving in command mode :q!


I've always used "vi is easy; you use the ell key to move the cursor right" as a humourous I hope way to introduce it. But I've been using it a long time and wouldn't be without. This is how I learnt it. Start with the minimum and build a little on it each day. Take the time to learn a slightly better way of achieveing a task. See the "7 habits of highly text editing" for inspiration.


Gmail, Google experimental search keyboard shortcuts, Slashdot keyboard shortcuts, man, and less all use vim-like bindings. It surprised me to discover I had accidentally learned these without knowing vim! Show 6 more comments. If you know of a better explanitory link, please change mine : — Blorgbeard. I did it everyday for about 10 days.


First time it took me about 30min, the next day 20, then By the end of the week, I had most of its command imprinted in my mind.


I think rather than trying to memorize, repetition is the best way to approach Vim. What's the next step to learn more? It was right there in my system and I didn't know it existed. One of the most useful and quick tutorials of vim. Using vim for a while I still learned a couple of basic tricks I didn't know about.


Also a little suggestion: if you are using vim on a laptop that has a touch pad and it supports gestures, disable it before using vim because if accidentally touched it can move the cursor to unexpected places sometimes wasting an entire good edit.


Show 2 more comments. Have fun! Ryan Bright. This has a point in it that many people overlook. Almost any repetitive task has a shortcut. Developers love shortcuts. As rbright said, if you find yourself performing a step repeatedly, stop and see if someone's already documented a shortcut. VIM is ubiquitous, small, and fast. My editor is constantly making bad jokes.


I should switch. You had me at, "If you're a programmer who edits a lot of text, then it's important to learn an A Serious Text Editor.


You're studying edge cases at some point, and the knowledge of how to accomplish Task X in one doesn't usually translate. Your main is a roll of the dice, and there's no silver bullet, but yes, absolutely learn one and play with many.


It's really the same as with touch typing: you learn one keyboard layout, and you stick to it because you'll never be able to stop your fingers from typing the wrong keys on an different layout.


Show 1 more comment. It's definitely worth the effort. Here's the obvious one: vi is at once ubiquitous and incredibly powerful, and by learning it once, you gain the ability to exercise that power on pretty much any computer that has a keyboard. And these are the lesser known reasons to learn Vim : It's not half as much effort as you think it's going to be. There's also two good reasons not to learn Vim : It's addictive, and you'll find yourself wishing you could use Vim commands in all your computing, and cursing whenever you can't.


Haha number 2 on reasons "not" to learn VIM is so right. All that time I save text editing, I spend reading about text editing. Yes, I wished I could play stardew valley using hjkl Add a comment.


As to how to start, just dive in and start using vim for everything. Norman Ramsey. RSI is the one occupational hazard of developers. I never thought of it that way but I bet this is a really good point. It's a lot harder to type chords from a muscle standpoint. I knew there was a killer reason to use vi! I've used both, I was "baptized" with vim, and learned emacs a few months ago.


I prefer vim because tasks are broken up - you're either editing or inserting, not doing both. This distinction helps me think about what I'm doing, as well as makes the "normal" commands key strokes, instead of I just wish vim was Lisp based and no, viper mode fails to support all my vim standard features.


WayneWerner I'm really outdated, but you could version controll all your elisp so you could sync them through computers. YuriAlbuquerque, I've actually begun to think very seriously about creating an auto-environment setup script, keeping all my dotfiles on github or something.


To save you need to get out of typing mode Esc type a colon : type lowercase w then Enter To save-and-quit you need to get out of typing mode Esc type a colon : type lowercase wq then Enter To not-save-and-force-quit you need to get out of typing mode Esc type a colon : type lowercase q! Gabe Moothart. Theo Lenndorff. There is a visual studio extension for VIM users, see it at visualstudiogallery.


I learnt vi because I had to. My crazy teacher forced us to learn to program in C using a terminal to an AIX system. It was a real pain, but worth it. I had become frustrated with a workflow where I would write a test, switch windows to the terminal to run my tests, and then switch back again to make them pass. This has radically changed my TDD workflow — now with one press of the Return key, I can run my tests, immediately see their results and press the Return key to go straight back to my code.


You can use Vim with Tmux , a programme which allows someone else to SSH directly into your computer, and not only see your Vim screen on their computer but jump in and start editing as well. Originally published at blog. Creating a new generation of tech talent. Ready for the changing world of work. Sign in. Why Vim is so much better than Atom.


Leo Allen Follow. Makers Creating a new generation of tech talent. Coder, coach, Teal advocate.