vim quick question

Discuss Applications

vim quick question

Postby Calum » Tue Mar 04, 2003 4:07 pm

Image

when you start vim by typing simply 'vim', how do you then get it to do something? ie what are the commands for opening a new file and so on? i tried to type all the things it says on the startup screen but nothing seems to happen...
Last edited by Calum on Wed Mar 05, 2003 5:21 am, edited 1 time in total.
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby Void Main » Tue Mar 04, 2003 5:01 pm

Did you type the ":" in front of the command? For instance ":help" loads the help file. You can PGUP/PGDN or CTRL+F/CTRL+B through the file. I normally load files as parameters to vim but if you load vim and then want to load a file use the ":e" command:

:e /etc/passwd

A cheater way of finding that out is to load "gvim" and click the "file" menu and it shows the vim command next to the menu command (Open - :e).

You might want to find some online tutorials and it would be wise to print out a quick reference card until you have the basic commands memorized. Here's one:
http://tnerual.eriogerg.free.fr/vim.html

Here is the online help as a web page with hyperlinks:
http://vim.sourceforge.net/htmldoc/help.html
User avatar
Void Main
Site Admin
Site Admin
 
Posts: 5705
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA

Postby Linux Frank » Tue Mar 04, 2003 5:07 pm

And you could also try Vim book

Which is pretty good.

vi /home/user/file or vi /home/user/newfile will also answer your needs.
Linux Frank
administrator
administrator
 
Posts: 239
Joined: Fri Jan 10, 2003 2:06 pm

Postby TheQuirk » Tue Mar 04, 2003 9:49 pm

Or if you don't know what you want to call it, but want to make a file anyway...

:enew

When you're done...

:sav /path/to/new/file.whatever (the extension is unimportant, of course).
TheQuirk
programmer
programmer
 
Posts: 113
Joined: Wed Jan 22, 2003 4:11 pm

Postby Calum » Wed Mar 05, 2003 5:20 am

thank you guys! that's great! as for gvim, i never would have thought of that. the xwindows implementations of emacs really CeNsOrEd me off, so i tend to steer clear of GUI implementations of text based things out of habit now. in particular i like how if you type 'vim' in an xterm it doesn't rudely start up the xwindows version (not mentioning any emacs - although in mandrake it is possible to install emacs with no xwindows support, ha! suck it emacs!)

specifically though at the moment i wanted to know how to open vim like that, i couldn't have used gvim anyway, reason being i was using windows (yeurgh!) which i have had to reinstall after many months of happiness due to a proprietary program i need to run for my university course (runs in wine, but toolbars don't work, before anybody asks), and in windows i have freemacs and vim6.1 installed but no gvim. i also have staroffice 5.1, gaim, opera, phoenix and netscape 3 installed but it still doesn't feel like home. my ex-windoid girlfriend has steered well clear of windows since i reinstalled it, i think she's a firm convert! :D
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland

Postby TheQuirk » Wed Mar 05, 2003 6:53 pm

GVim can run in Windows.
TheQuirk
programmer
programmer
 
Posts: 113
Joined: Wed Jan 22, 2003 4:11 pm

Postby Calum » Thu Mar 06, 2003 9:28 am

well, you learn something wrong every day! ;)
luckily, i only need windows on the nights that i need to use the online chat or file uploading facilities in first class client (that's been two nights so far) so i haven't had much of a chance to give a oops about what programs run in windows, to be honest.
User avatar
Calum
guru
guru
 
Posts: 1343
Joined: Fri Jan 10, 2003 11:32 am
Location: Bonny Scotland


Return to Applications

Who is online

Users browsing this forum: No registered users and 1 guest