On 29.12.2020 02:10, Spiros Bousbouras wrote:
> I don't use tab completions so that's not the issue I have with the Korn
> command line editing (CLE). I use vi(m) mode too but the issues I have with
> Korn are the following :
>
> 1. If you are at the prompt and you press <UP arrow> to go to the latest
> item in history you are in normal mode at the beginning of the line. With
> Bash you are in insert mode at the end of the line. Based on some common
> patterns of CLE of mine , I prefer the BASH behaviour.
Interesting. This exactly is what drives me mad in bash. The patterns
I usually apply start with the command. Or with the options which are
also closer to the command than to the arguments. (But of course, if
I'm moving on the line I'm also quickly at the point where I want to
be, using W, w, f, $, etc., and with multi-line commands using v.)
I also do a lot word-wise where I want to be at the beginning of the
words (or line). At the end of the line I typically only append (but
that can be done from anywhere in the line by typing A ), and getting
to the end of any word I use E or e. The other purpose, deleting from
the end backwards I consider too cumbersome (especially if many args
are involved); a simple C or d$ or dW or d3W is much faster and less
error prone IME. (It also supports my thinking "from left to right".)
In Bash (using vi mode) I have permanently the feeling that operations
are much more clumsy and start making operations character-wise instead
of item-wise.
> 2. With Korn if you are in insert mode and you press <LEFT (or RIGHT) arrow>
> it takes you to normal mode. With Bash you stay in insert mode.
For me it's similar to using vim; normally I am in command mode, and
I do almost everything (but inserts of texts) in this mode. In shell
it's exactly the same; I prefer doing most stuff in command (normal)
mode, so that's exactly what I want from Kornshell.
The difference seems to be that I rarely use [character-wise] cursor
movement and [character-wise] deletes/backspace. I usually move in
larger quantities than characters (word-wise or move-to-target), and
erasures or changes are also done on larger quantities (words, parts
of words, to end (or start) of line, etc.; I use the vi commands as
they are designed to be efficiently used.
> 3. With Korn , if you are in insert mode and press <DELETE> you cannot delete
> to the left of the point in the command line where you entered insert mode ,
> with Bash you can.
True. I suppose it depends whether one wants only newly inserted text
cleared or not. Personally that never bothered me because I am editing
most things in command mode (it's more powerful) and want just the new
parts entered be corrected on typos. In case I want to correct parts of
the old text and enter new text I start at the place where the edits
should be done and then all new text is subject to possible corrections.
> I note that Korn's behaviour is the traditional vi one
> but I prefer the Bash behaviour. In vim itself , you can change the
> behaviour based on the value of the backspace option.
In vim there's even a mode (forgot its name) that's oriented on simple
cursor oriented editing practices (which can be found in primitive GUI
editors - some may call it "user-friendly"). I consider it a hindrance
to efficient editing, though.
> I actually had a (not thorough) look in the Korn man page to see if there is
> some setting which allows you to change these things and I couldn't find one.
I think that it's not possible to change it the way you like. But since
it works for me I also haven't examined the possibilities or variants.
Janis