LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-03-2014, 11:12 PM   #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-03-2014, 11:57 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Code:
vim filename
Try
Code:
vimtutor
# or
vim
for the tutorial
See also www.vim.org
 
Old 02-04-2014, 01: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, 02: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 02:05 AM.
 
Old 02-04-2014, 03:12 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

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

':wq' is the slow way

Last edited by chrism01; 02-04-2014 at 03:13 AM.
 
Old 02-04-2014, 04: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, 07:09 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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 07:13 AM.
 
Old 02-13-2014, 01: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



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

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

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