vim-mode, cursor shape, vertical select

126 views
Skip to first unread message

gar

unread,
Jun 19, 2019, 11:35:25 AM6/19/19
to leo-editor
Hello there!

I have just started to learn Leo and trying to use it's vim mode. 

First what I miss of is different cursor shape for normal and insert modes.
I discovered 'vimmodeinsertborder*' settings but they seem do not work for me - I cannot observe any difference whether they set or not. 
But even they were working - it is not absolutely what I expect to meet. 
So my question is: is there any easy way to change cursor shape and color for normal/insert modes?

Second feature I miss alot is vertical select. Looks like Leo does not implement it at all. Am I right?

Thanks in advance!

Edward K. Ream

unread,
Jun 19, 2019, 11:39:43 AM6/19/19
to leo-editor
On Wed, Jun 19, 2019 at 10:35 AM gar <gar...@gmail.com> wrote:
Hello there!

I have just started to learn Leo and trying to use it's vim mode. 

First what I miss of is different cursor shape for normal and insert modes.
I discovered 'vimmodeinsertborder*' settings but they seem do not work for me - I cannot observe any difference whether they set or not. 
But even they were working - it is not absolutely what I expect to meet. 
So my question is: is there any easy way to change cursor shape and color for normal/insert modes?

Alas not.

Second feature I miss alot is vertical select. Looks like Leo does not implement it at all. Am I right?

Again, probably not.

You might be more happy with Leo's vim plugin.

Also, just this morning we have been discussing using Leo's bridge module in vim.  That's soon going to be part of Leo's documentation.

Edward

gar

unread,
Jun 19, 2019, 12:23:14 PM6/19/19
to leo-editor
Thanks for that fast answer.

By now I tried vim plugin. It's horribly unusable. The greatest disaster that vim-open-file doesnt force vim to jump to the line of code outline start's with. 
You just get vim with file open on the first line. Great for 1 thousand lined files :-)
vim-open-node opens some part of text w/o syntax highlight so you get some bunch of code w/o context and colored into some ordinary faded color.

Leo's vim bridge looks like a dirty magic for me now. Cannot actually imagine how to apply it. But I suspect that there'll be the same or similar problems seems almost noone uses vim mode within Leo.

But nevertheless  thanks for you great job! Leo is marvelous even without good vim mimicry :-).

среда, 19 июня 2019 г., 18:39:43 UTC+3 пользователь Edward K. Ream написал:

Edward K. Ream

unread,
Jun 19, 2019, 1:01:56 PM6/19/19
to leo-editor
On Wed, Jun 19, 2019 at 11:23 AM gar <gar...@gmail.com> wrote:
Thanks for that fast answer.

By now I tried vim plugin. It's horribly unusable. The greatest disaster that vim-open-file doesnt force vim to jump to the line of code outline start's with. 
You just get vim with file open on the first line. Great for 1 thousand lined files :-)

Perhaps you can improve it.

Edward

Edward K. Ream

unread,
Jun 21, 2019, 8:21:53 AM6/21/19
to leo-editor


On Wednesday, June 19, 2019 at 10:35:25 AM UTC-5, gar wrote:

I have just started to learn Leo and trying to use it's vim mode. 

First what I miss of is different cursor shape for normal and insert modes.

I have just created #1220 for this.

I discovered 'vimmodeinsertborder*' settings but they seem do not work for me - I cannot observe any difference whether they set or not. 

I have just created #1221 for this.

Edward

gar

unread,
Jun 21, 2019, 8:39:59 AM6/21/19
to leo-editor
Many thanks for that! These things are really blockers in using VIM mode for me.

Last night  I was thinking about how can Leo's vim mimicry can be improved and got a clue: neovim may help.
AFAIK it can work as a completely background server an interact with frontend program by HTTP or something like this.
Need to read more about it.

If one can inject vim core into leo keeping python as main scripting language... Leo would get great text editor for free.
There is at least one integration of Qt, Python and neovim on github already: https://github.com/equalsraf/neovim-qt

I am grieving that my tech background is too poor for that kind of improvement, so all I can do - is just give a clue for further meditations.

пятница, 21 июня 2019 г., 15:21:53 UTC+3 пользователь Edward K. Ream написал:

Edward K. Ream

unread,
Jun 21, 2019, 9:44:15 AM6/21/19
to leo-editor
On Fri, Jun 21, 2019 at 7:40 AM gar <gar...@gmail.com> wrote:

Last night  I was thinking about how can Leo's vim mimicry can be improved and got a clue: neovim may help.
AFAIK it can work as a completely background server an interact with frontend program by HTTP or something like this.
Need to read more about it.

Oh joy!  I have just upgraded #990 based on this information.  It's still listed as "Maybe" but I have assigned it to 6.1 for study.

Edward

Edward K. Ream

unread,
Jun 22, 2019, 4:13:54 AM6/22/19
to leo-editor
The vim-related elements in the defaults stylesheet in leoSettings.leo is affected by a known Qt bug.  Class selectors do not work on Qt 5(!).  And not only do they not work, they ruin all further css elements.  The Qt people do not seem to care about this mess nearly enough.

