File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Editing in a vim editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Editing in a vim editor" Watch "Editing in a vim editor" New topic

Editing in a vim editor

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10032


When I opened my sources.list file and edited it, how could I save it? I simply closed it after typing in something and when I opened it the next time, it gave me a message saying that a swap file...recover...blah...blah...blah. How to save my changes in the vim editor?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
By typing ":w". ":wq" will save and exit.

Most VIM versions also have standard GUI menus with the corresponding keystrokes.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 10032

Is the vim editor shipped along with a normal Ubuntu installation or do we have to get it downloaded manually? If we have to download it manualy, is it a paid version? or a freeware?
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

VI is "the" Unix editor. You are practically assured of having it on a Unix or Unix-like system. VIM is "VI iMproved".

Vim is charityware. Its license is GPL-compatible, so it's distributed freely, but we ask that if you find it useful you make a donation to help children in Uganda through the ICCF.

About VIM

Here is a handy cheat-sheet for VI.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Editing in a vim editor
It's not a secret anymore!