LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-05-2021, 08:04 AM   #1
MikeRamos
LQ Newbie
 
Registered: Jan 2021
Posts: 2

Rep: Reputation: Disabled
Question Slackware Vi Learning Curve


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?
 
Old 01-05-2021, 08:40 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
There is also nano editor, you use edit commands with control key as shown at bottom of page.
There are many tutorial for vi, eg
https://www.washington.edu/computing/unix/vi.html
 
1 members found this post helpful.
Old 01-05-2021, 08:42 AM   #3
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
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:

https://www.howtogeek.com/102468/a-b...files-with-vi/

Don't be put off by the fact he's using Ubuntu. Vi is the same on all distros.
 
1 members found this post helpful.
Old 01-05-2021, 08:58 AM   #4
TorC
Member
 
Registered: Dec 2020
Location: as far S and E as I want to go in the U.S.
Distribution: Fossapup64
Posts: 224

Rep: Reputation: 78
@MikeRamos -- Welcome! and Congrats on starting with Slackware!


Just FYI


https://www.osetc.com/en/how-to-save...xt-editor.html

https://phoenixnap.com/kb/best-linux...ors-for-coding

Nano

Last edited by TorC; 01-05-2021 at 09:11 AM. Reason: addendu, edit spacing
 
1 members found this post helpful.
Old 01-05-2021, 09:25 AM   #5
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
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.
 
Old 01-05-2021, 09:35 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Quote:
Originally Posted by igadoter View Post
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.
 
2 members found this post helpful.
Old 01-05-2021, 09:41 AM   #7
EdGr
Member
 
Registered: Dec 2010
Location: California, USA
Distribution: I run my own OS
Posts: 998

Rep: Reputation: 470Reputation: 470Reputation: 470Reputation: 470Reputation: 470
vi is a very arcane editor. It was miserable even by 1980s standards but we used it because it could run on any cursor-addressable terminal.

Today, there are much more friendly editors like mousepad. "grep" is a good way to learn regular expressions.
Ed
 
1 members found this post helpful.
Old 01-05-2021, 09:54 AM   #8
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
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.
 
1 members found this post helpful.
Old 01-05-2021, 09:58 AM   #9
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by brianL View Post
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.
 
1 members found this post helpful.
Old 01-05-2021, 10:07 AM   #10
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.

EDIT: A quick search for commands in vi: https://www.thegeekdiary.com/basic-v...s-cheat-sheet/

Last edited by rtmistler; 01-05-2021 at 10:08 AM.
 
1 members found this post helpful.
Old 01-05-2021, 10:16 AM   #11
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
@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).

Last edited by brianL; 01-05-2021 at 10:23 AM.
 
2 members found this post helpful.
Old 01-05-2021, 10:58 AM   #12
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
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.
 
1 members found this post helpful.
Old 01-05-2021, 11:10 AM   #13
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
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
Code:
$ man vim
for elvis
Code:
$ man elvis
for nvi
Code:
$ man nvi
 
1 members found this post helpful.
Old 01-05-2021, 12:46 PM   #14
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
On my current vi is a link to vim.
 
1 members found this post helpful.
Old 01-05-2021, 04:00 PM   #15
MikeRamos
LQ Newbie
 
Registered: Jan 2021
Posts: 2

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware learning curve offgridguy Slackware 8 09-23-2016 12:26 AM
How to implement elliptic curve cryptography(EDWARDS Curve) to my Topology surya.prakash Programming 4 07-06-2014 01:09 PM
Enjoying riding the learning curve steelcap LinuxQuestions.org Member Intro 2 01-17-2006 05:24 PM
Do you think Slack has a really hard learning curve? dai Linux - General 28 08-22-2002 10:19 AM
The 'GUI' learning curve... tcritchell Programming 5 10-15-2001 11:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration