LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 05-06-2007, 02:10 AM   #1
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Rep: Reputation: 30
Problems with VI Editor


OK, I want to write up a DMV record reports to my manager and heres what I did but something does not seem ok here below. I want to FIRST give it a file mane and then write and then quit the editor...How can I do this:

Heres what I did:

edit dmv1.txt





"dmv1.txt" [New file]
:vtfile
vtfile: Not an editor command
:



I just want to SAVE the file first and the write then SAVE AND quit.

ANd how would I repopen the file with DMV1.txt???

please expalin.
 
Old 05-06-2007, 02:30 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
:wq
should write and quit
 
Old 05-06-2007, 02:58 AM   #3
kebabbert
Member
 
Registered: Jul 2005
Posts: 527

Rep: Reputation: 46
Are you sure you invoked the VI editor?

>vi dmv1.txt

Isnt there another editor that is called "edit"?
 
Old 05-06-2007, 03:38 AM   #4
as400
Member
 
Registered: Apr 2004
Location: USA
Distribution: Solaris 10 (x86) and Windows XP Pro SP2
Posts: 596

Original Poster
Rep: Reputation: 30
1. Ok heres what I want to do below...
$ edit dmvfile1.txt

Then write the report in there and SAVE....
So my question is, how can I SAVE and then EXIT VI editor???

2. Also, how can I FIRST SAVE a file like DMVFILE1.TXT (OR OTHER FILE) and then write my stuff and then exit from VI?

3. Also, how I can rename or re-open to edit my report in VI and then SAVE it again and EXIT?

Please explain.

ALso I did wrote up notes in this but its kind of confusing....
 
Old 05-06-2007, 11:13 AM   #5
kebabbert
Member
 
Registered: Jul 2005
Posts: 527

Rep: Reputation: 46
start vi:
>vi dmvfile1.txt

then move the cursor to the right place with "h", "j", "k" and "l". when you are at the right spot, press "i" for insert text. Write your text. When done, press "esc". Now press "esc" again and enter the following string
:wq
which "w"rites the file and "q"uits the vi editor.
 
Old 05-07-2007, 09:05 AM   #6
Dox Systems - Brian
Member
 
Registered: Nov 2006
Posts: 344

Rep: Reputation: 31
You can save a keystroke and use ":x" to write and quit! :-)
 
Old 05-07-2007, 10:59 AM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You can save one keystroke more and use ZZ instead
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do I use an editor? staph Linux - Newbie 12 02-02-2007 10:12 AM
problems with installing Stani's Python Editor 0.8.1.b slack_prad Slackware 1 06-05-2006 09:21 AM
openoffice 1.9.79 equation editor problems salviadud Linux - Software 6 05-19-2005 04:02 AM
KDE Menu Editor Problems? Eklipz Linux - Software 0 12-12-2004 09:31 PM
new convert to slackware - problems installing bluefish editor though melquiades Slackware 11 07-06-2003 08:02 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 05:16 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