[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Star Office - was NHS privatisation
On Mon, Nov 27, 2000 at 03:58:47PM +0000, Barrie Bremner wrote:
> >But, this is coming from someone who's only ever used SOffice under
> >extreme duress. Vi and latex are my friends. Quick, simple and
> >memory efficient.
> >
> >A.D.
>
> Oh, good... you can tell me how to use VI. I'm an emacs fan, and can't figure
> out man vi, let alone vi itself.
> Unfortunately my OpenBSD boxen have vi at the moment.
>
> How do you edit, save, close and open files? I've figured out how to move and
> that's about it.
>
> Baz.
>
Easy peasy, lemon squeezy:
First, make sure you're in control mode, by pressing Esc. The only problem
with using 'vi' a lot is that when you use other editors you quickly notice
that pressing 'Esc' whenever you stop typing is a reflex reaction and is
very difficult to stop doing.
To save a file, just do a ':w' in Control mode. ':wq' will save a file and
then quit, while ':q!' will quit without attempting to save the current
file at all.
':e <filename>' will open a file for editing. This will complain if the
current file hasn't been saved yet. To open a new file without saving
the current one, you want to do a ':e! <filename>'.
To add text to the file, all you have to do is to go into insert mode
i - insert typed text before the current cursor position
a - insert typed text after the current cursor position
Don't forget to press 'Esc' when you've finished inserting text.
Editing:
s - typed text replaces current character.
r - replace current character with a new one.
x - delete the current character
dw - delete from the cursor to the end of the word, copy to buffer
dd - delete the entire current line, copy to buffer
D - delete text from cursor to end of line.
cw - change the text from current cursor position to the end of
the word. Typed text replaces the current word.
C - typed text replaces text to end of current line.
yy - copy current line to buffer
yw - copy from cursor up to end of word to buffer
p - place contents of buffer before cursor
P - place contents of buffer after cursor
Searching:
/<text> - find next occurence of <text>
?<text> - find previous occurenct of <text>
n - repeat last search operation
Oh yeah, and don't forget '.' is very useful. It means 'repeat the
last command.
That's mostly just a selection of some of the 'vi' commands I use
most commonly. I haven't even touched on the 'search & replace' commands, but
I'm sure that's enough to start with. The man page is useless, but the
O'Reilly books I've seen are good introductions, and I keep a copy of the
"vi Editor: Pocket Reference" nearby at all times.
A.D.
---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word
"unsubscribe" in the body of the message.
GNU the choice of a complete generation.