LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 05:40 PM   #1
AlexBB
Member
 
Registered: Mar 2014
Posts: 435

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, 06:09 PM   #2
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

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

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, 06:26 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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, 06:28 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,885
Blog Entries: 1

Rep: Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005Reputation: 2005
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 06:30 PM.
 
Old 03-30-2014, 08:13 PM   #6
AlexBB
Member
 
Registered: Mar 2014
Posts: 435

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, 05:19 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

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


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 tutorial in 5 minute, learn vi/vim is to know what the letters stand for cheats anish2good Linux - Newbie 1 07-16-2013 01: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 06:45 AM
LXer: Personalize and Optimize Vim editor using Packtís new Vim 7.2 book LXer Syndicated Linux News 0 05-20-2010 11:20 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 12:46 PM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 05:26 PM


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