LinuxQuestions.org
Help answer threads with 0 replies.
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 03-13-2016, 10:51 AM   #1
Geoff.
LQ Newbie
 
Registered: Mar 2016
Location: Finland
Distribution: ubuntu
Posts: 7

Rep: Reputation: Disabled
Trouble with VI


Hi i tried using Vi today for the first time and while the expected start page comes up i cant type anything not even ;q to quit.
Any advice would be welcome.
Thanks Geoff
 
Old 03-13-2016, 11:16 AM   #2
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
What happens if you do the following:

Code:
 

touch file1; echo "hello world" > file1 ; vi file1

vi file1
Are you able to see the output in file1? Are you able to append and exit out?

What distro is this?
 
Old 03-13-2016, 11:19 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
you can alway try to press ESC (several times) before :q!
 
Old 03-13-2016, 11:22 AM   #4
vedearduff
LQ Newbie
 
Registered: Mar 2016
Location: Central Indiana
Distribution: Slackware 14.2 Beta
Posts: 13

Rep: Reputation: Disabled
In vi, you need to go to the editing mode. With a new file, hit i or a and you will be in edit mode. To get back to command mode, hit the escape key. To exit, you need to be in command mode. To exit vi, hit the : key and then enter one of the quit options. These options are; q if there have been no changes, q! if there are changes you do not want to keep, and wq to exit and save.

If you did not specify a file name when you started vi, you will be prompted for a file name. There is a tutorial file that is part of the vi package. Place a copy of this file in your home directory and work throug the tutorial. There is a bit of a learning curve, but once you learn vi, you will like it.

I use it on my windoze box.

Last edited by vedearduff; 03-13-2016 at 11:23 AM. Reason: typo correction
 
Old 03-13-2016, 11:39 AM   #5
Geoff.
LQ Newbie
 
Registered: Mar 2016
Location: Finland
Distribution: ubuntu
Posts: 7

Original Poster
Rep: Reputation: Disabled
ok thanks for the help guys think i have got it working now.
 
Old 03-13-2016, 07:11 PM   #6
offgridguy
Senior Member
 
Registered: Nov 2015
Location: Alberta Canada
Distribution: Windows10, Debian
Posts: 1,109

Rep: Reputation: 147Reputation: 147
There are lots of choices for text editor besides vi, you may want to look at, vim came in first as text editor of the year.
http://www.linuxquestions.org/questi...20#post5514620

Actually I like vi, but it's not the easiest to use.

Last edited by offgridguy; 03-13-2016 at 07:12 PM.
 
Old 03-13-2016, 07:40 PM   #7
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Type vimtutor for a very nice introduction to Vi/Vim.
 
Old 03-13-2016, 08:35 PM   #8
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,323
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
If you have vim installed (and, on Ubuntu, you will probably find the "vi" is aliased to "vim") try running this at the command line:

Code:
vimtutor
It will open a short tutorial.

Also, HPR has several podcasts available about vi and vim. You may find them and the associated shownotes useful.

Full disclosure: I did two of them.
 
Old 03-13-2016, 10:04 PM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,150

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
try pressing the "insert" key once on the keyboard, then start typing.

Press "esc" key once and press ":q!" to quit.

Good luck!! Search the web there's quite a few tutorials.

Check out this link: Learn VI the easy way
 
  


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
having trouble starting program after update (I think its permission trouble) Adol Linux - Newbie 3 05-31-2012 12:50 AM
Sound Trouble + Modem Trouble on Knoppix 4.0 AJones Linux - Software 0 01-05-2007 12:06 PM
Trouble with SCSI, Trouble with Sata humbletech99 Linux - Hardware 0 05-24-2006 04:05 AM
trouble ahead, trouble behind....trouble with mplayer Goonie Linux - Software 3 07-02-2003 02:29 AM
Kernel Trouble (Not actually trouble though) chem1 Linux - General 4 10-01-2002 01:10 AM

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

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

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