Re: vi


Subject: Re: vi
From: James Gibson (twistedhammer@subdimension.com)
Date: Fri Jul 05 2002 - 01:41:29 AKDT


On Thu, 4 Jul 2002, Adam Elkins wrote:
>
> Ok....I HATE VI! Nothing ever seems to work the same way twice for
> me....I'm simply trying to edit a config file.....I hit 'insert' and
> usually, hitting delete get rid of stuff....today, it just beeps at me. Why?
> 'insert'
> What removes text?

**Note, from your post it's hard to tell what level of knowledge you
currently have of vi. If the following is obvious and unhelpful or worse,I
apologise in advance. --James**

First: What version of vi are you using? vim?

Second: when you say 'insert' do you mean the button marked as such, or
the letter 'i'? I can't honestly recall ever using the <ins> key in vi...
ever, and I've been using vi do do everything from edit config files to
coding perl to writing term papers for years.

The short answer to 'what removes text' is:

'x' removes the character your cursor is on in command mode or visual
mode.
'dd' removes a line of text in command mode (or visual mode? not sure).
'<bksp>' removes the character to the left of your cursor (unless perhaps
you are typing in arabic in which case it might be to the right.. really
you'd be on your own on that one.. ;p)
'<del>' (the delete key) is _usually_ set to work like 'x' (but in any
mode) for vim, but various default installs have quirks.. I've had
installs where (in insert or replace mode) it will only allow you to use
<del> to delete stuff which you have typed since entering insert mode.. It
works fine in command mode, and I'm sure that behaviour is modifiable, but
I don't use <del> often enough to care. <bksp> sure, but <del>? naw..

Things to remember:
'i' puts you into insert mode from command mode.
<esc> exits from insert mode back to command mode.

The modal paradigm can make it seem like things only work some of the
time.. that's because they do; It's all highly dependent upon which mode
you are in.

If you aren't firm on the basics of vi (and you are running vim) the
command 'vimtutor' (typed from your shell prompt, not from within vi)
should land you in a basic walkthrough.. vi's initial learning curve is a
bit steep; if you are still fuzzy on the whole 'mode' issue it can be
really rough... you might also want to take a look at vim's copious online
help pages.. type ':help' whilst in command mode in vim.

Hope that helps..

--James Gibson

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Fri Jul 05 2002 - 01:43:59 AKDT