7 ms·
Vim. I think it can be in the list as well. It takes a long time to properly learn. But one hours is defiantly enough to get to know the main Vim bindings, to
by timvisee 7y ago
Vim.
I think it can be in the list as well. It takes a long time to properly learn. But one hours is defiantly enough to get to know the main Vim bindings, to be as productive as in other editors. In the end it makes you super productive.
- alpaca128 7y agoI've been using Vim for over 5 years now for as much as possible, and it started exactly like that: I looked at a couple of the most basic shortcuts(Esc and i to switch modes, :w and :q to save and exit, hjkl to move the cursor), just started using it for editing files and looked everything else up when I needed it. Over time the stuff you actually need regularly sticks. Nothing has influenced my use of computers as much as Vim, and I'm really glad this tool exists. It makes editing text a great experience, and has a couple feature you can't find anywhere else(not even Emacs offers such a flexible, intuitive keybinding functionality or reliable, quirk-free controls).
- xk3 7y agoI still don't get the appeal of vim or modal text editing in general but I'm glad you can close vim with shift+zz
- fbnlsr 7y agoSerious question: I keep seeing Vim thrown up and down like it's the holy grail. I've been using VS Code for two years maybe now, and I don't see how Vim could help me be a better/more productive coder. What am I missing?
- kamek 7y agoTo put it simply, it's just a very efficient way to manipulate text with a keyboard. Once you get accustomed to it, writing and especially modifying text without it seems laborious, almost like you're writing with your wrong hand. The problem is, the opposite is true until you reach some level of proficiency. Until then, vim is hard to get used to. I know I haven't provided a concrete answer, but many blog posts have been written on the matter. I personally started learning vim by running through vimtutor once a day as part of a New Year's resolution about ten years ago.
- 02abhishekjain 7y agoThe vim key bindings can help you write code faster and more efficiently. Try the vim plugin for vscode. It's pretty good.
- criddell 7y agoI'm always skeptical of this claim (and yes I do know vim fairly well). Programming isn't that much typing. For every burst of typing there's probably an equally long or longer lull where you are leaning back and looking at the screen or sketching something out on paper. If your productivity is limited by how fast you can type then you are either a far, far better programmer than most people or your skills are being under utilized.
- xwdv 7y agoVim commands are more than just typing. It’s searching, deleting, replacing, selecting, moving entire lines of code. I can get to any location in a massive codebase within seconds. I can drop the cursor to any character I see damn near instantly. I can construct entire macros on the fly and repeat them endlessly until I’m satisfied and destroy repetitive tasks. I can move entire sections of code to anywhere else I please, just tell the line numbers and it’s done. I don’t even have to open the files. When you’re working really fast in Vim it’s easy to get a high from the amount of code you are slicing through. In short, classical editors are like a ball and chain for developers trying to get shit done, and I cringe every time I see a developer using a mouse or trackpad while working. It’s so slow, so inefficient, I can’t stand it anymore. I need vim-like shortcuts in every application I use.
- criddell 7y agoYou say it's more than just typing but then you go on to describe a bunch of stuff that's essentially just typing. I think just about any modern programmer's editor can do all the things you describe. I work most of the day in Visual Studio and I know it can do all that. For programming I think vim is handicapped somewhat because it doesn't "understand" what it's working on.
- deleted 7y ago[deleted]
- buboard 7y agoit's also a different "way" of working with text: it feels like photoshop, or a game, with the keyboard being your joystick. The command keystrokes are as compressed as can be, and having regexps literally at your fingertips all the time helps maximize their benefit.
- atonse 7y agoThis is how I explain VIM to people (although I used to use it full time, I now use Atom with the VIM plugin): Most of what programmers do is a lot of navigation and text manipulation correct? In normal scenarios, what keys are available to us to do that? Just the arrow keys and modifiers (Ctrl, Alt, Command). But what if we had essentially the entire keyboard available to us for either text manipulation or navigation? We could move around or manipulate text in more efficient ways because we have more keys available to us to do different things (like say "delete until the next closed parenthesis" rather than control shift right-arrow 20 times). That's why VIM is useful for programmers or anyone who manipulates plain text all day.
- shantly 7y ago> Most of what programmers do is a lot of navigation and text manipulation correct? Possibly I'm a terrible programmer, but most of what I do is thinking and looking shit up. Entering or modifying code, and navigating non-linearly within one file is like... a couple percent of what I do on an average day? Maybe 5% tops? Some days it may get as high as 20% of my time. Maybe. [EDIT] add "communicating", broadly, to the list of things I do a lot of at work that's not editing code.
- benji-york 7y agoYes and no. Feedback cycles are important. It's better for a test to fail than to notice a bug in production. It's also better for you to be able to get that thought from your head to the file in 3 seconds instead of 10.
- KlayySOC 7y agoDoesn't a modern IDE with context aware autocomplete help more with that than slightly faster text editing? Perhaps it also depends on what kind of development you're doing
- bloopernova 7y agovim has its roots in a time when ed was widely used on teletype style user interfaces. The idea was that you didn't have a continuously-updating screen, so conservation of keystrokes and screen updates was very important. It just so happens that this paradigm (which is a much-maligned word!) is still useful today. You interact with text in a couple of different ways, which vim maps onto "modes". You type in text, you select text, and you transform text. Insert mode, where you type in text, is how most editors work these days. Let's look at an example, I hope I can do this justice: You've been asked to refactor and update some code. In vim, you open up the right file and you hit '}' a few times to jump down "paragraphs" to get to the right spot to add your code. You hit 'i' to enter insert mode, then type in the extra class methods or whatever you need. Once done typing, you hit escape to exit insert mode. Now you have to remove some methods, so you type '/' to search, followed by the method name, then hit enter until you find the right part of the code. You hit '^' to go to the beginning of the line, then you hit 'd}'. That's the combination of an action 'd' and movement '}'. That removes up to the next blank line. Now you need to update places within this file that reference that method, and update them to the new method you added. You type ':%s/productComponent/productExponent/gc' which is a search and replace, 'g'lobally with 'c'onfirmation. Once the changes are made, you type ':wq' to write the file and exit out of vim. Your consulting firm charge the client $50,000. And your hands didn't leave the keyboard to mess with the mouse. Think of vim like a computer game where you have to learn a bunch of moves, or a simulator where you have to learn a lot of key combos to control a spaceship or aeroplane. I hope that helped, I don't advocate trying to jump in and replace vscode with vim immediately. But definitely install vim and try some tutorials and experiment with your normal workflows to see if you feel it is a good match to your keyboard usage/style.
- Keloo 7y ago> I keep seeing Vim thrown up and down like it's the holy grail. It's not. People tend to be religious about their choices, you can achieve the same result in any editor. Also most likely the bottleneck in your productivity is not the speed at which you manipulate text. Anyway I will highlight few things that I consider great about vim. 1. It's more about consistency. (vim shortcuts are used in a lot of other places, ex: linux commands like `less`, `screen` etc.., tmux or other pane manager, etc..) When you learn linux you start to get a feeling about it, at some point you enter a command you somehow magically know the shortcuts to navigate/close/search inside there, Vim feels like a complementary thing to the whole linux environment knowledge. 2. It is everywhere! You need 0 time to prepare your work environment if you switch your job/workstation, and you also don't need to exit the remote machine/datacenter to write your stuff. You basically ssh into the machine[s]/datacenter and there you go, at the end of you day you just detach from the session, go home, and next day attach back and continue, all the commands, fancy log searches, processes monitoring, everything is there still running and waiting for you. P.S. I also use VS Code sometimes especially for pet projects.
- NotATroll 7y ago> What am I missing? Touching your mouse less. Might sound weird, but that's honestly my main reason for learning modal editing and emacs with evil. Less flip flopping between mouse and keyboard might not be "more productive", but it's more comfortable. And beneath that you start to find better fuzzy project searching with tools like ripgrep, an easier time navigating your project, powerful in-file movement commands, etc. I'm mostly an emacs evil user, so I also have workspaces, projectile, magit, and a whole host of other extremely powerful tools. And I don't really lose out on much wrt code completion, or other functionalities you normally get from an IDE. Since I can use the same language servers you would use in vscode. That's not to say there aren't things that suck though. Emacs in particular isn't for someone that's unwilling to make changes to their config.
- hombre_fatal 7y agoimo, the best parts of Vim are its shortcuts which is why I am happy with only Vim-like keybindings in other apps and don't need them to impl the whole kitchen sink. For example, right now, how do you make a blank line above your cursor and move your cursor there? Do you maybe go ctrl-a to move the cursor to the front of the current line, carriage return to move the current line own, then press up-arrow to move your cursor to the new, empty line? In Vim, it's just capital O. lower-case o to create an empty line below you and move your cursor there. And I could go on for all sorts of simple tasks that have most people reaching for their mouse. Entry-level Vim keybindings just make these basic tasks more pleasant. I got pretty hard-core into Vim when I was in uni and had time to care and credentialize in Vim. Nowadays, I'm switching between so many editors that I'm happy just using basic Vim keybindings.
- KlayySOC 7y agoMaybe I'm missing something, but wouldn't ctrla+a select all text? To add a newline above, I just press home and enter. For newline below end and enter. The keys are right next to each other. Vim doesn't seem more convenient for this case
- stjohnswarts 7y agomore things are available from the home row than with typical windows editor keystrokes; less pinky and more big 3 finger locations than in your typical windows editor keyboard shortcuts as well. Also once you get the basics down you can learn more powerful keystroke combinations than you ever imagined on windows text editors.
- flylikeabanana 7y ago"Your problem with vim is that you don't grok vi" A perennial answer to this question: https://gist.github.com/nifl/1178878 https://gist.github.com/nifl/1178878
- weaksauce 7y agoTry the vim extension in vscode. It’s pretty good for about 75% of vim. Definitely good enough to be useful.
- newman8r 7y agoIf you're just coding, you're not going to have as much use for it as someone who spends a considerable amount of time in a terminal - but at that point it becomes a vital skill. Still, I always use vim plugins in my IDE, it's just not as useful there, but it can save a small amount of time depending on your level of vim skills.
- stjohnswarts 7y agoI use vs code with the vim plugin and it's a happy medium. It's certainly not Vim but it suffices.
- Liron 7y agoI recommend VS Code plus install the extension for vim key bindings
- jakobegger 7y ago> one hours is defiantly enough to get to know the main Vim bindings I'm going to do an experiment. I've been struggling with Vim for a long time. I need to leave in about one hour. Instead of wasting time here on HN, I'll now spend an hour learning Vim. I doubt that this will get me very far, but I'll let you know how far I got.
- kaybe 7y agoThe tutorial that comes with Vim is quite good.
- jakobegger 7y agoOK, it's been about an hour. I learned the following: - there's a visual mode for selecting text - I can now yank and paste text in normal mode - I learned to use :split and :vsplit to open new files, and ctrl-w to switch between them - I learned a few new navigation commands - I learned that there's a replace mode (R) Definitely useful, and I hope I remember everything the next time I open vim! But I still feel like I'm just scraping the surface. One hour is very little time to learn about the power of vim.
- caseyw 7y agoThat's all good, but can you quit it? Sorry, had to be cheeky!
- 77544cec 7y agoFor those who don't get it: https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/ https://stackoverflow.blog/2017/05/23/stack-overflow-helping...
- capableweb 7y agoShocking stats about trying to exit vim: > In the last year, How to exit the Vim editor has made up about .005% of question traffic: that is, one out of every 20,000 visits to Stack Overflow questions. That means during peak traffic hours on weekdays, there are about 80 people per hour that need help getting out of Vim.
- deleted 7y ago[deleted]
- treeman79 7y agohttps://vim-adventures.com/ https://vim-adventures.com/ Fun way to get used to vim