Re: Some text editing improvements that would make me forget Vim

2023-06-12 Thread Richard Kimberly Heck

On 6/12/23 00:55, Daniel wrote:

On 2023-06-11 23:28, R. H. van der Gaag wrote:
On 11 Jun 2023, at 18:57, Richard Kimberly Heck  
wrote:



On 6/11/23 10:15, R. H. van der Gaag wrote:

  * find the word under the cursor (i.e. show other occurrences of
    the same word, by highlighting them simultaneously)

There's a bug report about highlighting all matches. The 'find 
highlighted word' part should not be too bad. We would just need to 
extend word-find-* to use data from the clipboard (or to grab the 
current selection).


Or perhaps not the selection but simply the word the cursor is in (so 
a separate word-select command is not needed).


I agree that this is helpful (and quite common not only in vim). If I 
understood it correctly, the "use word under cursor" is a patch that 
is waiting for commit:


https://www.lyx.org/trac/ticket/10235


I see! I didn't see that one. I'll test it out. It might need to wait 
until after 2.4.0 is out.


Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Some text editing improvements that would make me forget Vim

2023-06-11 Thread Daniel

On 2023-06-11 23:28, R. H. van der Gaag wrote:

On 11 Jun 2023, at 18:57, Richard Kimberly Heck  wrote:


On 6/11/23 10:15, R. H. van der Gaag wrote:

[…] I would love to see the following text editing commands implemented:

  * select around a word (cursor is on a word; the command selects
the word)

Already possible: Just bind a key to word-select. (Double click on a 
word does this.)


Thanks for the pointer; I didn’t know this. By the way: double-clicking 
often only selects part of a word on my Mac.


I think this was a bug reported earlier. And I seem to remember that it 
has been fixed. But I am not fully sure since  cannot find it just now.



  * select around a paragraph


Same for paragraph-select. (Triple click does this.)

I found commands to select backward to the beginning of the paragraph 
and forwards to the end, but no command that selects the paragraph the 
cursor is in as a whole (the way word-select works with a word).


Triple-clicking selects a line, not a paragraph (or sentence) on my system.


What version of LyX are you using? Paragraph-select works only in 2.4 
development version yet:


https://www.lyx.org/trac/ticket/9175

  * find the word under the cursor (i.e. show other occurrences of
the same word, by highlighting them simultaneously)

There's a bug report about highlighting all matches. The 'find 
highlighted word' part should not be too bad. We would just need to 
extend word-find-* to use data from the clipboard (or to grab the 
current selection).


Or perhaps not the selection but simply the word the cursor is in (so a 
separate word-select command is not needed).


I agree that this is helpful (and quite common not only in vim). If I 
understood it correctly, the "use word under cursor" is a patch that is 
waiting for commit:


https://www.lyx.org/trac/ticket/10235

Daniel

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Some text editing improvements that would make me forget Vim

2023-06-11 Thread R. H. van der Gaag
On 11 Jun 2023, at 18:57, Richard Kimberly Heck  wrote:

> On 6/11/23 10:15, R. H. van der Gaag wrote:
>> […] I would love to see the following text editing commands implemented:
>> 
>> select around a word (cursor is on a word; the command selects the word)
> Already possible: Just bind a key to word-select. (Double click on a word 
> does this.)
> 
Thanks for the pointer; I didn’t know this. By the way: double-clicking often 
only selects part of a word on my Mac.
>> select around a paragraph
> Same for paragraph-select. (Triple click does this.)
> 
I found commands to select backward to the beginning of the paragraph and 
forwards to the end, but no command that selects the paragraph the cursor is in 
as a whole (the way word-select works with a word). 

Triple-clicking selects a line, not a paragraph (or sentence) on my system.
>> select around a sentence (a grammatical sentence, not a line)
>> jump/select to the beginning of this sentence 
>> jump/select to the end of this sentence
> Not trivial in a language-neutral way. (Some languages do not use punctuation 
> the way English, say, does.) How does vim handle this?
> 
“A sentence  is 
defined as  ending at a 
'. ', '! 
' or '? 
' followed by either the 
end of a line, or by a space or tab 
.” 
https://vimdoc.sourceforge.net/htmldoc/motion.html#sentence

However, the manual is inaccurate here: when I tested it, it also selected 
surrounding quotation marks. 

>> find the word under the cursor (i.e. show other occurrences of the same 
>> word, by highlighting them simultaneously) 
> There's a bug report about highlighting all matches. The 'find highlighted 
> word' part should not be too bad. We would just need to extend word-find-* to 
> use data from the clipboard (or to grab the current selection).
> 
Or perhaps not the selection but simply the word the cursor is in (so a 
separate word-select command is not needed).
>> jump to a particular word (hit a key combination, type two letters that are 
>> part of the word you want to jump to, labels (in the form of letters) appear 
>> in the text where the combination occurs, type the label you need, and the 
>> cursor will land there
> This is a lot more involved.
> 
I’m sure it is. But it’s also very, very useful…

RH

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: Some text editing improvements that would make me forget Vim

2023-06-11 Thread Richard Kimberly Heck

On 6/11/23 10:15, R. H. van der Gaag wrote:

[...]I would love to see the following text editing commands implemented:

  * select around a word (cursor is on a word; the command selects the
word)

Already possible: Just bind a key to word-select. (Double click on a 
word does this.)




  * select around a paragraph


Same for paragraph-select. (Triple click does this.)



  * select around a sentence (a grammatical sentence, not a line)
  * jump/select to the beginning of this sentence
  * jump/select to the end of this sentence

Not trivial in a language-neutral way. (Some languages do not use 
punctuation the way English, say, does.) How does vim handle this?




  * find the word under the cursor (i.e. show other occurrences of the
same word, by highlighting them simultaneously)

There's a bug report about highlighting all matches. The 'find 
highlighted word' part should not be too bad. We would just need to 
extend word-find-* to use data from the clipboard (or to grab the 
current selection).




  * jump to a particular word (hit a key combination, type two letters
that are part of the word you want to jump to, labels (in the form
of letters) appear in the text where the combination occurs, type
the label you need, and the cursor will land there


This is a lot more involved.

Riki

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Some text editing improvements that would make me forget Vim

2023-06-11 Thread R. H. van der Gaag
Dear developers,
I muttered something about this before, but that thread petered out somehow. I 
find myself greatly enjoying writing my dissertation in LyX, most of the time… 
except when I am confronted with the limitations of text manipulation in LyX, 
compared to what I could do in Vim. Specifically, I would love to see the 
following text editing commands implemented:

select around a word (cursor is on a word; the command selects the word)
select around a paragraph
select around a sentence (a grammatical sentence, not a line)
jump/select to the beginning of this sentence 
jump/select to the end of this sentence
find the word under the cursor (i.e. show other occurrences of the same word, 
by highlighting them simultaneously) 
jump to a particular word (hit a key combination, type two letters that are 
part of the word you want to jump to, labels (in the form of letters) appear in 
the text where the combination occurs, type the label you need, and the cursor 
will land there

These would make working in this already wonderful application even better. I 
now find myself sometimes considering writing LaTeX code in Vim instead… but I 
really don’t want to. So I am hoping that it’s technically feasible to 
implement these improvements, and that there are developers willing to take a 
look at it.

Best,
RH-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel