Should i learn vim
For example:. But what if my changes require multiple commands? Enter macros. Pressing q again stops the recording, and I can now use a to repeat that macro anywhere.
In my example above, I picked a for where to store my macro, but you can pick any key. Once you get to the level of using macros in Vim, you start to feel like you have a superpower! You can predictably and repeatedly alter complex text. With macros at your fingertips, working in Vim becomes even more productive. But be careful! With great power comes great responsibility, and macros are no exception. Just like with coding, recording a macro requires precision to make sure it works predictably in all cases.
They could backfire if you create them too loosely. Vim supports plugins to add more functionality. It would be impossible for me to list all the possible Vim plugins you might use. Some of the most popular plugins include:. Beyond plugins, you can tweak anything else you can think of in your vimrc so that your editor is tailored to your preferences.
Wanna see my vimrc? 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. Even those with a good plugin architecture often work very different with each language.
And adding each plugin usually adds a lot of overhead. To master one tool instead of spending massive amounts of time always searching for the perfect IDE. And use that extra time to read articles on software development, design patterns, algorithms etc.
Of course, IDEs have some support for keyboard shortcuts, but its as good as mouse support in Emacs. Its terrible. Its impossible to not use mouse in IDE and its impossible to not use keyboard shortcuts in emacs. Second major Emacs advantage is its unparalleled extensibility and explorability.
All emacsers use heavily customized Emacs to their needs because the price to do so is small. Both do the same thing, but latter a lot more effective. All of the GUI features are just noise and inefficiency from my perspective. Most, if not all, of the revered features and plugins and features in VS Code and the like can be accomplished as competently, and probably more efficiently, with a little bit of Vim customisation.
Admittedly, the initial learning curve presents some challenges until you can fly, but once you get over that hump you really can fly. And for me, the grammar of Vim continually provides inspiration. I think it has the best UI of any application I have ever used — seriously. I find it interesting how SpaceVim has made this attempt to get the best of both worlds. I only wish I could integrate that one idea from SpaceVim without also taking in all the rest of their config.
This might be forgivable if it stopped there, but to go further and say:. You seem to have missed the part where Emacs can be integrated with absolutely anything. This quote is self-incriminating in a sense as it reveals the attitude that code is nothing but keystrokes, sold by the pound-per-minute and that refactoring is some indulgent sin.
Not just a clutch of text files that are fulfilling their purpose out of sheer coincidence, forever accruing complexity as changes are incrementally piled on in haste. I think of it as a risk to business continuity for the vast majority of companies out there.
All to compensate for the absence of editor code awareness which — to me — is a metaphor for analysis and reflection. Inevitably, there are communication pains and gnawing deficiencies in onboarding that are either never organically encountered lucky! I make use of Visual Studio Code as a notepad replacement or for small projects where the deliverable is more declarative than procedural terraform, docker compose.
As noble as they are, text editor puritans are immediately at a disadvantage, even in the simplest of codebases. Use what you want in the end and show me that it can work in the merge reviews.
More importantly though, we might even benefit from having to hear less about vim…. This resonates with me, although it comes from the other side. It is a shame when, in one way or another, the project structure is affected by the personal choices of development tools.
Developer should choose whatever tool they want, and configure the tool to do the job, rather than configure the job to suit the tool. Not only do I use vim, but I use pretty plain vim. Which kind of proves my point. Again, proving my point. But my experience is that people waste too much time on them. You and your friends have never tried Docker?
To grasp the nature of that you need to read between lines in the mind of their creators, Dennis Ritchie, Brian Kernigan, and others. The traditional tools available there editors included are fast, lean, stable, and have decades of work done to refine and perfect them, and they can easily be composed together to do anything you would want out of an IDE and more.
Learning new tools take time. Well, why not just an IDE then? By starting with Vim and adding plugins as I go along, I can try out alternatives and make my own choice. The result feels more like home, and reflects my manner of thinking.
From time to time I change plugins, or throw some away. My OS already has a terminal, file manager, and search tool; yet the IDE crams in their own versions of these. The terminal, filesystem tree, and console are all cramped. When I use a separate applications the OS is aware of them, so I can manage them using my window manager, task manager, and fuzzy-finder thing. Of all my reasons for avoiding an IDE, this is the most important one.
I use many of the keyboard shortcuts from bare Vim, and have a few leader-key mappings for some commands I use a lot. A I used to fire up NetBeans just for step debugging. Nowadays I use the Vim VDebug plugin. B Project-aware code navigation, and auto-suggestion.
Nothing in the article backs this statement. Personally, I think vim keyboard bindings are great. Interesting article. I come from an Emacs background but have recently switched to VS Code. I love Emacs and have done for two decades — the key bindings and customisability has meant I invested deeply in it.
I will continue to use Emacs for text files. My blade Swiss Army Knife is in my toolbox — somewhere. I committed myself to mastering Vim during lockdown. Can anyone master Vim fully? Refactoring in vanilla Vim is way harder, if you gotta get plugins for all the languages of choice, then better go for a full featured IDE. That being said, I think knowing how to use Vim at a basic level is an essential skill, due to this omnipresence of the editor in Unix systems.
Being able to code comfortable for a few minutes with Vim lets me do some quick hacks in servers without having to scp the content… develop in my full IDE and upload back. Vim is very powerful indeed. And I highly appreciate its features when I require them. I have always been shocked at how little people who edit code for a living know about their editor — regardless which editor they choose. I doubt that this changes much with an IDE. I think the difference is if a team is required to use an IDE then someone else has made this all work for them and only through the IDE can they get necessary resources.
That said, I put quite a bit of effort into getting Eclipse working at a company, and since I could not make it mandatory, no one started to use it. Including me. It was too much trouble to keep it working just for myself, so I stuck with emacs. Do IDEs really make most coders more productive? I am not so sure. The folks that only know how to copy paste, search, and save are not commenting or even reading this thread, so we are really only preaching at the choir here.
When I began to study programming, using vim for that as well came naturally, but I have been open to alternatives. I clicked this article expecting to learn some of what makes IDEs so useful, or maybe some advice for when to use an IDE over a text editor.
Instead I learned nothing. This article reads more like notes the authors took about the available options for code editing. Oh, and occasionally whatever that depraved stuff inside Excel is. Others have their entire build infrastructure locally.
Installing random IDEs was not possible. Or I could open 3 ssh windows, one for vim, and the others for running the code and watching logs. Vim is for people who like Unix, and who think in Unix ways. And just think of spacemacs, or neovim. So what remains of any of the quoted arguments then?
Is maybe the IDE the lazy, dated way to code at the end? Please scrap this, and try again when you actually looked at how advanced users use vim and emacs, and write a properly researched article and not just a hit piece. I love the shit out of Vim and use it all day, every day. But not for developing complex applications. IntelliJ is like having a co-pilot with you during development.
It gives you true comfort. Vim however makes you feel like Neo in the matrix. It's easy to find vim alternatives, including GUI applications, with these supposed great features - and more. The most significant, real benefit is the ubiquity, and the ubiquity is a function of tradition, vim's size, and its portability.
This leads to its use because its 'the only option, not because 'its the best or even good option'. There's no arguing against the benefits of the ubiquity; its on almost every device that runs linux or unix like OS. What really separates vim from the real day-to-day competition is the abysmal usability. From the complete lack of visibility and discoverability to the numerous modes, vim is a hall-of-shame when it comes to UX and UI.
I don't think it's fair to ask every user to read the man pages, read a book, take a class, or go through a tutorial on how to use vim. If most users can figure out notepad. I find most evangelists of tools have jumped from some feature anemic tool notepad. Nothing could possibly beat the amazing tool they use now! JetBrains tools are less ubiquitous than vim, and sure take up more disk space. But the usability and power, as far as I can tell as I am no vim expert, far exceed that of vim.
If I'm going to pick a daily-use tool, it's not going to be the one so small it fits in the tiny memory of my router, I'm going to pick the tool that with the most utility. The original article should simply say "In many cases, vim and emacs are your only two options. When you are forced into that corner, you better know at least one of those two tools. You should learn vim because it's the just barely easier to use of the two ubiquitous editors. I think if you never bring up a barebones Linux e.
But being able to connect via serial port to some crappy stripped down Linux and knowing vi is there is a good feeling and it asks nothing of you in return. But I'm old now and can't really imagine life without my init. You should learn vim if you want to deal with systems. You can learn vim or not if you don't. Now, while they have forward compatibility, of sorts, vi and sh, the same cannot be said in reverse, as a rule.
Modern bash folks have bent bourne shell syntax into foreign looking contortions where bourne shell syntax is a performant and conformant, b a lot simpler when simpler is better and c is why bash maintains posix. I agree, learn basic vim. And bash. But not really to program with.
It's more of a burden than not for a million languages and formats. One useful configuration was changing the command mode key to a single letter.
This way you did not have to switch back and forth between escape. Additionally, for people who have hyperhydrosis, which drastically hinders laptop touchpad usage, vim is really useful for navigation. As for vim itself, it is perhaps more effective to use a modern text editor rather than Vim as it is was a bit of a hassle to get it set up. Vim is very useful, and its good to see more encouragement for it in modern software development. It ain't that difficult.
The editor we used to write code was vi not vim. The clients had no prior experience of it, but by the end of day one of the course they could write programs using it - not without a lot of complaining, it must be admitted. Perhaps people were smarter back then? I use it because vi is everywhere. The busybox implementation kinda sucks at times, but I can't complain given that they've obviously focused on size.
Although, surprisingly, most command-line interfaces and command-driven apps like redis client and psql use emacs key bindings for command history. Most command-line interfaces use the readline library. This isn't a deliberate choice though on their part, is it? Isn't it just a consequence of everyone depending on readline and readline using emacs-style key bindings? Uehreka on Aug 5, parent prev next [—]. If I need to change a config file here or a script there, nano can do it.
If you work with embedded linux, nano is almost never there. Don't show at work without it. I find that most passionate vim advocates have spent a lot of time learning, using, twiddling vim and the investment has paid off and now life is great. Is that a point for vim or his persistence? Speaking as an inveterate vim user.
If it warns you about not saving, try ":wq" to save and quit or ":q! If this is in the article video I apologize, but I did check and it's not in the article text.
JadeNB on Aug 5, parent next [—]. This vimmer is always inclined to laugh at tutorials for how to exit vim … but then I remind myself that I still have to Google how to quit emacs whenever I stumble into it. Havoc on Aug 5, parent prev next [—]. That's also the sequence that persuaded me that vim isn't for me. Can't even close the editor without memorizing some arcane keystroke sequence?
Hard pass I get that it's efficient once mastered but I just can't push that kind of thing to the top of my to-do list. I'll spend my time learning French or something. I use vim because it's guaranteed to be installed. The version installed at work is from but still.
AndrewOMartin on Aug 7, prev next [—]. EX mode How to get there? Press Q in normal mode. What is it about? To punish you for trying to type while still in normal mode, or for having fat fingers.
An opportunity to type "visual" to go to Normal mode. Larry Tesler would disagree. There are so many of these articles, why write another one? Because they're popular They're fluff. Somewhat easy to write and generally find an audience in both the users and the wannabes. I didn't submit this, but it makes me wonder if emacs and vim will go the way of the dinosaur without new hackers seeing articles like this.
The internet and our industry has a short memory, so if we're not seeing occasional articles evangelizing these technologies then they're actively losing mind-share, which would be sad. If the article is worthless the issue isn't with the author who has written it and posted it. The issue is with HNers who have promoted it and highlighted it.
Content marketing. You write articles with the aim of getting people to sign up for your newsletter. Mandatory GPT-3 comment. Are you implying the article is auto-generated? Your comment is a bit vague Oh for a good stress good orgmode for vi m.
I moved from Vim to Emacs and definitely prefer it as a minimalist editor. Oh look, yet another Vim nerdgasm. Fred27 on Aug 6, prev [—]. Learn Vim in Hacker News new past comments ask show jobs submit. Why Should You Learn Vim in pragmaticpineapple. LeonB on Aug 5, root parent prev next [—] I read this comment 20 minutes ago and tweeted about it. Onawa on Aug 6, root parent prev next [—] Oh my god thank you so much for posting this! Keyframe on Aug 5, parent prev next [—] Thing is my vim setup is different than vanilla vim, and probably the same for lots of other vim users.
Please let me know if there is a way to do this as quickly and painlessly in other editors. The following command is 8j , letting Vim know that I want to go eight lines down. Then, I press s to substitute a character, and I type in the character t , which I want to put there. Finally, I press Esc twice, and the whole column is changed. You can see that I then press u to undo my changes. I learned it when I needed it. And that is another great thing with Vim, the constant learning - you can always uncover more great ways to do things.
It is not a mere coincidence that most popular websites Facebook, Twitter, Gmail, Tumblr allow you to move around with h , j , k , and l around the feed. Try navigating through tweets on Twitter by pressing j and k next time. Instead of having to use your mouse, you can use a combination of key presses that let you jump around the file with ease.
For example:. These are just the basic movement tips you can try out in your next Vim session. I will not go into details on how to move around, and how you should disable arrow keys on the start you probably should , there are many resources for that on the internet. I will just leave you with these couple of navigation shortcuts for you to try out. Also, you can compose commands as you go.
In the previous section, I used 8j to move eight lines down.
0コメント