TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Vim Cheat Sheet - For Programmers By Programmers

268 pointsby eddywebover 13 years ago

18 comments

kamaalover 13 years ago
I started out vim, with bare minimum commands but later on went to emacs. With emacs I have an option M-x tab auto complete In case I don't get to remember something. I would like to know what are vim equivalents of this?<p>Some how I feel deep down inside that vim was not designed bottom for this kind of complexity. I mean to say when you want to design something to scale you have to clearly decide what goes into the core and what can be added using a extension system. Although I understand the spirit behind the use cases for vi when it was first invented to light weight. Now when you decide to stick to minimalism you must be consistent to that philosophy. When you violate that, you go on bolting stuff on top of it which doesn't belong there. The net result is a huge bloat of things which make usability too complex. Besides I only can commit so many things to memory.<p>One look at this cheat sheet made my head spin. Every time I fire up a editor to write code, I need brain space to think about the problem at hand. I can't afford to context switch between looking a up a sheet of command to do editor work. Which in case even Notepad will turn up to be more useful than this.<p>If someone has a better way to doing this I would be more than happy to learn. I keep hearing a lot of vim these days, and want to learn it too. But everytime I face the uphill task of memorizing something, I just drop it and go on to do something else.
评论 #2977943 未加载
评论 #2978721 未加载
评论 #2977469 未加载
评论 #2978683 未加载
评论 #2978865 未加载
评论 #2977464 未加载
评论 #2977513 未加载
lhnzover 13 years ago
This is why I only use the most basic features of vim. There are simply too many commands to learn and many of these tutorial and cheatsheets present you with too much information. I don't think the time investment makes sense, and I don't understand why there has to be so much noise: how many of those commands save a significant amount of time; how often are they used?<p>The questions I would like to ask advanced vim users, are:<p>(1) Imagine that you had your memory of vim wiped, and you lost the ability to remember more than 10 commands. If you decided to learn vim again which 10 commands would you keep in memory?<p>(2) How many commands does somebody need to know before they can used vim productively? Is it less or greater than 10?
评论 #2978139 未加载
评论 #2978288 未加载
评论 #2978060 未加载
评论 #2977959 未加载
评论 #2977808 未加载
评论 #2978059 未加载
评论 #2977821 未加载
评论 #2977696 未加载
评论 #2978014 未加载
评论 #2980124 未加载
nagnatronover 13 years ago
You can tell it's by programmers because it's fucking ugly.
babebridouover 13 years ago
This sheet does not achieve its specified goal. When using a tool, the question that always comes to mind until muscle memory kicks in is "how do I do this?" and not "What will pressing that key do?".<p>Think of it as a control settings in a console game menu: there are two ways to display the info, one is good design, the other is bad design.<p>Bad design: a list of buttons, and for each button the action. (ex: A = Shoot, B = Jump, C = Crouch...).<p>Why it's bad design: If you want to learn how to perform a given action, you need to parse the whole list to find the action, then look at the button, because there is no index. Likewise, if you want to change the button performing the action, you press the new button, scroll the list of choices, select the new action, press the previous button that was performing this new action, scroll the list of choices, select another action. One click, one scroll for each step.<p>Good design: list of actions, indexed in alphabetical order (or any order that makes sense in the context). (ex: Crouch = C, Jump = B, Shoot = A...)<p>Why it's good design? You can use the index to find the action quickly. Also, when changing the keys, just ask the game for a complete key remap and reply to each "press button for Jump", "press button for Shoot" etc with a single button press each time and no chance for a conflict.<p>A better design would be for this cheat sheet to display an indexed list of actions, and then the "motion" required to perform it - or a list of acceptable solutions. The problem with VIM as I see it is that it requires understanding an additional layer of abstraction: it's not "press A to Jump", but rather "press A to execute the action that is relevant to the mode that you're in: if grounded, jump and enter airborne mode, if airborne, jump and enter double jump mode, if in double jump mode, do nothing". Both do the same thing, but if what you're looking for is crossing a pit, the solution in both cases is simply to press A twice - except VIM is designed to be so powerful that there's no way to list actions without mentioning at least the possibility of side effects. On the good side, if you are proficient with VIM, plan things in advance and know exactly where you are compared to the pit, you can do a double jump backflip and shoot at the marker with a single keypress, and even add a numbered parameter to specify the number of bullets which can be a function of remaining ammo, distance to ammo bonus, number of enemies on screen and their toughness, etc. Sorry for the stupid metaphor, it kind of made sense while I was writing it but I can already feel bad karma coming my way :P
评论 #2978034 未加载
syaz1over 13 years ago
Why the need to stress For Programmers by Programmers? Isn't it obvious?<p>The sheet itself is really messy. I'd appreciate if anyone know a sheet that separates typical-editing and advanced-usage.
评论 #2977534 未加载
tudorizerover 13 years ago
Now that's some visual clutter :(
评论 #2977415 未加载
mahcodeover 13 years ago
As a new programmer (I started learning Ruby and ROR about a month ago), the added value of learning VIM has already been paying off. Adding a new learning element into the mix (in this case VIM) does take some time at first, but once you realize how much time you can save in the long run there is no turning back.
jvc26over 13 years ago
Cheers for the colourblind one - actually makes a surprising amount of difference!
dongshengover 13 years ago
Very well made cheat sheet, but will it scare the new VIMers? I was using <a href="http://www.viemu.com/vi-vim-dvorak-cheat-sheet.gif" rel="nofollow">http://www.viemu.com/vi-vim-dvorak-cheat-sheet.gif</a> when I started.
评论 #2977784 未加载
pgeover 13 years ago
One useful command that was missed:<p>C-^ (aka Ctrl-6) switches back to the most recently used buffer. That is, if you are using two buffers, you can just flip back and forth with C-^
评论 #2978484 未加载
评论 #2978498 未加载
SkyMarshalover 13 years ago
Here's another that's better for learning Vim, it combines the cheatsheet with a tutorial to make a four-step progressive cheatsheet:<p><a href="http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html" rel="nofollow">http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial...</a>
raghavaover 13 years ago
Seems like a lot of visual clutter to me (tried having it as background on a monitor running 1366x768, not pretty usable for me)<p>Many might find <a href="http://www.qitty.net/lnx/vim-cheatsheet.png" rel="nofollow">http://www.qitty.net/lnx/vim-cheatsheet.png</a> helpful too.
baumgartn3rover 13 years ago
The "For Programmers By Programmers" is a bit unnecessary. Is anybody else using it?
kaishinover 13 years ago
The look of the cheat sheet lives up to the 'for Programmers by programmers' part...
fsiefkenover 13 years ago
Ah Qwerty, can you make a version for the Dvorak typists?
brandoncordellover 13 years ago
Cheat sheet looks great!<p>One question though. IT has 1g as a shortcut to goto the top of the file shouldn't this be 1G?
评论 #2977975 未加载
damoncaliover 13 years ago
Is there an award for title redundancy?
l0st3dover 13 years ago
vi(m) is for sys-admins. Programmers need to know<p><pre><code> :q! $ emacs !$ </code></pre> Let the war continue ;P
评论 #2977435 未加载
评论 #2977457 未加载
评论 #2978140 未加载
评论 #2977424 未加载