
Why Vi Rocks - 15DCFA8F
https://why-vi.rocks/
======
cwbrandsma
I’ve learned some vi, and emacs, Visual Studio, VS Code, XCode, IntelliJ, and
Android Studio.

All the examples listed are pretty uncommon or trivial in any of the other
IDEs (aside from the regex part, which is cool, but I never want to be in a
place where I have to regex my code...ever). 90% of the time I’m doing simple
code maintenance, with an occasional refactoring. And I know devs that swear
by vi...they are developing any faster than I am, and I touch my mouse about
as much as they do (hardly ever).

My favorite is still Visual Studio with Resharper, worst is XCode.

~~~
billfruit
I am writing this from emacs experience (some if not all these features are in
vi as well), there are features from emacs that make a real difference in
writing programs especially:

* Unlimited yanking from kill rings: ie pasting text from history of the clipboard.(This is one thing I have most difficulty with when switching from emacs to modern editors)

* Macro recording and playback : recording an arbitrary set of edit operations and then replaying them any number of times.

* two or more code frames/windows side by side, even displaying the same file Surprisingly modern IDE guis seems not designed for it, eclipse can do it but clumsily.

* Remote file editing: use the IDE tools to edit file residing on another computer.

* Column edits or rectangle edits. Selecting a vertical column or rectangle of text and copying, moving it to another place.

~~~
max76
> some if not all these features are in vi as well

I'm not sure exactly which vim features are also in vi. Vim has been a daily
use tool for me since about 2007.

Vim has really good Macro recording. Vim + Tmux is great for side by side code
frames, and there are plugins for showing multiple buffers in one Vim
instance. Remote file editing is good with SSH + Vim. Vim has multiple
registries for yanking/putting. Vim has column editing functionality.

Almost anything Emacs does out of the box Vim can do with either a plugin or
with an external program pairing. I prefer Vim's keybindings because there are
less "chords" (Ctrl-C and Ctrl-V are copy and paste chords, they requiring
pressing two buttons at the same time). Too many chords causing my pinky
fingers to become tired. Vimscript is a surprisingly powerful language for
dealing with text data, but it's cryptic the first decade you are exposed to
it.

EDIT: I'm more interesting in the code people write than the way people write
it, but I wanted to share some of my vim knowledge and point of view.

~~~
nitemice
Unless I've misunderstood, you can use splits to show multiple buffers in Vim
without any plugins.

~~~
billfruit
What about manipulating of splits, like converting vertical split to a
horizontal split, enabling/disabling synchronized scrolling, etc..

~~~
logram
You can do both of those things in vim. I don't mean to be nitpicky, I'm just
mentioning in case someone reading this didn't know and uses vim. You can set
scrollbind and convert splits (off the top of my head I think it's Cw Ch and
Cw Ct).

------
adrianrocamora
I've been using Neovim consistently for the last few months and it's a game-
changer. Terminals within Neovim that I can paste into/from my Vimwiki files
or source files is amazing. It's not very different from a Vim setup and using
it with the Qt GUI on Windows gets rid if the issue of having everything close
when eventually having to call <C-w>. Meanwhile, in my linux environment it
runs like a charm on a terminal.

~~~
milin
Same here neovim with session management and tmux with session management,
with tmux russerect and tmux continuum. And with the language server
integration in neovim, its a swiss army knife that works well with most modern
languages and devops.

~~~
colordrops
I've got resurrect and continuum installed and all they ever seem to do is
load up an empty vim window that is rendered improperly. What is your setup?

~~~
milin
mostly [https://github.com/tmux-plugins/tmux-
resurrect/blob/master/d...](https://github.com/tmux-plugins/tmux-
resurrect/blob/master/docs/restoring_vim_and_neovim_sessions.md).

------
omaranto
Half of it is "Why standard unix utilities rock".

------
rococode
IntelliJ with the IdeaVim plugin is my goto editor nowadays. As others have
said, I honestly don't find myself using the really fancy features of vim that
often. What I do use frequently are basic motions together with yanking,
deletions, word movement (w/e/b), marks, indents, centering (zz), page scrolls
(ctrl+u/d), and using searches (f and /) to jump around in code quickly.

