vi editor commands not working

using SUSE v11.4

i am using VIM v7.3.62 but none of its commands are executing.
like pressing ‘q’ should exit the vi editor, ‘wq’ writes and quit but nothing is happening.

i have also updated & installed all the bug fixes but still the same.

is this really a bug or am doing something wrong?
any solution to this?

Not a bug. You missed something. To quit without saving is not “q”, but “q!”. To write to disk is not “w”, but “w!”. To save and exit you can also use (after Esc) “ZZ”. The problem is the absence of the exclamation mark.

Any reason why you’re starting to use vim ? Most “not-old-school” people prefer editors like nano, with a less steep learning curve.

Don’t you forget to type a** : **first to get into command mode? Just typing a q or wq somewhere in the text does not do what you expect.

Knurpht wrote:
> Not a bug. You missed something. To quit without saving is not “q”, but
> “q!”. To write to disk is not “w”, but “w!”. To save and exit you can
> also use (after Esc) “ZZ”. The problem is the absence of the exclamation
> mark.

Eh? The exclamation mark is only necessary to try to overcome data loss
or file permission problems.

The normal command to quit is plain “q”. If you have modified the text
in the buffer but not saved it, then you need to use “q!” as the error
message advises.

The normal command to write is plain “w”. You need “w!” if you are
trying to save to a file to which you do not have write permission, but
which resides in a directory where you can alter the file permissions.

Habitually using “!” removes the safety checks that some consider to be
useful.

soni shrikant wrote:
> using SUSE v11.4
>
> i am using VIM v7.3.62 but none of its commands are executing.
> like pressing ‘q’ should exit the vi editor, ‘wq’ writes and quit but
> nothing is happening.
>
> i have also updated & installed all the bug fixes but still the same.
>
> is this really a bug or am doing something wrong?

It is almost certainly something you are doing wrong. But you are not
clear enough about what you are doing to know what that is.

What happens when you press q? What happens when you press wq? You need
to give more detail.

Aaargh, that’s horrible what I did. Will contact a doctor straight away, something’s wrong. I’ve been using vi for over 20 years now, and I’m still using vi an awful lot. It’s most certainly Henk’s remark, of not using “:” to go from escape mode to command mode, the sequence then, after editing would be-Esc : q, or Esc : wq

Well, the Esc is only needed when to get out of in INSERT mode and is a different beast.

When you want to stop vi and you are in INSERT mode (that is all the characters you type are added to the text in the screen), you do first Esc.

Then you are in “normal” (or has it another name) mode where you can travel through the tex with the arrows and al that.

When you then want to (write and) quit, tipy type :q or :wq

That was my first thought. I’m using vi on a FreeBSD server… well, maybe “using” is too strong of a word… maybe “surviving” is better :wink:

On 08.02.2012 05:16, soni shrikant wrote:
>
> using SUSE v11.4
>
> i am using VIM v7.3.62 but none of its commands are executing.
> like pressing ‘q’ should exit the vi editor, ‘wq’ writes and quit but
> nothing is happening.
>
> i have also updated& installed all the bug fixes but still the same.
>
> is this really a bug or am doing something wrong?
> any solution to this?
>
>
Did you ‘ESC :q’ ?
Just q will not do it.

Windows, supports nearly all software, hardware, and viruses.
Linux Counter: 548299 https://linuxcounter.net/

Hitting “Esc” will get you out of whatever command/mode you are currently in.

Then “:q” to quit or “:q!” to force quit and “:wq” to write out the file then quit

I like the word “surviving” I have used it in some occasions where I can no longer start x because of some misdeeds.:slight_smile:

For anyone else struggling or should I say “surviving”, check out this vi commands cheat sheet. You need to press Esc then type :q then press return.

HTH :slight_smile: