Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm a beginner to Linux. I was recommended to give Slackware a try and have found that the volume of quality information available is amazing. My only issue is that I'm having trouble using the built in editor Vi. I'm told that this is one of the best editors to learn but to be honest I'm having trouble signing out of it. Is there a good tutorial somewhere to learn vi?
I've never got round to learning vi or vim. I've always used nano or whatever GUI text editor was available. However, there are plenty of tutorials out there. This one seems as good as any:
Good starting point is ed editor, basically vi is enhancement to ed. So you will have to learn about regexp(s) - what is regular expression - to have real benefit from using vi.
Good starting point is ed editor, basically vi is enhancement to ed. So you will have to learn about regexp(s) - what is regular expression - to have real benefit from using vi.
That approach might put some linux learners off. Like climbing Everest before you can climb the stairs.
In my experience vi has been the default editor in all unix and unix-like OSes since - well - forever. Thus you can always count on vi being available for use, and may have to install some other editor if you want that instead (even ed in years past and server installs). If you want to be familiar with an editor that you can count on always having then you should at least learn the basics of vi.
One of the things I like about vi is that it does not add or remove any hidden characters like editors used in windows do. Thus even if you edit a file created in windows the existing lfnl character at the end of the line remains when you save it again. (unless you manually remove it). OTOH, with a file created in linux that ends only in the nl character, if you open it up and then save it with an editor under windows the result has every line ending with lfnl instead. The change from nl to lfnl can be disastrous when editing files if you are not aware of the changes.
Most editors used today in linux are careful to save files exactly as they were when opened or only with changes manually made, but that has not always been the case and certainly isn't with the other OS.
Last edited by computersavvy; 01-05-2021 at 09:56 AM.
That approach might put some linux learners off. Like climbing Everest before you can climb the stairs.
This was my learning curve - I never regret it. This is ok if one want to have full benefit of using vi-like editors. And by the way one also has chance to learn about sed. So it is good starting trio: (ed/sed/vi)+regexp. Finally I must say using ed is really funny.
While vi is very old, I agree that it's one of the best editors to learn. You don't have to learn all about it, just enough to view, edit, and save files. Certain systems may be very limited with what they have and if you work with the command line only, as opposed to having to try to install one you do know, such as nano, you may just be better off doing quick, simple things with vi.
I think someone cited some guides, and I'd look them up on the web and pick up fundamentals.
Without really explaining them much, these are about the only keystrokes I commonly use: ESC, :, h, j, k, l, de, dd, w, q, !, i, and a
I've seen people visit multiple buffers and copy/paste, that stuff I never learned, all above is just how to get into command mode, insert/append modes, go up, down, left, right, delete a chunk or entire line, and then write, or quit, and also force the action to write or quit.
@MikeRamos
There's also Vim (Vi Improved). Open a terminal, enter vimtutor, and it takes you interactively through the basics.
P.S.
On Slackware, vi is actually a link to elvis (another modification of vi, not the dead singer).
I find vim a lot easier than vi because it supports things like the arrow keys that are standard on all modern keyboards. There is also a graphical version called gvim in which the powerful keystroke commands are supplemented by a tool menu. Slackware's system editor, elvis, is quite similar to vim, so much in fact that I find the differences between them rather confusing.
I don't know which version on Slackware OP is running but on -current I think vi is a link to nvi - another vi incarnation. Just do this in terminal
Code:
$ ln -l /usr/bin/vi
also if you have manuals installed (and you should if you have full Slackware installation) - manuals are your best friends. They give you starting point. To read manual for vim eg. in command line do
Thanks for all the help! VIM tutor has been great. My buddy showed me how to make VIM the default "VI". He also got a few plugins for me that really help. Slackware is amazing. If I can figure out how to do Slack video conferencing on it I'll trash Windows and Mac for good.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.