For those purposes, IdeaVim works just fine, and gives me all the little speed
boosts of vim with the added bonus of (in my opinion) a much more robust
coding environment. It even makes some functions better; for example, `gd`
works super well and nearly instantly in IntelliJ since the definitions are
supplied by the IDE's 'Go To Declaration' rather than some hacky vim plugin.
Other editors have similarly sufficient vim plugins, e.g. VSCodeVim.

~~~
foob
Have they fixed the issues with where the cursor ends up after certain
operations? It's been a couple of years since I've used it, so I can't give an
explicit example, but there were multiple common operations where the cursor
would end up in a different location afterwards than it does in vim. This was
really difficult for me because I still used vim a lot for other things, and
it felt like it was actively eroding my muscle memory to use two conflicting
implementations.

~~~
lukecameron
I use IdeaVim at my day job and can confirm it's gotten better. There are
still some rough edges, especially around handling movements like L, M, and H
which don't always go where you expect them to. And some operations like undo
don't play well with the vim commands such as undo.

And yes, I completely agree about switching between vim and ideavim for
different languages, the experience is very different and the sight
differences are very noticeable.

------
umvi
Vim is like Dvorak. The cognitive burden for remembering which key maps to
what is high unless you use it 24/7.

~~~
anotherevan
Does anyone use Vim on a Dvorak keyboard?

~~~
rgoulter
I used dvorak for a bit. I didn't remap HJKL, since JK were still beside each
other, and H was to the left of L (albeit, not on the same row).

In terms of transferring Vim 'motor memory' from a qwerty layout to a dvorak
layout, IMO it meant focussing more on an added indirection of "which letters"
rather than "which fingers where".

------
asciimov
Why do I use vi(m)?

* Eclipse - Forced to use this in University in the early aughts. I would say that crashing and clobbering systems was its best feature. You moved your mouse it crashed; thought about saving crash; need an update, now you need to format and clean install windows; want to print, printing works! want to compile, your gonna need to try again after restarting windows...

* SSH - In University we had some awesome terminal servers that were a joy to work with. I could access all my work from anywhere, regardless of how limited my local machine was. Vim was always there, chugging right along.

------
amanzi
"vi is the de facto standard Unix editor, you find it in every *NIX derived
OS"

I was going mention a recent article I heard about that vi was going to be
removed from upcoming Ubuntu distributions, but it appears that was an April
Fools joke... <insert curmudgeon grumbling here>

------
veryworried
No mention of vim or neovim?

------
bgorman
The few times I have encountered nvi, it was just off enough from vim to give
me a headache. Somehow it is worse than busybox vi, where I at least know to
stick to primitive operations.

------
ChuckMcM
Since I "grew up" with vi I mostly use vi when using vim, but I do appreciate
syntax coloring. I find it easier to scan comments that way and pick out
constants.

------
andrewfromx
i see people struggling, fighting with Intelli-J every day. I wish I could
give them vim as a gift. All the extra stuff you think you can't possibly give
up you don't need. I'm a professional text file editor. Vim is like playing
the piano. I guess what I'm saying is learn to play the piano for real, and
don't spend your life in a piano-player-helper IDE thing.

~~~
greysonp
Vim is a fantastic text editor, but it is not an IDE replacement. Here's just
a few IntelliJ features I use daily that Vim doesn't have: Go to declaration,
find usages, rename method/class, change method signature, auto-import,
shortcut to override method, easy-to-configure style rules, _really good_ code
completion, quick access to javadoc.

I could keep going. Again, not hating on Vim. I use Vim keybindings in
IntelliJ! I just don't think it's the best tool for working in large
codebases.

~~~
chimpburger
Vim was designed for editing _text_. It was not designed for semantic analysis
of _code_. The semantic plugins for Vim are hacky addons.

Having Vim bindings in IntelliJ is indeed the best of both worlds.

~~~
ephimetheus
How do you get IntelliJ to not shred your CPU to pieces while indexing all the
time?

~~~
chimpburger
It should not be indexing all the time. Only when you load a new project.

------
ausjke
vim for command line, pycharm for python, webstorm for web, geany for
everything else that needs a GUI, works great!!

used vscode for 2 years on and off, finally decided to part away two months
ago and bought webstorm instead, the time spent on vscode with all the
configuration and plugins and settingsync(which is not reliable) is way more
expensive than webstorm's license fee(same as pycharm)

------
munk-a
There appears to be a small issue with this article, it seems to have confused
vi with the widely favored editor nano. It might be good for an editor to fix
this omission as I'm sure it was in error. /s

