When I first started using the vi text editor, I hated it! I thought it was the most painful and inhumanly designed editor of all time. But I decided I had to learn it because if you are using Unix, vi is everywhere and is the only editor that you can guarantee will be available. This was true in 1998, and it remains true today; vi is basically part of the base installation in almost every existing distribution.
I spent almost a month using vi before I could use any of its features, but I still didn’t like it. However, I had realized that there was a powerful editor hidden behind this quirky facade. So I persisted with it and eventually discovered that once you know what you’re doing, it’s an incredibly fast editor.
The name “vi” is short for “visual“. When vi came about, line editors were very common, and being able to display and edit multiple lines at once was unusual. Vim, short for “Vi IMproved”, was first released by Bram Moolenaar in 1991, and it became the main vi clone software, extending the existing capabilities of this powerful editor. Vim’s powerful regular expressions and “:” command line syntax date back to the era of line editing and teletypes.
Vim has a 40-year history, which is enough time to develop a massive and complex set of skills that even the most knowledgeable users cannot fully master. Here are some reasons to love Vim:
-
Color schemes: You may know that Vim has color syntax highlighting. But did you know you can download hundreds of color schemes? Find some better ones here[1].
-
You never have to take your hands off the keyboard or touch the mouse.
-
Vi or Vim is available anywhere, even in OpenWRT[2] (well, actually in BusyBox[3], which is quite useful).
-
Vimscript: You might want to remap a few keys, but did you know Vim has its own programming language? You can redefine your editor’s behavior or create specific language editor extensions. (Recently, I’ve been customizing Vim for Ansible.) The best entry point to learn this language is to read Steve Losh’s famous book “Learn Vimscript the Hard Way[4]“.
-
Vim has plugins. Use vundle[5] (which I use) or Pathogen[6] to manage your plugins to enhance Vim’s functionality.
-
Plugins can integrate git (or your chosen VCS) into Vim.
-
There is a large and active online community, and if you ask questions about Vim online, someone will definitely respond.
I initially hated the absurdity of vi, as I kept hitting walls trying new editors over the past 5 years, always looking for “something better.” I have never hated any other editor as much as I hated vi, and now I’ve been using it for 17 years because I can’t imagine a better editor. Well, maybe there are slightly better ones: you could try Neovim – it’s the future of mainstream. It looks like Bram Moolenaar will incorporate most of Neovim into Vim version 8, which means a 30% reduction in the existing codebase, better code completion, true asynchronous support, built-in terminal, built-in mouse support, and complete compatibility.
In a talk at LinuxCon[7] in Toronto, the author explained some of the cluttered extensions and improvements that have been added over the past forty years that you might have missed. This content is not suitable for beginners, so if you don’t know why “hjklia:wq” is important, this may not be for you. It will also touch on a bit of vi’s history, as knowing some history can help us understand our situation. Following his talk can help you know how to make your favorite editor better and faster.
via: https://opensource.com/business/16/8/7-reasons-love-vim
Author: Giles Orr[8] Translator: hkurj[9] Proofreader: wxy[10]
This article is a translation by LCTT[11] and is honorably presented by Linux China[12].
[1]: http://www.gilesorr.com/blog/vim-colours.html[2]: https://www.openwrt.org/[3]: https://busybox.net/[4]: http://learnvimscriptthehardway.stevelosh.com/[5]: https://github.com/VundleVim/Vundle.vim[6]: https://github.com/tpope/vim-pathogen[7]: http://sched.co/7JWz[8]: https://opensource.com/users/gilesorr[9]: https://github.com/hkurj[10]: https://github.com/wxy[11]: https://github.com/LCTT/TranslateProject[12]: https://linux.cn/
Recommended Articles
Click the title or enter the article ID to go directly to the article |
---|
395 From Vim to Emacs to Evil |
1024 Some Unobtrusive but Very Useful Vim Commands |
4324 The Mind of a Vim User |
Sharing this article with friends is the best compliment!