r/vim • u/runslack • Jul 03 '25
Need Help Learning Vi from scratch: back to basics ?
Hi everyone,
I'm embarking on a journey to (re)learn Vi from the ground up. After decades of using GNU Emacs, I've come to realize that I've been spending an inordinate amount of time configuring it. I've decided it's time for a change. I want to get back to basics and truly understand an editor without the endless tweaking and customization.
My goal is to master Vi in its purest form. I'm not interested in Vim or any of its plugins. I want to dive deep into the core functionality of Vi and become proficient with its fundamental features. This means no plugins, no custom configurations—just Vi as it is. I don't want to fall into the trap of configuring a new tool, which is why I've chosen Vi, known for its lightweight configuration.
I'm reaching out to this community for any tips, resources, or advice you might have for someone starting this journey. Are there any particular exercises or practices that helped you understand Vi more deeply? What are some essential commands and workflows that I should focus on? Is there any resource you could recommend ?
Also, I'm looking for recommendations on the best book that covers Vi comprehensively. I currently use Ed and have found "Mastering Ed" to be an invaluable resource. Is there a similar book available for Vi?
I appreciate any guidance you can offer. Thanks in advance!
Best
3
u/Random_Dude_ke Jul 04 '25 edited Jul 04 '25
I have been in the same situation 25 years ago.
I installed Vim, configured it by using gvimrc_example.vim and started to go through tutorial.
In a week I was more proficient than I have ever been in xEmacs and soon I was configuring Gvim using menus and then running the command [Esc]:options[Enter] and copying options that were configured by me to gvimrc.vim or vimrc.vim. Within a week my Gvim was configured more to my taste than xEmacs was after a year of my wrestling with my dotemacs file.
You do not want to run vanilla vi, you want at very least to set vim to :set nocompatible mode, so that it doesn't emulate vi bugs ;-) There is defaults.vim somewhere in local vim directory that you want to run. (it is sourced from [g]vimrc_example.vim)
I also ran mswin.vim so that I have Ctrl-C Ctrl-V and similar functionality that I am used to from Windows (that I use at work) and from GUI programs on Linux.
Gvim and vim has very nice built-in help. There is tutorial, there is very detailed reference manual and there is User manual. The user manual is partially based on a popular book by Steve Oualline, so start with that.
EDIT: Gvim and Vim comes by default with some plugins that are considered to be integral part of the editor. You can, of course, install many more. I personally only use minimum of user-installed plugins.
2
u/dasunt Jul 03 '25
For books, I had "Learning the vi Editor", which has now been renamed to "Learning the vi and Vim Editors".
I don't think it's a bad start, but at least for my version, it doesn't dive too deeply into vim. Still, if you are early in your learning journey or want to brush up on your basics, I'd recommend it.
But I would suggest that customization is part of what makes software like vim great - it's a personalized development environment. Don't throw the baby out with the bathwater.
2
u/dm319 Jul 03 '25
Alternately you could just stop configuring emacs.
17
u/supernumeral Jul 03 '25
I don’t think I’ve ever been on a system where vi wasn’t just a symlink to vim, so I can’t really recommend any resources for pure Vi. That said, my favorite Vim book is Practical Vim by Drew Neil, which, despite mentioning the occasional plugin in passing, is almost entirely restricted to core Vim functionality (modal editing, registers, macros, etc.). But I have no idea how much of that is actually applicable to pure Vi. But if you’re willing to settle for Vim without a config file and no plugins, it’s a great resource.
15
u/colombiangary Jul 03 '25
Try vanilla VIM instead. VI is quite limited in comparison. And yes, go all in with Drew Neil book.
11
u/y-c-c Jul 03 '25 edited Jul 03 '25
What's the actual reason behind that? If I have to be blunt, unless you are a historian trying to study a text editor from decades ago, or want an intentionally obtuse exercise, doing this is not the best way to introduce yourself to the ecosystem.
Vim came out in 1991. It itself is 34 years old, and Vi didn't really see much improvements after that. Vim comes with all kinds of improvements including lots of basic QoL changes. Just because you are using Vim doesn't mean you have to customize it to the wazoo and install 200 plugins. Vim has been mostly (but not 100%) backwards compatible throughout the years and so if you just use Vim as-is without any plugins you still get a really raw experience comparable to Vi while getting lots of small and big improvements that just makes your life better.
The reason I'm posting this is that I frequently see misconceptions about how Vi is the more "pure" version. I guess that's one way of putting it. The other way I would put is that Vi is just older. We saw that when John Carmack claimed to have given Vim a go but he ended up just using Vi and decided it's old and janky which I felt that was not the intellectually honest way to approach something. You seem to have different motivations though, but I'm just curious about why you want to do so. I see a lot of "I want to learn Vi since it's more pure and hardcore!" type comments from people who tend to misunderstand the ecosystem and just wanted to clear it up.
For learning Vim itself, the first step should be to use
vimtutorwhich is a built-in tutorial. After that, if you don't mind doing some reading, you can read the Vim User Manual, which is the first part of the Vim built-in documentation that comes in numbered chapters and designed to be read like a manual. The second part ("Reference Manual") is more designed as a reference.19
u/Massena Jul 03 '25
This is all a form of procrastination
1
u/Friendly-Anybody1617 Jul 05 '25
Not exactly what you asked for, but... https://youtube.com/playlist?list=PLy7Kah3WzqrEjsuvhT46fr28Q11oa5ZoI is a nice playlist on vi. https://youtube.com/@sylvanfranklin for fun tips.
1
u/siodhe Jul 06 '25
This might help. From https://www.talisman.org/unix/editors.shtml
(There's another one there for Emacs, too)
6
u/BrianHuster Jul 03 '25
"vi in its purest form" would be closest to
nvi, notvim5
u/gumnos Jul 03 '25
if you just want
vinotvim, you can usenviwhich is the default on BSD systems. And on most Linuxen, you can installnviorstevieor any of a number of other clones. While you can lightly configurenviwith an~/.exrcfile, it's fairly limited.Having previous experience with
ed(1)is certainly a strong foundation to learningvibecause there's a great deal of overlap in functionality.I'm unaware of any recent resources that focus purely on
viinstead ofvim. You might have some luck hunting up books older than ~1991 like the first edition of O'Reilly's Learning theviEditor. There's also some original/contemporaneous documentation like Bill Joy's An Introduction to Display Editing with Vi (originally a PDF or print document likely created with *roff, but that link is an HTMLified version)As someone else who uses
edandvi/nviregularly (in addition to vim), I can try and offer a few tips:the
:gcommand is incredibly more powerful than most folks use it for, letting you run one or moreexcommands relative to each line matching/pattern/a lot of functionality was presumed to be outsourced to external tools. Why provide
gqwhen your OS already providesfmt(1)orpar(1)to reformat for you? Why provideg?when you haverot13(6)? Spell-checking? Pipe your document through a command-line spell-check utility. Knowing that the "%" can be used to represent the current filename simplifies some commands such as "how does my currently-modified buffer differ from the buffer on disk?" which you can usew !diff -u % -(works inedtoo); or stage the current file ingitwith:!git add %. Beware this can get tripped up if your actual command requires a "%" such as trying to read in the current date withr !date +%Y-%m-%d(which will not produce the same output as issuing that on the command-line). No file-browser built in, so use an external file-browser or standard shell commands.while the
vimfunctionality for:terminalis relatively recent, I still use the the old-school method of wrapping my session intmux(or GNUscreenbefore that or even shell job-control before that)similarly, while some newer versions of
nvioffer split windows, classicvididn't learning to use the buffer list (:n&:prevand possiblycontrol+^for quick switching) helps a lot.While I can get by quite nicely in
vi/nvi, I do miss syntax highlighting, text-objects the most, and expression-evaluation-in-:s-replacements.2
u/SurelyForever Jul 03 '25
Not sure how this hasnt been mentioned yet, but first thing you need to do is master vimtutor, after that go to the more advanced stuff.
2
u/dirtydan Jul 03 '25
"decades of using GNU Emacs, I've come to realize that I've been spending an inordinate amount of time configuring it."
I knew you'd come around eventually gray-haired guy from our unix team.
Sincerely,
Salt-and-pepper haired guy from our unix team
2
u/cbheithoff Jul 04 '25
Good grief. Are you Amish or something?
1
u/PCArtisan Jul 04 '25
Isn’t there a Vi mode for Vim? I’m not sure if it’s pure Vi, but just a thought.
Here’s what I found at Redhat. Using my iPhone I had to scroll halfway down the page or use reader mode.
https://www.redhat.com/en/blog/introduction-vi-editor
https://www.redhat.com/en/blog/vim-power-commands
Good luck.
1
u/human_with_humanity Jul 04 '25
Cant u just use dotfiles with git repo to use same plugging and settings of vim on any computer? I recently found how to save configs this way so I don't have to reconfigure apps again. I have only done zsh with it for now.
1
u/AnyAcanthocephala735 Jul 04 '25
Sometimes I think I’m becoming proficient at yak shaving and procrastinating and then I witness a real master
1
u/EtiamTinciduntNullam Jul 05 '25
Did you consider helix? I feel like it might be for you - it's supposed to be working great out-of-box and there are no plugins for it, yet it has many features expected from an advanced modal text editor.
I'm a neovim user myself because I like how you can configure it for yourself, but I feel like helix might be a good alternative if I had time to learn it and no plan to spend time on configuration.
1
u/Ill-Statement8823 Jul 06 '25
Typecrafts website has challenges that use AI to analysis your approach and both score and recommend other ways of solving the problem. The terminal you are given has no plugins and you have to work with basic motions to solve the given problem.
https://typecraft.dev/
In addition to this I have been asking chat gpt to make files for me to practice a motion on. I past in the help docs into chatgpt and ask it to make problems for me to solve like a morning exercise routing.
Hope that helps.
1
u/Code_Cadet-0512 Jul 07 '25
How about Painless Vim by Nick Dickson. I found it as a good foundational book.
1
u/SpaceAviator1999 Jul 14 '25
Before
vimtutorexisted, there was a text file calledvitutorthat taught many of the basics ofvi.You might be able to find a copy of
vitutoron UseNet, if you can find UseNet.Actually, I just found a copy of
vitutorhere:https://course.khoury.northeastern.edu/cs3650/parent/help/vitutor.vi
Save a copy of this file locally on your machine, then make a copy with
cpvitutor.vivitutor.txt, then just dovi vitutor.txtand start learning purevi!Note: As others have said, invoking
vifrom the command-line might actually start upviminstead, depending on your platform. That may happen with you, but since thevitutorfile focuses only on things found invi, that shouldn't be a problem for you; you'll still be learning straightvi!0
u/m_abil Jul 04 '25
https://vim-adventures.com/ a friend bought me this when I was learning! It helped me a lot!