2017-07-29 0:00 GMT+03:00 Bram Moolenaar <[email protected]>:
>
> Nikolay Pavlov wrote:
>
>> `<C-w>` used as a prefix is extremely inconvenient and `<C-w>.` is
>> inconsistent with all software with terminal emulator (i.e. screen and
>> tmux) I know which use `<C-{smth}>{smth}` by default. This thing is
>> even more weird given planned “typing 'termkey' twice sends 'termkey'
>> to the job”.
>
> I find it very convenient to be able to CTRL-W CTRL-W through all the
> Vim windows, without looking that type of window I'm currently in.

All the Vim windows on one tab. Now try to do the same with traversing
tabs with `gt`.

Also I mentioned `<C-{smth}>{smth}`, *not* `<C-{smth}><C-{smth}>`.
This would take away `<C-w>w` and not `<C-w><C-w>`. Obviously
impossible to use generally for 'termkey' unless you plan to allow
only control characters there.

>
>> One of the common use-cases for Neovim terminal feature is replacing
>> screen and tmux with Neovim. Now imagine that you are running
>> Vim/shell/any other REPL inside a Vim and want to edit some text. The
>> `<C-w>` shortcut in this case may be used to correct the last word and
>> is rather common in my experience and you take it away by default.
>
> Running Vim in a terminal window is weird and should not be considered a
> normal use case.  It will be useful for running tests though, but then
> setting 'termkey' will be easy.

Why? Ability to replace terminal multiplexer with Neovim is rather
common use-case, people find it convenient to not have to know two
different configuration languages.

And you missed “shell/any other REPL” part. Since `:term` without
arguments runs the shell I suppose this *is* a normal use-case and
`<C-w>` is also useful here.

>
>> This is the second reason why “prefix” key is `<C-\>`. First is
>> consistency: `<C-\><C-n>` is used to exit to a normal mode from any
>> other mode in existence, except for getchar() (or one of the internal
>> functions like vgetc())-based pseudo-modes, or if a plugin had it
>> deliberately mapped.
>>
>> Also why there is *no* terminal mode? I am quite surprised that I
>> can’t do `<C-c><C-c><C-c><Esc><Esc><Esc><C-\><C-n>:` and get to a
>> command prompt: none of the ways to exit to normal mode work, but with
>> `set showmode` bottom line *still* looks like if I am in normal mode
>> while I obviously is not. Also no idea how user will copy text from
>> the terminal without normal mode (using term_scrape() looks like an
>> overkill and is obviously harder to use then
>> `<C-\><C-n>{motion}y{motion}`) or view scrollback.
>
> Scrolling back while the job is still running is not implemented yet.
> Should be coming soon.
>
> All keys typed must normally go to the running job, including CTRL-C and
> Esc.  I plan to add mappings for the terminal window later.
>
> With the recent changes you can use a terminal window like a normal
> window once the job has exited.  Very useful to look at the output of a
> command.

Yes, but in Neovim you can use it like a normal window while job is running.

>
> Normal mode commands in a terminal window while the job is still running
> will interfere with the running job.  E.g. there would be a cursor
> position for the job and one for Normal mode.  Not sure how that would
> work.

One cursor position is only visible in terminal mode, another only in
normal mode. I find it most intuitive to sync Vim (Normal-mode) cursor
with terminal cursor when in terminal mode, make terminal cursor
invisible and not affecting Vim cursor when not in terminal mode.
Neovim does something like this, but cursor for some reason jumps back
a bunch of cells (not equal to 1).

Also to not interfere with the running job it is enough to disallow
modifying the terminal buffer. It is better question how to not make
active terminal job interfere with non-terminal-mode user actions:
e.g. in Neovim a job which quickly spams data may change contents
inside a user selection by overflowing scrollback.

>
> --
> Facepalm statement #7: "Last week I almost got pregnant!"
>
>  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
> ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\  an exciting new programming language -- http://www.Zimbu.org        ///
>  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui