LinuxQuestions.org
Review your favorite Linux distribution.
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 07-22-2008, 04:38 PM   #1
metroid2k
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Rep: Reputation: 0
Where to start with learning Vi/Vim?


Probably not the best title ever, but this is more of a generic question. I've recently picked up Fedora 9 in order to try and learn more about Linux and how it works, and I've read through a beginners guide to linux which covers basic usage of the OS, I can move files around, copy, paste, make folders etc, what I'm stuck at now is what should I look at next. A few friends recommended learning Vi/Vim, although I have no idea where to start with this, from what I understand its a text editor, which to put into perspective, I'm a windows user so to me that would be something like notepad.

Anyway apparently Vim can be used to program things as well, but I have no idea what I'm doing, so my questions are this: Where is the best place to start learning Vim, are there any books that would be worth reading, and what would be a good project to set myself to do to get the most out of the Vim?

Thanks in advance!
 
Old 07-22-2008, 04:48 PM   #2
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Just click the Help menu to acquaint yourself with the basics. As for books, there is one in the O'Reilly series that goes in depth (can't remember the title, sorry).

Vim is nothing like notepad, by the way, it's so much more.

Last edited by jay73; 07-22-2008 at 04:49 PM.
 
Old 07-22-2008, 05:07 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Get the Vi IMproved - Vim book by Steve Oualline, published by New Riders; its terrific.
 
Old 07-22-2008, 05:25 PM   #4
gNguyen
Member
 
Registered: Jul 2008
Distribution: FreeBSD, Slackware, Debian
Posts: 67

Rep: Reputation: 15
Try this http://www.ph.unimelb.edu.au/~ssk/vim/howto.html
 
Old 07-22-2008, 05:35 PM   #5
GeekBoi
LQ Newbie
 
Registered: Aug 2006
Posts: 3

Rep: Reputation: 0
Try vimtutor. It should be in the default fedora install. Also just search online for vi tutorials. That will be the quickest way to get up and running. Then look at the books mentioned in other posts for the more advanced editing/search functions and settings.


Charlie
 
Old 07-22-2008, 07:39 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
Also the home page has lots of help: http://www.vim.org/
and its free
 
Old 07-22-2008, 08:08 PM   #7
nawuza
Member
 
Registered: Jan 2007
Location: High Castle
Distribution: FC8
Posts: 66

Rep: Reputation: 15
just type vimtutor in the terminal.
 
Old 07-23-2008, 03:30 AM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,062

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
Given your background, I'd have guessed that a gui-based editor like kate would have been easier for you to get started with, but learning vim (or joe) is a good thing to do anyway. Not everyone will like one of those, though.
 
Old 07-23-2008, 04:19 AM   #9
mrrangerman
Member
 
Registered: Oct 2007
Location: MI
Distribution: Debian Slackware
Posts: 528

Rep: Reputation: 50
This will give you the basics, demo
 
Old 07-23-2008, 08:05 AM   #10
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Graphical vi-vim Cheat Sheet and Tutorial
 
Old 07-23-2008, 11:47 AM   #11
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
vi is a text editor. vim is vi iMproved and mostly on Linux machines these days you'll encounter vim rather than vi. If you just run 'vi' it'll tell you what variant it is. Vi(m) can be used to 'program things' in the same way that any other text editor can be - I.e. you can use it to create and edit text files and since programming is just writing code, which is text, then you can use it to write code, be that C++, perl, Javascript, HTML, whatever. But there's nothing special about that, the same is true for any text editor including Notepad.

If you are in the business of administering *nix machines over an ssh connection or working on machines where there is no GUI environment installed, then the ability to use vi is pretty much essential as the availability of some variant of vi on any given *nix is a near certainty and the same can't be said for other text editors. (emacs, maybe...) However if you're just mucking about at home then there is no actual reason to use vi. I've been using *nix type systems for 15 years and am quite happy using vi when I need to, but mostly I use Kate.

The thing that people tend to find the most confusing when they've never used vi before is that it's got two modes. One mode allows you to type text, the other issue commands.

The most important key sequence to learn for vi is Esc Esc : q ! which will quit without saving any changes to the file you were editing. Very handy if you've got in a total mess.
 
Old 07-25-2008, 04:11 PM   #12
metroid2k
LQ Newbie
 
Registered: Jul 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Cheers everybody, been slowly understanding more and more about Vi and VIM, I've chosen to go with learning the text based one over the gui as I cant always get my Gui to work, I'm still having configuration issues every so often.
I must admit the tutorial is quite helpful, and I can at least get my X terminal to restart when it all goes horribly wrong
 
Old 07-25-2008, 11:40 PM   #13
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
Just in case you didn't follow the link I provided thinking it was for the GUI version of vi/vim.. it is not. it is a graphical representation of the keyboard with the keys marked for what they do in vi.. it's really a very handy reference for the command line version.
 
  


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
Where did U start learning linux? caleb star Slackware 55 10-21-2011 08:17 AM
Wanting to start learning linux mystex Linux - Newbie 9 05-16-2006 01:52 AM
Learning Linux: how do I start? karlkropotkin Linux - Newbie 2 03-15-2006 10:11 PM
how to start learning kdevelop?? gajaykrishnan Programming 2 07-30-2004 11:41 PM
Learning Python... where do i start?? Claus Programming 2 09-02-2003 06:42 AM


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