vi is the new scite

Scite is my favorite text editor. I like the syntax highlighting and the ease of use. Searching and replacing is easy and every command is easy to find. I thought that I would never find another text editor I liked that much. If you haven't tried the vi editor yet, you're probably going to be as surprised as I was. There is a little learning curve, but it's worth it. It is a very powerful program and it even lets you write your own macros. Here is a really short introduction to vi for newbies that I wish I had when I was learning it.

vi has two modes: command mode and insert mode. The program starts in command mode, which is for entering commands. Insert mode is for inserting text into your document, and --INSERT-- shows up on the bottom of the screen. To get back to command mode, you simply hit the ESC key at any time.

To enter text into your document, type an i (for insert). This puts you into the insert mode. You can move around using the arrow keys and the [page up] and [page down] keys. The delete key deletes characters and the backspace key backs over characters, deleting them. So once you're in INSERT mode, type away to your heart's content. To save your file, re-enter the command mode by hitting the ESC key, and type :w myfilename. a :q quits the program.

I must admit, I don't use many of the movement commands. The reason is that the arrow keys work fine. I also don't use the editing commands, because again delete and backspace suit my needs. I do use the /whatimlookingfor command to search forward to find a bit of text.

Here is a list of some of the most used commands (used in command mode, of course):

:w............saves the current file
:w filename...saves a file as filename
:q............quits vi
:wq...........saves the file and quits vi
i.............enters the insert mode (text is put before
.................the cursor)
a.............enters the insert mode (text is appended
.................after the cursor)
o.............enters the insert mode (text is put on a new
.................line after the cursor)
x.............delete the character under the cursor
dd............delete the line the cursor is on
/whatiwant....search forward for whatiwant
?whatiwant....search backwards for whatiwant

That's it. You're up and running on vi. That only scratches the surface of the vi text editor, but now it's usable for >95% of the things you'll need to do.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

vimtutor

What really got me going with Vim is the "vimtutor" command, which loads up vim with a tutorial document explaining all the basics. I'm not sure if it's been ripped out of DSL, so don't be too disappointed if you get an error, or nothing.

One thing I've had to do in DSL, though, is make an "alias vim=vi", because I got so used to typing "vim". Funny how that works...the app in DSL is Vim, but the command is vi. On my suse box, there's a link called vi which leads to vim.

A good Vim cheat sheet

http://www.tuxfiles.org/linuxhelp/vimcheat.html

Posted with Links (text mode)

Vi is ubiquitous

Any unix system that you may come upon will have vi.
This alone is reason to learn vi.

It is the only editor that I use, but then again, it was the only editor available when I started to use unix based systems.

Gui's only confuse me and slow me down, but I am learning.

same here

Vim is the only editor I've used for the last year except for two cirumstances....
1) In Windows I use only UltraEdit (haven't tried vim in that system yet).
2) If I want to copy & paste a large amount of text I use a gui editor like gedit for its drag-and-scroll ability. If someone knows a way to select text beyond the window size in vim I'd be happy to learn about it....I always end up deselecting when I try to scroll the page.

Vim on Windows

I've used Vim on windows before, it is a lot like Vim-gtk.

BTW, Vim-GTK is a great way to start using Vim, it has all the ctl commands on the drop-down menus so you could start learning them while you are still point and clicking.

middle button or ma?

Were you trying to use the middle button on the mouse to copy the highlighted area? I use ma y'a and p to copy and paste in vi.

y'a?

I was talking mainly about copying a large amount of text in vi and then pasting it into another document, such as this text box for example.
I can highlight a whole page and paste that, but if I attempt to select text which scrolls beyond the size of the window, it all gets deselected and I end up copying only what is currently visible onscreen.

I've tried something similar in Bash, selecting text from stdout, but the same thing happens. Maybe I just don't know how to properly select it....oooohhh.....
shoot....I just figured it out =o)))))
Use the right-mouse to select instead of left-mouse. Sweet!

How much is cutdown from VIM?

How much of Vim is cut down from the full version for inclusion in DSL, I wonder.

Vim is certainly the most efficient test editor. For those who MUST have a GUI, there is gvim.....