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.

History and Effective Use of Vim

593 pointsby begriffsalmost 6 years ago

24 comments

2bitencryptionalmost 6 years ago
After years of a love&#x2F;hate relationship with Vim (I love what it does, but have configuring it), I had an epiphany: by sticking with the defaults, whether they are my preferred choices or not, I can instantly understand how to use Vim in any environment. Once you get used to biting the bullet and hitting escape instead of jj, or ctrl+c, it just works, everywhere.<p>If you abandon the urge to pimp out your Vim with a billion plugins, and just use it raw, it&#x27;s a kind of editor Nirvana. Let go of your desires and live without want :)<p>Of course, that&#x27;s just me. I understand why someone would want to turn Vim into their personalized powerhouse editor with IDE powers, with their .vimrc a &#x27;git pull&#x27; away.<p>But I&#x27;ve learned to live with the humble defaults, and it&#x27;s made life easy.
评论 #20483400 未加载
评论 #20482247 未加载
评论 #20482754 未加载
评论 #20482465 未加载
评论 #20482011 未加载
评论 #20487423 未加载
评论 #20482053 未加载
评论 #20481889 未加载
评论 #20481888 未加载
评论 #20482352 未加载
评论 #20481933 未加载
评论 #20484041 未加载
评论 #20482829 未加载
评论 #20481902 未加载
评论 #20485361 未加载
评论 #20484349 未加载
评论 #20482314 未加载
评论 #20482992 未加载
评论 #20482370 未加载
评论 #20484488 未加载
评论 #20485424 未加载
评论 #20483824 未加载
评论 #20483167 未加载
评论 #20488755 未加载
评论 #20482010 未加载
评论 #20482964 未加载
评论 #20488153 未加载
评论 #20484869 未加载
评论 #20485500 未加载
评论 #20487515 未加载
stirfrykittyalmost 6 years ago
Been using vim since 1998 and rarely stray unless I&#x27;m typing notes for something unimportant and them I use Nano.<p>Back in the day when I was a Unix admin, we often worked in full screen terminals and when editing a config file didn&#x27;t like having to close the vim instance to go look at something, so learned about this little gem:<p>:sh (go back to shell and do your thing and leave vim running)<p>Ctrl-d to return to intact and running vim instance.<p>As an aside, if you decide to use nano to edit config files, make sure you use nano -w (no wrap), otherwise you may find yourself with a non-bootable OS instance.
评论 #20482206 未加载
评论 #20483551 未加载
评论 #20483413 未加载
评论 #20482538 未加载
评论 #20483089 未加载
anaphoralmost 6 years ago
This video of a talk that Bram Moolenaar (the author of vim) gave at Google in 2007 has some pretty good advice.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=eX9m3g5J-XA" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=eX9m3g5J-XA</a><p>Mainly the idea is to not try and learn everything about vim, but instead pay attention to how you use it, and find things that are inefficient or could be easier, and <i>then</i> go figure out how to make vim do that thing more efficiently.
newman8ralmost 6 years ago
To anyone who hasn&#x27;t tried it - <a href="http:&#x2F;&#x2F;www.vimgolf.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.vimgolf.com&#x2F;</a> is probably the quickest and most fun way to take your skills to the next level.
评论 #20482179 未加载
评论 #20482129 未加载
andrewstuartalmost 6 years ago
I started my programming career determined to be a vim guru and do all my programming with vim.<p>This was misguided and after a year of wasted productivity and wasted time fiddling with plugs and dealing with broken stuff (surely by my own hand) I switched to a professional IDE and I rapidly became a much better developer.<p>I use vim constantly now but in it&#x27;s most plain vanilla form, for the purpose of editing files when logged into Linux systems. That&#x27;s all I use it for.<p>I really wish however that every Linux system had a clone of the old DOS edit command which was beautifully simply and straightforward and met most needs highly intuitively.<p>As a sidenote: can I just say that PyCharm is an incredible IDE and I can recommend it heartily to anyone. If your job is programming then it is many times over worth paying the money for the professional edition.
评论 #20482740 未加载
评论 #20483142 未加载
评论 #20482804 未加载
评论 #20482727 未加载
goemacsalmost 6 years ago
Everyone is missing the most important contribution of vi[m].<p>Vim defines an ergonomic set of rules for text navigation and manipulation, often implemented by very simple key bindings. This is wonderful.<p>The Vim editor implements all these rules, but the Vim&#x27;s plugin ecosystem is a disaster. Hacks pile upon hacks. Noone understand Vim scripts. Vim scripts are easily broken and do not interoperate well with other scripts.<p>These set of rules can be easily implemented by other editors, as evidenced by many IDEs supporting Vim key bindings. Although these editors may not support all the above rules, they are pretty close (see the evil plugin in Emacs) and can replace Vim in daily usage.<p>The editor war is over. Vim&#x27;s keybinding is superior. But the longevity of a text editor lies in its extensibility. For this, Emacs wins in the long run.
emsyalmost 6 years ago
I rarely ever use actual vim, mostly when I&#x27;m in the terminal. But I have vim plugins for most IDEs I use (VS code, intellij, XCode). It makes editing so much faster. When I have to get by without it I feel as if someone put weights around my wrists. The reason I don&#x27;t use Vim is because it&#x27;s frankly not a smooth experience for most languages (unless you fiddle around a lot, and even then I found Ide+vim plug-in superior). I do hope Neovim will solve this, though I didn&#x27;t test it because the last time I checked windows support was experimental.
评论 #20482747 未加载
b3b0palmost 6 years ago
I don&#x27;t limit my plugin usage on purpose. I will add a plugin if it adds a value I can make use of.<p>Disregarding color schemes here is my list:<p>* FZF<p>* COC (it provides a lot of QoL, functionality of modern editors with it&#x27;s plugins using an easy seamless yarn add)<p>* Sandwich<p>Very few customizations. Mostly vanilla.<p>Regarding colors, I love to try new ones all the time and my current is scery followed by Gruvbox, and Dracula because they work in Terminal.app and iTerm. They also look nice &#x2F; easy-on-the-eyes. My friend at work has a thing for Nord and another loves Monokai Pro, but apparently the author wants money for it...? Which seems... different.
uberduperalmost 6 years ago
I very recently set out to start bringing my vimrc with me when logging into remote hosts and came up with this.<p><pre><code> Host * !github.com RemoteCommand echo -e &quot;syntax enable\nset ts=2\nset sw=2\n&quot; &gt; ~&#x2F;.tmp_vimrc &amp;&amp; bash -c &#x27;set -a; vi() { vim -u ~&#x2F;.tmp_vimrc &quot;$@&quot;; }; set +a;bash -l&#x27; RequestTTY yes </code></pre> It gets ugly when you get a lot of options in there.<p>It&#x27;s possible to just curl or scp something in place via RemoteCommand above, or `source: <a href="https:&#x2F;&#x2F;foo.io&#x2F;vimrc`" rel="nofollow">https:&#x2F;&#x2F;foo.io&#x2F;vimrc`</a> but my security paranoia lead me to this instead.
评论 #20482885 未加载
MisterOctoberalmost 6 years ago
Excellent article by the creator of the equally-excellent postgREST. Especially the neato historical material - I didn&#x27;t know that Vi was directly derived from the ex [and by extension, ed] editor.
bayesian_horsealmost 6 years ago
I&#x27;ve been using Vim for a couple of years now and I almost can&#x27;t stand any text editor without VIM-like extension.<p>However, recently I took a liking to Visual Studio Code (with VIM bindings of course). Yes I know, it&#x27;s terribly bloated and consumes RAM like nobody&#x27;s business, but the Browser DOM arguably is the successor of terminal emulation in terms of ubiquitous interfaces, and VSC does use the additional power quite smartly. There are graphical hints and tweaks which are next to impossible to achieve in a terminal emulation.<p>I&#x27;ll still use VIM all the time, especially remotely. But VSC does provide similar extensibility. I somehow wish there was something like VSC, based on web&#x2F;electron, but more like a Texteditor, less like an IDE. And preferably not controlled by a huge corporation.
评论 #20484816 未加载
评论 #20484772 未加载
feissalmost 6 years ago
I used vim for years, but then Sublime appeared.. although I miss the snappiness of vim, and wouldn&#x27;t mind to come back. Specifically, I&#x27;d miss these nice features of Sublime:<p>1. Multiple cursors!! (and <i>how easy</i> is to use them)<p>2. Real-time preview of regex search<p>3. Package Manager (easy installation <i>and</i> discoverability of plugins)<p>4. Jump to file, jump to function, jump to css selector.. (ctrl+p, ctrl+r, using fuzzy search)<p>5. Project tree in small font (many files at sight)<p>Edit: Here there is a bunch of good stuff: <a href="https:&#x2F;&#x2F;medium.com&#x2F;@huntie&#x2F;10-essential-vim-plugins-for-2018-39957190b7a9" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@huntie&#x2F;10-essential-vim-plugins-for-2018...</a>
评论 #20482551 未加载
评论 #20483994 未加载
评论 #20483085 未加载
评论 #20482542 未加载
jLyrradalmost 6 years ago
I remember the first time I ran `vimtutor` in my terminal. A lot changed since then! Although I just stick with defaults since I have my IDE for my day-to-day job.
评论 #20482567 未加载
kazinatoralmost 6 years ago
&gt; <i>Some of the clones:</i><p>&gt;<p>&gt; <i>nvi - 1980 for 4BSD</i><p>&gt; <i>[ ... ]</i><p>&gt; <i>elvis - 1990 for Minix and 386BSD</i><p>This is incorrect; nvi is in fact a mid 1990&#x27;s fork of Elvis, worked over for better POSIX compliance by Keith Bostic.<p>&gt; <i>vim - 1991 for Amiga</i><p>Though that was the first public release, Moolenaar had worked on it since 1988. It was based on Tim Thompson&#x27;s Stevie, which had been released, in 1987 (noted in the table).
评论 #20483058 未加载
_hardwaregeekalmost 6 years ago
I realized why Vim has always felt a little off to me. The primary navigational commands are mostly on the right hand, which as a left handed person feels very weird to me. While Emacs commands favor neither hand (if anything they favor the left with C-f, C-b, C-a, C-e, C-x C-s, M-x, etc). Just a small observation.
评论 #20482814 未加载
Foober223almost 6 years ago
&gt; Oct 2010 - Feb 2014 : Vundle (Discontinued after NeoBundle ripped off code)<p>Looks like Vundle has an MIT license. rip off usually implies something negative or dishonest. Copying MIT licensed code is a normal and encouraged activity.
评论 #20482688 未加载
评论 #20482524 未加载
djhworldalmost 6 years ago
I don&#x27;t think I&#x27;ll ever be able to internalise all the features of Vim.<p>I&#x27;ve been using it for &gt; 10 years now but I still find myself learning (and sadly forgetting) new features when reading articles like these.
adembudakalmost 6 years ago
Shameless plug: A few days ago a write a quick reference for Vim too, checkout <a href="https:&#x2F;&#x2F;github.com&#x2F;p1v0t&#x2F;Doctor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;p1v0t&#x2F;Doctor</a>
xvilkaalmost 6 years ago
In addition to the [Neo]Vim, I can also recommend vifm[1] - vi-like file manager. It supports vi-like key bindings, similar configuration, and color schemes[2]. Moreover, it can be integrated[3] with Vim itself.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;vifm&#x2F;vifm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vifm&#x2F;vifm</a><p>[2] <a href="https:&#x2F;&#x2F;vifm.info&#x2F;colorschemes.shtml" rel="nofollow">https:&#x2F;&#x2F;vifm.info&#x2F;colorschemes.shtml</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;vifm&#x2F;vifm.vim" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;vifm&#x2F;vifm.vim</a>
runn1ngalmost 6 years ago
Just finished reading this book, “Ed Mastery”. I can’t tell if it’s “worth the money” - not sure if learning ed(1) is worth anything- but it’s fun to see the design decisions made way back in the 70s still being present in vim<p><a href="https:&#x2F;&#x2F;www.amazon.com&#x2F;Ed-Mastery-Standard-Unix-Editor-ebook&#x2F;dp&#x2F;B07BVBSDNZ" rel="nofollow">https:&#x2F;&#x2F;www.amazon.com&#x2F;Ed-Mastery-Standard-Unix-Editor-ebook...</a>
Accacinalmost 6 years ago
I&#x27;m a React Developer that uses Vim, and whilst I have reduced my .vimrc down a lot since I started playing with vim, I still use about 15 plugins such as Deoplete, tern, ale, fzf, a language pack (I&#x27;m always messing around learning new languages), and then a selection of Tim Pope addons.<p>At 120 lines, I consider my .vimrc quite light.. Although I&#x27;m not sure what others will think.
评论 #20482700 未加载
评论 #20482702 未加载
passthejoealmost 6 years ago
Don&#x27;t lead off with the history. #protip
jcutrellalmost 6 years ago
I&#x27;m deep into vim and have recently seen some things that colleagues are doing with VS Code. I have to admit, I&#x27;m tempted.<p>But I&#x27;m so used to vim + tmux now, it&#x27;s hard to imagine working with something different.
评论 #20484412 未加载
评论 #20484426 未加载
评论 #20485969 未加载
cryptonectoralmost 6 years ago
There&#x27;s only one thing I need to improve my VIM experience: a way to set style options (and search paths) for each git workspace. I&#x27;ve yet to find a non-hairy way to do this. Help!
评论 #20484669 未加载