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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Learn Vim for the Last Time: A Tutorial and Primer

39 点作者 poindontcare超过 5 年前

3 条评论

nineteen999超过 5 年前
As I grew up working with both Linux and a bunch of legacy UNIX systems as well (Solaris, AIX, HP-UX, Tru64), over the years I&#x27;ve ended up using only a subset of vi commands that work with both SVR3&#x2F;SVR4 style systems (tradional vi) and Linux (vim). A similar thing happened with my shell scripting style; I&#x27;m prone to writing shell scripts that exclude bash-isms and conform more to standard Bourne shell syntax, since I know that they will work pretty much anywhere.<p>Its a trade-off; I&#x27;m less efficient with vim than I could be, since it has so many more powerful features over standard vi. The flip side is that I can go back to those older systems and feel comfortable within a couple of minutes, without getting frustrated at the installed vi editor missing the vim features that I otherwise would have come to depend upon. I traded off using powerful features that could speed coding (if I would just memorize them all), for the flexibility to be able to jump between (similar, but different) systems much more easily.<p>Of course, those systems are not as in as much common use anymore due to the end of the UNIX wars, so the value of that style of working is now resulting in diminishing returns.<p>I&#x27;d like to be able to change, but like many older programmers, we often like to stick to what we know, as long as we can get the job done quickly and with minimum fuss.
评论 #20726952 未加载
acqq超过 5 年前
I believe to remember that a few decades ago on some Unix variant I was able to use some kind of vi with some settings where I was able to configure it for not having to do Esc at all for the movements through the text when using all the arrow keys of the terminal I&#x27;ve used and also not having to press any key to start typing the text after these movements and only had to do Esc to type in the non-trivial (i.e. non-movement) commands.<p>Effectively: as soon as the file is opened, I&#x27;d remain in the text entering mode (however it is called in vim terminology) pressing any arrow key (or maybe even the pg up, pg down etc) would exit that mode (implicit Esc) perform the expected movement and at the end automatically return to the starting mode.<p>I believe I was able to achieve it then by assigning the whole sequences (e.g. Esc, movement, i) to be played as I pressed only one of these keys, and automatic i after the file open, and I don&#x27;t know if all this is possible now with vim, the little I&#x27;ve tried to find I haven&#x27;t found that functionality. I&#x27;d even claim that having something like this would make vim much less frustrating for the casual users. What I&#x27;m sure is that I don&#x27;t have any written record what I&#x27;ve did then -- it was &quot;works for me&quot; then and for that environment.<p>Maybe somebody knows more about this? I&#x27;d like to be able to achieve such a behavior in Vim even if it&#x27;s the opposite of what people in these tutorials try to teach people to do, as an example, I haven&#x27;t understood what this does (it is not clearly explained here except claiming &quot;the &lt;Esc&gt; key for leaving insert mode is, in my opinion, rather antiquated. Vim is about efficiency, and it&#x27;s hardly efficient to leave the home keys if you don&#x27;t have to. So don&#x27;t.&quot;) but it seems to me, nothing I&#x27;d like:<p>&gt; inoremap jk &lt;ESC&gt;<p>I&#x27;d argue that not having to even change the modes explicitly at all is more efficient than optimizing the key with which you permanently change the modes. Somebody would say &quot;but then you can&#x27;t do these nice number-movement to move number of times&quot; -- I don&#x27;t care, it takes more time to count or to try, err and undo when the number is wrong, than to just use the plain keys. It was not so when editing from the terminal over 300 baud lines, which was the original use case for these commands, but nobody edits over them today.
评论 #20726969 未加载
评论 #20723839 未加载
croh超过 5 年前
<a href="https:&#x2F;&#x2F;laymanclass.com&#x2F;vim-essential-setup-to-boost-your-productivity&#x2F;" rel="nofollow">https:&#x2F;&#x2F;laymanclass.com&#x2F;vim-essential-setup-to-boost-your-pr...</a>