Copying original vi behaviour

when i started using an open source variant of vi the decision towards vim (against nvi or elvis) was the bahaviour of the vi clone. it should follow the original as near as possible. is this a goal of neovim too?

i found that the shift operation behaves differently. the original shifted the cursor as well while in neovim the cursor stays where it was (or the whitespace for shifting is either inserted left or right of the cursor).

using the editor quick & without watching needs a deterministic behaviour. i would say it’s important not to change exactly these behaviours. what is the neovim philosophy here?

No, that is very much not a goal, and that is even explicitly stated in the Project (Non-)Goals. If you want to use something that behaves like vi, use vi. (Not even Vim matches vi behavior by default, and we don’t mind deviating from Vim (as long as plugins still work).)

1 Like

But the web page states “Fully compatible with Vim’s editing model”, not sure whats meant with model here but my interpretation is that such glitches like cursor position after operation should be avoided.

If you really type fast without looking at the editor all time it is essential that the editors behave exactly the same. Not all machines use nvim so if you do ops you often have different flavours of vi, that’s why i’m asking.

It means Vim’s (not vi's!) basic modal editing. All development involves trade-offs; Neovim has firmly and publicly decided not to make these in favor of vi compatibility. If this is important to you (which is perfectly reasonable), Neovim is not the editor for you.

I wonder why the atmosphere here is “not the editor for you”. this is a bit sad and it doesnt feel good.

my question was more other way around: is the change i noticed out of a reason or just an random incident? maybe its even just a setting with a different default?

I’m sorry that you feel my phrasing was dismissive; I was just trying to be very explicit since expectation management is very important. Your literal question was “is matching vi behavior a goal of Neovim?”, to which the official answer is an emphatic “No!”. You then doubled down with “but isn’t that important?”, to which I replied “not to Neovim, we have other priorities – if that is your priority (which is fine!), your time is probably better spent finding an editor that matches your priorities rather than trying to force Neovim to behave in the way you want”.

Is the change i noticed out of a reason or just an random incident? maybe its even just a setting with a different default?

That is not the same question, and would have gotten a different answer :wink:

Unfortunately, the answer is “Vim already behaves differently, so you would have to ask Bram. I am not aware of any option controlling this.” (But maybe someone else is?)

the initial question was put to know how important that topic is for neovim.

i came to neovim out of a reason. if i ask for the cursor position after an operation you will notice how happy i am with the current state of neovim. i read alot of the fine docs about the project and why that exists.

that may well be but not in this regard. so neovim changed that. why?

and finally: maybe it’s to be discussed to change that back?

Agreed, let’s focus on the cursor position.

But Vim definitely behaves differently in this regard than vi (as you describe it; I have no way of testing, but I believe you): the cursor does not move with the shifted line.

Maybe it would help if you gave a minimal example (with vim --clean – please note the exact version – and nvim --clean), describing exactly what you expect to happen?

I’m assuming that you’re referring to :h shift-left-right, if so, then yes, in vim the cursor does (by default) move to the start of the shifted line, which effectively makes it move with the shifted line.

The behaviour here is dependent on 'startofline', which is one of the defaults that have been changed in neovim, see: https://github.com/neovim/neovim/pull/11135.

1 Like

Let the public decide: [Poll] Should 'startofline' option be on or off by default?

ok, if that option is it i’m fine. thank you! :slight_smile: