sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

when using vim mode and you focus certain editors, it should default to insert mode to avoid confusion #5405

Open williamstein opened 3 years ago

williamstein commented 3 years ago

For example, the course grade input boxes use vim mode. When you click it's hard to know what is going on, since you don't even realize vim is relevant. And clearly you want to type rather than edit in this case. So for some editors (e.g., embedded markdown editor), we need to use insert mode by default.

novoselt commented 7 months ago

How difficult it is to fix it? Related - how many people know that it is possible to use vim bindings and how many people actually do it?.. Presumably it can be pulled from projects settings?

williamstein commented 7 months ago

how many people know that it is possible to use vim bindings and how many people actually do it?..

Good question. Of 143K active users in the last year, exactly 347 have non-default editor bindings (about a quarter of a percent). Of these, 140 are vim, 136 are emacs, and 71 are sublime. I personally use sublime, since it has great support for multiple cursors and many other things.

smc=# select count(*),editor_settings#>'{bindings}' from accounts where last_active >= now() - interval '1 year' group by editor_settings#>'{bindings}' ;
 count  |  ?column?  
--------+------------
      2 | "default"
    136 | "emacs"
  83439 | "standard"
     71 | "sublime"
    140 | "vim"
 143244 | 

smc=# select count(*),editor_settings#>'{bindings}' from accounts where last_active >= now() - interval '1 month' group by editor_settings#>'{bindings}' ;
 count |  ?column?  
-------+------------
 19674 | 
    28 | "emacs"
 18230 | "standard"
    18 | "sublime"
    41 | "vim"
     1 | "default"

Also, during the last month, about 87 accounts used non-default bindings, with mostly vim.

Conclusion: it's a luxury to worry about or support these edge things. I supported vim mainly for Hal Snyder who used to work on cocalc, and support sublime for myself.

So keep this open but very low priority.

williamstein commented 1 month ago

the course input is going to soon not use codemirror, making this less relevant (though a user could still use codemirror anyways): https://github.com/sagemathinc/cocalc/issues/5772