Ok… Another question.
What’s a vi editor?
I thought that it’s a text editor. Right?? If it is, then why just not use notepad?
Thanks
Ok… Another question.
What’s a vi editor?
I thought that it’s a text editor. Right?? If it is, then why just not use notepad?
Thanks
vi is an editor that comes standard on a lot (most) unix/linux distributions. When I edit code, I am doing so directly on the web server, so I don’t have notepad available to me. I find that I can program faster with vi than any other editor (pico, emacs, etc).
It’s a pain to learn… but once you do you’ll never go back.
Yeah, I’m just starting to get the basics down, and it definately does speed stuff up. It’s the only editor available on some of the machines I work with, so I was kinda forced into learning it.
The best way I can describe it is that it’s a text editor without ANY user interface–not even menus. It works really well over telnet/SSH because of this and doesn’t require any fancy graphics packages installed like X, etc.
Notepad is Windows only, so you don’t get it with any other OSes like Linux, Unix, or MacOS. The thing with vi is that it’s console based, but it’s waaaaay faster. BUT once you get the commands down. Like the others say, t’s a pain to learn. For example, when you start it, you don’t just start plugging in text right away; you have to change modes first. And some commands are cryptic or not immediately intuitive.
I think it’s pronounced vee-eye, and vi stands for VIsual, and it’s an improvement over ed, which is an older editor?
If you’re really interested, you can sign up for a shell account by telnetting to sdf.lonestar.org and typing “vilearn”.
Don’t let that scare you away from editing text with Linux on a server…
There are many more easier to use editors like pico/nano, ee, and a slew of others.
Also, if vi’s simplicity doesn’t suit your fancy you can try emacs which has an unbelievable amount of features built into it, but some people think it’s bloated.
If you need anymore help or have any questions, pm or e-mail me.
Later
Jack,
Written in 1976 by Bill Joy at Berkley for BSD, the vi editor was incorporated into System V of UNIX and has been around ever since.
For more information on the history please see:
http://www.cs.pdx.edu/~kirkenda/joy84.html
vi (pronounced “vee eye” and never capitalized) has a plain keyboard interface for every function. As an example: h, j, k and l move the cursor because Teletype interfaces to the old PDP-11, et cetera had no arrow keys.
If you are a Windows person and will infrequently program on UNIX, Linux, et cetera, vi is a bit of a pain to learn and you should not bother. It really takes a few days to get the hang of it.
However, if you want to be a geek (and be proud of it), vi is one of those tools that you will have to master if you want to be taken seriously as a programmer… IMHO.
For a good tutorial from the guy who wrote it, see:
http://docs.freebsd.org/44doc/usd/12.vi/paper-1.html#section6
Good luck.
Take the time to learn vi, you won’t regret it. After learning the commands and becoming familiar with them you’ll be able to edit code a lot faster than with a simple editor like notepad or pico. A few quick keystrokes gives you access to simple commands (moving through text, yank & paste, delete) and very powerful commands (repeat, macros, search & replace). The fact that all the commands are on the keyboard instead of menus is what makes it so quick (and of course confusing & difficult to learn), you never have to remove your hands from ‘home position.’
I actually never use vi, I’ve switched to vim, which stands for “vi improved.” It comes with most Linux distributions and you can get it for almost any OS at http://www.vim.org It adds GUI support, multiple undo / redo, syntax highlighting, multiple buffers, split screen, visual mode, and a whole lot more. Go download it and try it out.
Mike
*Originally posted by Mike Soukup *
**I actually never use vi, I’ve switched to vim, which stands for “vi improved.” It comes with most Linux distributions and you can get it for almost any OS at http://www.vim.org It adds GUI support, multiple undo / redo, syntax highlighting, multiple buffers, split screen, visual mode, and a whole lot more. Go download it and try it out.Mike **
OH! I forgot, now that we have our own server… I can install vim on the server. Hooray! Thanks for the reminder.
I believe vi is great. Although emacs provides far more features and many use it religiously. I use vi because it’s available in linux and freebsd and other *nix systems I work with. Also vi uses far less system resources. Once you master all the keystrokes it will be a fast easy way to edit files. If you prefer nice color syntaxing for coding I suggest vim. It provide color syntaxing for most of major languages. (c, c++, php, perl, python etc.). To enable it type :syntax on. you can add that to your .vimrc .
I use(d) ‘syntax on’ at work for a while, but with our version of vim, it seemed to mess up when you would page through many pages of code. You’d have to go all the way up to the top of the file for it to reset its syntax highlighting. Other than that little fluke, I liked it.
I also like ‘set showmatch’ which will make the cursor temporarily jump to the opeining parenthesis/brace/bracket/etc you are currently closing.
Wow. I really have to admit, when this thread was started, I thought it’d just turn into another flamewar between vi[m] lovers and emacs lovers. Much to my joy, it hasn’t.
I don’t know all the intricacies of vi yet, but for practically all of the text editing I do in Linux, I use it.
I tried using vi at one point, but I normally use a dvorak keyboard layout, so the location of many of the keys (e.g. j,k,l,m) make vi even harder and slower for me to use. Because of this, i use emacs whenever I need to do any *nix programming.
Heh. I’ve never tried a dvorak keyboard. I have a qwerty keyboard which I normally use at school. But at home I have a sun type 5 keyboard and a keyboard with a similar layout for my pcs which I find easier to use with vi.
Dvorak is a completely different layout from the qwerty style. The keys are arranged so typing is quicker. I can type a little faster with it than I can with a qwerty and I am still trying to learn to type faster with it.
Dvorak Keyboard Layout
*Originally posted by josh_johnson *
**Dvorak is a completely different layout from the qwerty style. The keys are arranged so typing is quicker. I can type a little faster with it than I can with a qwerty and I am still trying to learn to type faster with it.
Dvorak Keyboard Layout **
Whether Dvorak is actually a faster keyboard layout is rather controversial. I’ve never seen any good evidence that it is (too much of it is anecdotal). It is supposed to be better on your wrists but I think an ergonomic keyboard is a better solution there.
Matt
In the days of typewriters the qwerty layout was designed to slow down the typing because if you typed too fast the typewriter would get stuck. Later the dvorak layout was developed to reduce errors and increase speed. But since qwerty was still more popular it stuck when computer were later developed. So technically dvorak is superior but qwerty is more widespread.
*Originally posted by ckim *
**So technically dvorak is superior but qwerty is more widespread. **
I’m not sure I could re-train my mind to use Dvorak.
Back to the vi topic.
I used to use PICO (part of the PINE mail client) to edit everything on our Linux server (http://team871.zapto.org/) but once I learned vi I found it just as simple to use as pico or any other text editor. Oh and yes, I use SSH exclusively to admin the server. command line administration is a great skill to have, you can’t always physically be seated at your server.
I’ve also found it quite useful to do quick edits via an FTP program.
Example, I use FlashFXP, I connect to the servers FTP, then change over to the directory where our team website resides and just right click on the HTML doc I want to editand select “edit”. FlashFXP opens the file in its own text editor, I make the necesary changes, close the file and FlashFXP prompts to UPLOAD the changed file. no need to SSH and edit separately.
I hope some of this info helps, now I’m back to work on our team site
If anyone else is interested (While we are talking about editting) our team came across a nice little piece of HTML/java that creates a text based countdown clock. Right now it is counting down to kick-off, then it will count down to Robot Ship date.
*Originally posted by Jack *
**Ok… Another question.What’s a vi editor?
I thought that it’s a text editor. Right?? If it is, then why just not use notepad?
Thanks **
vi is an evil program that allows you to edit unix files from the command line. I prefer pico over vi, but more than both I prefer to use BBEdit–the mac version of notepad–and save it to my desktop, and then just copy the file.
For example, the apache configuration file is read only. So I open it, change it, save it to my desktop, then type
sudo cp ~/Desktop/httpd.conf /etc/httpd/httpd.conf
and it’s placed over there.
–Petey