LinuxQuestions.org
Visit Jeremy's Blog.
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-30-2014, 04:40 PM   #1
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Rep: Reputation: Disabled
How to use Vim?


Hi there. My environment is Ubuntu as a VM under VirtualBox. I just installed vim (text editor for programmers) and decided to write a simple fortran program. Well, the editor does not allow me to enter any text. When I type even a single character, a dull sound sounds and a red color message appears at the bottom of the editor:

Quote:
E353: Nothing in register "
What does it all mean?

Thanks, - Alex
 
Old 03-30-2014, 05:09 PM   #2
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Did you put vi in insert mode by hitting "i"?
 
Old 03-30-2014, 05:24 PM   #3
Myk267
Member
 
Registered: Apr 2012
Location: California
Posts: 422
Blog Entries: 16

Rep: Reputation: Disabled
Vim is quite a sharp tool, and as such, it's going to take real work to get to using it well if it's your first time. I happen to like this intro Learn Vim Progressively, but there are other Vim resources as well.

If you don't end up wanting to learn how to drive Vim, gedit for the GUI environment and/or nano for the command line. Both of those trade off ultimate text editing power for ease of use.
 
Old 03-30-2014, 05:26 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
i would print out a VI "cheat sheet" and tape it next to the monitor
something like
http://linuxtutorial.todolistme.net/cheatsheetvi.php
or this graphical one
http://www.viemu.com/a_vi_vim_graphi..._tutorial.html
or this pdf
http://www.cse.scu.edu/~yfang/coen11/vi-CheatSheet.pdf
 
Old 03-30-2014, 05:28 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
In another thread I once posted some instructins for quickly getting oriented with Vim - find it here, and look over the other helpful posts in that thread as well.

Here is a short paste from that post that might help you get going quickly...

Quote:
Next, get oriented quickly!

I think the most difficult thing for people who simply open vi or a clone is that they see the blank page and begin typing - and weird stuff happens! Then they can't get out of it and they leave in frustration thinking the learning curve is too steep!

So to get past that point as quickly as possible note the following:

1. Vi(m) has two modes - command mode and insert mode (also called normal mode and edit mode respectively).
2. When you first start vi it is always in command mode, so key presses are interpreted as commands, not text.
3. To enter insert mode from command mode simply press i, then begin typing your text.
4. To return to command mode at any time simply press the ESC key.

You will see helpful status messages in the lower left corner of the terminal window as you change modes.

To leave vi you must be in command mode (pres ESC if not sure) then try one of these:

ZZ (shift-zz) - writes (saves) the current edits and exits.
:wq - writes (saves) the current edits and quits (same as ZZ).
:q - quit, prompts you to save any unsaved edits first (:w will write the to file)
:q! - quits without saving edits.
Also - from a terminal simply type vimtutor to get the always present on demand Vim tutor!

Last edited by astrogeek; 03-30-2014 at 05:30 PM.
 
Old 03-30-2014, 07:13 PM   #6
AlexBB
Member
 
Registered: Mar 2014
Posts: 464

Original Poster
Rep: Reputation: Disabled
Many thanks to everyone for posting. I actually used gedit and it worked. Much simpler but I will learn Vim. - Alex
 
Old 03-31-2014, 04:19 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,363

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Native/short way to exit+save in vi/vim
Code:
:x
 
  


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 tutorial in 5 minute, learn vi/vim is to know what the letters stand for cheats anish2good Linux - Newbie 1 07-16-2013 12:23 PM
[SOLVED] How to make Vim (scripts) write to stdout? (or, how to use Vim as a filter program?) dedec0 Linux - Software 13 02-04-2013 05:45 AM
LXer: Personalize and Optimize Vim editor using Packt’s new Vim 7.2 book LXer Syndicated Linux News 0 05-20-2010 10:20 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM

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

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