LinuxQuestions.org
Visit Jeremy's Blog.
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 02-04-2014, 12:12 AM   #1
cfeehan
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
Question creating a file using vim


I'm taking an intro to Linux class and one of our lab exercises is to create a file "practice" using a vim editor.. but the text doesn't give examples and I've yet to find a tutorial. I'm lost. Can anyone tell me how to create a "practice" file using vim?
 
Old 02-04-2014, 12:57 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Code:
vim filename
Try
Code:
vimtutor
# or
vim
for the tutorial
See also www.vim.org
 
Old 02-04-2014, 02:49 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
http://www.openvim.com/tutorial.html

using vim tutorial in a search engine
 
Old 02-04-2014, 03:01 AM   #4
padalia.rushabh
LQ Newbie
 
Registered: Nov 2013
Location: Singapore
Distribution: Fedora , Ubuntu , Linux Mint
Posts: 8

Rep: Reputation: 0
Code:
vim filename
This will open vim editor

Press i to switch to insert mode before the current position.(This will allow you to type)
Type the stuff you want to and

Then press ESC and type
Code:
:wq
to save and exit

w means to write and q means to quit

for interactive tutorial: http://www.openvim.com/tutorial.html

Last edited by padalia.rushabh; 02-04-2014 at 03:05 AM.
 
Old 02-04-2014, 04:12 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Code:
:x
to save and exit

':wq' is the slow way

Last edited by chrism01; 02-04-2014 at 04:13 AM.
 
Old 02-04-2014, 05:45 AM   #6
pirozhok
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Code:
:x
to save and exit

':wq' is the slow way
Or just ZZ.
 
Old 02-04-2014, 08:09 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
Quote:
Originally Posted by chrism01 View Post
Code:
:x
to save and exit

':wq' is the slow way
Too late, :wq is already burnt in. I even had to set up an alias from :wq to exit in my shell to avoid errors.

On topic: There are also a couple of sites with good video tutorials for using, configuring and extending Vim, like for example http://vimcasts.org/
Can be very helpful to see what a feature actually does, sometimes just reading about it doesn't really help.

Last edited by TobiSGD; 02-04-2014 at 08:13 AM.
 
Old 02-13-2014, 02:57 PM   #8
cfeehan
LQ Newbie
 
Registered: Feb 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Smile Thanks

Thanks everyone, all the information really helped. I got it down now!
 
  


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
Vim: jumping from file c1 to file c2 without saving c1 first. stf92 Linux - Newbie 9 08-02-2011 09:23 PM
Vim :: Creating Syntax Files cin_ Linux - Software 4 01-27-2011 05:49 PM
vim file.tex !latex file.tex & pdfdvi file.dvi & xpdf -remote sname -reload Mol_Bolom Linux - General 0 07-09-2009 08:46 PM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 05:26 PM
vim always says swap file already exists for a particular file leftty Linux - Software 1 09-13-2008 02:53 PM


All times are GMT -5. The time now is 01:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration