TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Vim 101: How to Start Using the Text Editor for Developers

178 点作者 strikingloo超过 5 年前

16 条评论

mxschumacher超过 5 年前
In the conclusion the author says &quot;It may not replace an IDE if you’re coding in Java or C++, especially if you’re using Frameworks and auto-complete is helping you.&quot;<p>You don&#x27;t have to make that choice and can have &quot;the best of both worlds&quot;: For the last few years I&#x27;ve not been using Vim itself, but Vim bindings in VSCode and Intellj. I enjoy the trade-off of this this approach because it<p>- is trivial to set up (in stark contrast to configuring a untouched Vim&#x2F;Nvim install from the ground up)<p>- gives me simple access to powerful extensions<p>- allows me to use modern editor&#x2F;IDE features (find usage, refactor) without forgoing &quot;the essence of Vim&quot;, rapid code editing through the combination of motions &amp; commands
评论 #21343392 未加载
评论 #21343323 未加载
评论 #21345486 未加载
评论 #21344651 未加载
评论 #21343138 未加载
评论 #21345554 未加载
评论 #21344332 未加载
评论 #21346062 未加载
评论 #21347786 未加载
评论 #21344557 未加载
评论 #21344042 未加载
评论 #21346989 未加载
评论 #21344486 未加载
评论 #21343776 未加载
jasode超过 5 年前
<i>&gt;To navigate a file on Vim, use the letters h,j,k, and l.These commands are called motions, as they move the cursor. The keys h and l will move your cursor horizontally (one character at a time), while j and k move vertically (one line at a time). If you put your hand on them, the layout sorta makes sense.</i><p>The way the author explains it above (mechanical) is the way I was initially taught over 20 years ago. However, it wasn&#x27;t effective for my learning style because it felt <i>random and incoherent</i>. So _why_ does &#x27;h&#x27; key move left? And _why_ do I have to press &#x27;i&#x27; for &quot;insert&quot; mode when I didn&#x27;t have to do that in Notepad&#x2F;MSWord? My UNIX instructor <i>couldn&#x27;t answer those questions</i>. He just said, &quot;I dunno, it&#x27;s just the way it is.&quot; As a sysadmin, I memorized it but it was a very unsatisfying way to learn vi.<p>My brain is most receptive to learning when it knows the <i>underlying philosophy</i> of why things are designed the way they are. Previous comment with some links.[0]<p>Once one knows the design intentions behind vi, the learning feels much less random.<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20605840" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20605840</a>
评论 #21344927 未加载
megous超过 5 年前
I started by typing vim into the terminal and then followed the instructions.<p>All you basically need to do at the beginning is press F1 as instructed and just read. There&#x27;s a very nice tutorial included with vim. :)
评论 #21343217 未加载
dunefox超过 5 年前
What&#x27;s better than Vim? Vim and Emacs: <a href="http:&#x2F;&#x2F;spacemacs.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;spacemacs.org&#x2F;</a> (use the dev branch)
评论 #21344089 未加载
评论 #21343964 未加载
评论 #21345100 未加载
thosakwe超过 5 年前
IMO, the most important Vim keystrokes for editing code are:<p>* %, which lets you hop back and forth between ()&#x2F;{} pairs. Extremely useful when working with, say, Flutter.<p>* F&#x2F;f&#x2F;T&#x2F;t (and ;&#x2F;,), which let you jump to a specific character in the line, ahead or behind. This greatly sped me up, as I no longer needed to count out &quot;okay, hop 16 characters to the left.&quot;<p>Also, another important thing is that Vim makes <i>editing</i> fast, not necessarily <i>writing</i>. There&#x27;s not really much you can do to make writing faster in the first place, as you eventually have to type anything you write at least once in some form. But for editing, boy, is it great.<p>EDIT: Attempt to fix god-awful formatting
评论 #21346095 未加载
shrumm超过 5 年前
A major use case this articles misses is having to manipulate files on a remote server.<p>When you’re SSH’ing into your server, VIM is incredibly efficient to make quick edits.
评论 #21343904 未加载
评论 #21353109 未加载
wolfhumble超过 5 年前
Nice introduction to Vim!<p>Using bash&#x2F;zsh extensively, and Vim a few times a day, I have been wondering if people treat bash&#x2F;zsh and Vim as two different worlds when it comes to keybindings, or is it common to use Vi&#x2F;m keybindings in bash&#x2F;zsh&#x2F;other shells? Would love to hear some input on this! :-)
评论 #21346850 未加载
评论 #21344808 未加载
评论 #21343046 未加载
评论 #21343290 未加载
评论 #21343724 未加载
评论 #21343832 未加载
sebringj超过 5 年前
I have to routinely use VIM for SSH related in command lines and am pretty comfortable but in no way does it compare to VSCode with the small exception use case that happens to be quite common of hop-in and hop-out of quick changes. Vim shines there. It is just so light weight and quick for that.
thekingofh超过 5 年前
[I ... it will change your life.<p>also [ CTRL-I and it&#x27;s siblings N[ CTRL-I<p>I rarely even use tags any more.
评论 #21348004 未加载
ojuara超过 5 年前
Btw, I just started reading SICP. How can I use Vim with Lisp code instead of Emacs? Because I did see people telling across the web that I should use Emacs for lisp code.
评论 #21346045 未加载
评论 #21346020 未加载
cloudking超过 5 年前
Much prefer JOE <a href="https:&#x2F;&#x2F;joe-editor.sourceforge.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;joe-editor.sourceforge.io&#x2F;</a>
pedrorijo91超过 5 年前
I miss a good tutorial on vim plugins :) still not trivial to explain to new comers how to use plugins they find on github for instance
ainiriand超过 5 年前
Relevant: <a href="https:&#x2F;&#x2F;vim-adventures.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vim-adventures.com&#x2F;</a>
m23khan超过 5 年前
vim is definitely a great tool especially when you are editing&#x2F;developing&#x2F;viewing scripts within Linux. However, as soon as you start writing anything beyond one-file scripts, better move over to proper IDE, IMHO.
评论 #21344613 未加载
评论 #21345119 未加载
评论 #21344277 未加载
Torwald超过 5 年前
The title is misleading. The &quot;text editor for developers&quot; should point to an article about Emacs.
romanovcode超过 5 年前
So iconic that the picture is with a guy in a coffee-shop using a mac. It seems that the only people I see using VIM are those kind of people.
评论 #21344251 未加载
评论 #21343503 未加载