Vi - Is it worth learning?

Chat about Linux in general
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 6 months after creation.
Locked
c07vus

Vi - Is it worth learning?

Post by c07vus »

Hi all.

Currently learning more and more about command line and bash scripting and I'm coming across some stuff with the Vi text editor.

Does anybody use it on a regular basis? Is it worth learning the intricacies of? What can be done with it?

Just looking for some user experience of Vi really, so take it away!

Thanks

c07vus
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Habitual

Re: Vi - Is it worth learning?

Post by Habitual »

c07vus wrote:Does anybody use it on a regular basis?
Every day. But I'm a 'basic' user of it. Simple Editing.
The most intricate thing I do is yank and paste.


terminal >

Code: Select all

vimtutor
http://tldp.org/LDP/abs/abs-guide.pdf
http://www.tldp.org/LDP/abs/html/
http://mywiki.wooledge.org/BashFAQ
http://mywiki.wooledge.org/BashPitfalls
http://flossmanuals.net/command-line

Read.
Ask.
Repeat. :)
User avatar
xenopeek
Level 25
Level 25
Posts: 29507
Joined: Wed Jul 06, 2011 3:58 am

Re: Vi - Is it worth learning?

Post by xenopeek »

You can expect a vi editor to be present on any Linux, BSD, or Unix system. It certainly has a longer learning curve than using something like Gedit, but with it's composable edit commands you can be much more efficient from the keyboard with vi. These days you would generally install vim or gvim (runs in a window instead of on the terminal). vim/gvim is a superset of vi; it implements everything vi does but adds lots of functionality like the option to extend it with scripts (http://vimawesome.com/).

Whether it's useful to learn vi is up to you. I learned it a long time ago on Unix but I'm probably at Habitual's level of competence.
Image
User avatar
Flemur
Level 20
Level 20
Posts: 10097
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Vi - Is it worth learning?

Post by Flemur »

I use it all the time, but probably wouldn't if I hadn't learned it years ago. It's very different than most modern text editors, but it's a powerful tool and will probably drive you crazy with with edit vs command mode. (e.g. edit mode: "j" = enter a j; command: "j" = go down one line). One big advantage it has over "regular" text editors is that you can edit files in a plain terminal without a graphical desktop environment. We used to use it (along with "ex") for batch editing text-formatted data files with millions of lines.

Hints:
- when in doubt, hit Escape.
- physically remove your "Caps Lock" key(s).
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: Vi - Is it worth learning?

Post by jimallyn »

I've been using Linux for 13 years, and have never used vi. Others use it every day. If you need to edit a lot of system config files, it might be worth learning, but in Linux there is always more than one way to accomplish a task.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
Fred Barclay
Level 12
Level 12
Posts: 4185
Joined: Sat Sep 13, 2014 11:12 am
Location: USA primarily

Re: Vi - Is it worth learning?

Post by Fred Barclay »

I use it whenever I need to fix a text file from the console. For example, if I install Debian without a desktop on a machine without a working Ethernet connection, I'll edit a text file that allows me to connect to wifi.
If the DE is up and running, though, and I don't have a pressing reason to use vi or vim, I tend to stick to gedit or pluma.
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein
shengchieh

Re: Vi - Is it worth learning?

Post by shengchieh »

It depends on what your needs are.

If you are primary just an user, dumb text editors are fine.

If you are in computer science and gearing up as administrator (or whatever), you will benefit from a powerful line command editor like vi or emacs.

that's said, here're some vi and vim links.

http://www.vim.org/
http://www.viemu.com/a_vi_vim_graphical ... orial.html (Graphical vi-vim Cheat Sheet and Tutorial; 2008)
http://www.linuxconfig.org/Vim_Tutorial (Vim Tutorial; 2009)
http://simpletutorials.com/vim/index.php (Overcoming Basic VIM Frustrations; date???)
http://www.rru.com/~meo/useful/vi/vi.intro.html (VI (and Clone) Introductory Guide; 12/12/98)
http://www.rru.com/~meo/useful/vi/vi.rm.html (VI (and Clone) Editor Reference Manual; 12/12/98)
http://ldn.linuxfoundation.org/article/ ... -guide-vim (Vim 101: A Beginner's Guide to Vim; 11/20/09)
http://www.linux.com/learn/tutorials/24 ... ide-to-vim (Vim 201: An Intermediate Guide to Vim; 11/25/09)
https://www.ibm.com/developerworks/myde ... 31?lang=en (Linux vim editor; 10/6/12)
http://tuts.pinehead.tv/2012/10/31/vi-s ... beginners/ (VI Shortcuts & Commands For Newbies; 10/31/12)
http://csswizardry.com/2014/06/vim-for- ... -and-hard/ (Vim for people who think things like Vim are weird and hard; 6/23/14)

Sheng-Chieh
Locked

Return to “Chat about Linux”