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.

Learning vi -- the "cheatsheet" technique

27 pointsby vpover 16 years ago

4 comments

bostondjangoover 16 years ago
I was a fake vi user for a few years before I finally decided to sit down and learn it. What helped me get into the "feel" of vi was finally disabling my arrow-keys and forcing myself to use the hjkl keys for movement. It will suck for the first few weeks but eventually you'll notice a significant increase in productivity. Throw this into your .vimrc:<p>map &#60;Left&#62; &#60;nop&#62;<p>map! &#60;left&#62; &#60;nop&#62;<p>map &#60;right&#62; &#60;nop&#62;<p>map! &#60;right&#62; &#60;nop&#62;<p>map &#60;up&#62; &#60;nop&#62;<p>map! &#60;up&#62; &#60;nop&#62;<p>map &#60;down&#62; &#60;nop&#62;<p>map! &#60;down&#62; &#60;nop&#62;
评论 #460121 未加载
评论 #460117 未加载
baboover 16 years ago
"There are many versions of vi, and I'm going to be showing you how to use a version of vi called vim." Is there any other clone still under active development? Long years ago Vim won, hands down.
评论 #459957 未加载
评论 #459951 未加载
评论 #459973 未加载
评论 #460685 未加载
评论 #460719 未加载
mctover 16 years ago
Perhaps I'm biased because it's how I first learned vi ~15 years ago, but I still think the best way to learn vi(m) is by running <i>vimtutor</i>. It copies the tutorial text file to /tmp and launches vim against it. The text first teaches the user how to move the cursor around (in order to scroll down to the next lesson), then how to exit the editor, and finally different ways of modifying text. Many lessons are followed by interactive examples, which is a really neat way to learn (e.g., "Make the second line below look like the first line").<p>Text of the tutorial: <a href="http://ftp.vim.org/vim/runtime/tutor/tutor" rel="nofollow">http://ftp.vim.org/vim/runtime/tutor/tutor</a>
评论 #460889 未加载
RiderOfGiraffesover 16 years ago
I'm disappointed. I guess I'm not the intended audience, but I was hoping to learn about the windowing operations. The simple stuff in this "cheatsheet" is stuff anyone other than a complete beginner will use absolutely all the time. Windowing makes vi fantastic - I need to learn it.<p>Note to self: Learn the windowing operations in vi.<p>Ctrl-p and Ctrl-n are the truly awesome commands for programmers.
评论 #460107 未加载
评论 #460384 未加载