LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   editing etc/slackpkg/mirrors (https://www.linuxquestions.org/questions/linux-newbie-8/editing-etc-slackpkg-mirrors-4175583213/)

cmoore90638 06-27-2016 08:54 PM

editing etc/slackpkg/mirrors
 
I am really getting to feel stupid now.I am using VI to select a mirrors I get it open, but it won't uncomment. I am logged in as root. I have tried delete, space bar, and back space. the # will not disappear I have tried vi /etc/slackpkg/mirrors, and edit /etc/slackplg/mirrors. I haxe no idea what I am doing wrong, but I am sure it is something that will make me humble.

thank you in advance

notKlaatu 06-27-2016 09:10 PM

Maybe don't use vi for everyday maintenance yet, if you don't know vi. I mean, it's great to learn it at some point, but to start with maybe try `nano` instead.

Code:

# nano /etc/slackpkg/mirrors
For future reference, the delete key in vi(m) is 'x' (or 'd' if you want to get fancy).

I believe there's a vim tutor if you type 'vimtutor' into a terminal, but that's probably not on your top list of priorities yet :^)

yancek 06-27-2016 09:33 PM

I get the same results using vi but the 'x' key works to delete. Using vim instead of vi also allows use of the delete key.

frankbell 06-27-2016 10:00 PM

vi/vim has a learning curve. It's curve worth navigating, but it is a quite a curve.

Slackware includes vim. Open a terminal and type the command

Code:

vimtutor
That will open an excellent introductory tutorial to vim. Vimtutor is an integral part of a vim install.

I got along for some years knowing only four basic vi/vim commands:

ESC-i (enter insert mode)
ESC (enter command mode)
dd (delete line)
x (delete character)

A couple of years ago, I set out to learn vim (I did so by using Mutt for email and setting vim as my editor). Now it is my preferred text editor, because of its power and versatility, and I'm still just a vim beginner.

Ztcoracat 06-27-2016 11:25 PM

I generally use nano to edit the mirrors file. Give it a try.:)

Philip Lacroix 06-28-2016 01:28 AM

Vi is a very nice and powerful editor and my preferred one, though as frankbell I'm still using it at beginner level. Doing at least some basic reading is highly recommended: it will make your life much easier. The version of vi included in Slackware is elvis (the vi command is just a symlink to /usr/bin/elvis). The book "Slackware Linux Essentials" has a nice little section on elvis, perfect to get started: Chapter 16 - Vi.

Of course you can find the whole documentation on your machine:

Code:

/usr/doc/elvis-<version>/doc/elvis.html
The same documentation can be found online as well: elvis documentation.

Regarding Vim, in addition to frankbell's valuable mention of vimtutor, and to Vim's online help system, you can find the whole documentation here: Vim documentation.


All times are GMT -5. The time now is 12:01 AM.