Because they are toxic, these class selectors are in the last node: zz Must be last.  This node contains:

/* Vim mode borders... */

QTextEdit#richTextEdit[vim_state~="vim_normal"] {
  border
: @vim-mode-normal-border;
}

QTextEdit#richTextEdit[vim_state~="vim_insert"] {
  border
: @vim-mode-insert-border;
}

QTextEdit#richTextEdit[vim_state~="vim_visual"] {
  border
: @vim-mode-visual-border;
}

A fix would ignore these css elements entirely, using a Leonine settings instead.  This would be quite confusing to existing users unless all existing stylesheets are updated with warnings about the change.

Still, this must be done.  I'll attempt a fix soon.

Edward

Edward K. Ream

unread,
Jun 22, 2019, 10:02:24 AM6/22/19
to leo-editor
On Friday, June 21, 2019 at 7:21:53 AM UTC-5, Edward K. Ream wrote:

>> 'vimmodeinsertborder*' ...do not work for me.

> I have just created #1221 for this.

The programming work is complete.  There are four new settings, with defaults as shown:

@string vim-normal-border = border: 3px solid white
@string vim-insert-border = border: 3px solid red
@string vim-visual-border = border: 3px solid yellow
@string vim-unfocused-border = border: 3px dashed white

Please add these settings to myLeoSettings.leo and/or your theme file:

I'll be doing the same for leoSettings.leo and Leo's standard theme files.

Edward

Edward K. Ream

unread,
Jun 22, 2019, 10:42:10 AM6/22/19
to leo-editor
On Saturday, June 22, 2019 at 9:02:24 AM UTC-5, Edward K. Ream wrote:

There are four new settings, with defaults as shown:

@string vim-normal-border = border: 3px solid white
@string vim-insert-border = border: 3px solid red
@string vim-visual-border = border: 3px solid yellow
@string vim-unfocused-border = border: 3px dashed white

For compatibility with ancient settings that may still be lying around, I've added "-mode" to the names of the settings. I had to make this change to avoid still more confusion.  Please use these settings:

@string vim-mode-normal-border = border: 3px solid white
@string vim-mode-insert-border = border: 3px solid red
@string vim-mode-visual-border = border: 3px solid yellow
@string vim-mode-unfocused-border = border: 3px dashed white

The last setting is, I think, new.

Edward

Edward K. Ream

unread,
Jun 22, 2019, 1:21:46 PM6/22/19
to leo-editor
On Saturday, June 22, 2019 at 9:42:10 AM UTC-5, Edward K. Ream wrote:

For compatibility with ancient settings that may still be lying around, I've added "-mode" to the names of the settings. I had to make this change to avoid still more confusion.  Please use these settings:

@string vim-mode-normal-border = border: 3px solid white
@string vim-mode-insert-border = border: 3px solid red
@string vim-mode-visual-border = border: 3px solid yellow
@string vim-mode-unfocused-border = border: 3px dashed white

One more thing.  Unlike style sheets, you can't use @-substitutions in settings.

For example, you have to use #268bd2 instead of @solarized-blue.

This should not be too odious, because you can document that @solarized-red = #268bd2 in the body pane of the setting.

Edward

gar

unread,
Jun 24, 2019, 3:39:40 AM6/24/19
to leo-editor
Tested that - works perfectly
Now vim mode is ready for everyday usage, problem with cursor shape became less critical.

Thank you very much!

суббота, 22 июня 2019 г., 20:21:46 UTC+3 пользователь Edward K. Ream написал:

gar

unread,
Jun 28, 2019, 3:05:45 AM6/28/19
to leo-editor
Edward, are there any plans to implement vertical (block) select feature for leo's editor component?
This is the only feature I miss a lot.

vitalije

unread,
Jun 28, 2019, 5:33:30 AM6/28/19
to leo-editor


On Friday, June 28, 2019 at 9:05:45 AM UTC+2, gar wrote:
Edward, are there any plans to implement vertical (block) select feature for leo's editor component?
This is the only feature I miss a lot.
You have several `rectangle-...` commands. The rectangle selection is not shown as such, but the effect of command is exactly what you want. Try to press `Alt-x` and then type in minibufer "rect" and then press `Tab`. You'll see a list of commands that starts with rectangle. 
`rectangle-clear` deletes text of rectangle, `rectangle-string` allows you to type some text that will replace content of currently selected rectangle.
Vitalije

gar

unread,
Jun 28, 2019, 7:35:34 AM6/28/19
to leo-e...@googlegroups.com
wow! i saw these commands in the leo's menu but failed to understand how the work.
I was swindled how selection was made - as usual, not as in other editors 
thank you for that advise!

пт, 28 июн. 2019 г. в 12:33, vitalije <vita...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/12da3d0d-b7ee-44cd-a899-abb282f0b4fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages