Ctrl + L/R Arrow Keys... "distance" modification?
-
Using Ctrl+Left/Right Arrows, you can jump to the other side of the a word/item.
I work with brackets often, and in most places/software in windows, the function is consistent in how it behaves. For example…
[Text1][Text2] [Text3]
If I were to have my cursor before the first bracket, and hit Ctrl+RightArrow, it would snap to between the two brackets. In NP++ (and in Chrome, apparently), it wants to snap before every bracket and text-string. (except if there’s no space between the ][, it skips to the next text-string…)
It makes quick-selecting the block of text more effort-requiring than I’d like, and doesn’t match the… muscle memory developed in interacting with everything else. I deal with this often enough to wonder if there’s anything I can do to adjust this in NP++.I just want it to consider the brackets as part of the text-string, if it’s possible.
Weird, niche thing that I doubt there’s a “fix”/option for, but figured I’d ask anyway.
Appreciate the read and/or help. -
@Crim-Zind
I wonder if what you want is the “select all between matching braces”? It’s in the Search menu, default shortcut is Ctrl-Alt-B.As for shortcuts, they appear under the shortcut mapper under the Settings menu. However I couldn’t find your Ctrl-RightArrow either as a Notepad++ or Scintilla shortcut.
However it does move the caret forward in some manner so possibly there is another list of shortcuts which are “unchangeable” and hence hidden from the shortcut mapper view.Terry
PS updated info in next post.
-
@Terry-R said in Ctrl + L/R Arrow Keys... “distance” modification?:
However I couldn’t find your Ctrl-RightArrow either as a Notepad++ or Scintilla shortcut.
Actually I just didn’t look for the right terminology. Now I see Ctrl+Left and Ctrl+Right under Scintilla as SCI_WORDLEFT and SCI_WORDRIGHT. If correct then it’s based on Scintilla’s definition of “word”.
This isn’t something the Notepad++ developer has any control over. All the developer offers is the means to change the default shortcut to activate that movement (in this case), not the definition behind how the movement is calculated.
Terry
-
@Terry-R
Ctrl+Alt+B is a neat shortcut to know about, but isn’t quite what I’m looking for, sadly. I appreciate the response, though!I’m often working outside of NP++, managing media collections of one sort or another in other apps. I often have dozens of [TagJ][TagQ][TagA][Etc.] type-situations where I’m trying to clean up, rearrange, copy/paste to other things, etc. I use the Ctrl+Arrow to quickly navigate between them, and use Shift to select multiple ones to copy/cut/paste/del.
I often wind up wanting to move the text to a text editor just for easier visibility. NP++ is awesome, and tend to just have it open all the time now for various docs, and so I just wind up pasting it in there, but yeah, this particular functionality I wish I had a way to adjust. -
@Crim-Zind
I think you need to outline exactly what it is you need. often there are ways around the problem.For instance you could possibly record a macro which is the series of keystrokes necessary to achieve a result. Then you could assign a shortcut to that.
In your case you would probably want to reassign the Scintilla one first, so then you can use the familiar shortcut for your new macro.
Terry
PS I think you say you want all of the text between matching braces (and including the braces) but unsure of whether you mean once you are inside of the braces, or have a brace immediately ahead the caret. Any other info would also be helpful.
-
I’m sure a short script could do the job here, if the functionality desired could be fully defined. Not sure it already has been, but maybe…
-
Hello, @crim-zind, @terry-r, @alan-kilborn and All,
Not totally sure but why not change the default value for the
Word character list
as shown in the picture :-
Select the
Settings > Preferences...
option -
Choose the
Delimiter
tab -
In the
Word character list
section-
Choose the second option
As your character as part of word
-
In the field, add your two bracket characters
[
and]
-
You may include other delimiters as well :
(
and)
OR{
and}
, …
-
-
Close the
Preferences
panel
Once this setting done, with this kind of text :
[Text1] [Text2] bla blah [Text3]
-
The
Ctrl + Right
andCtrl + Left
actions go to the beginnning of the next/previousword
char ( including the bracket characters ! ) -
The
Shift + Ctrl + Right
action selects the the next complete word, including bracket characters -
The
Shift + Ctrl + Left
action selects the the previous complete word, including bracket characters
Of course, if you consider this text, without any
space
character between[text1]
and[Text2]
and betweenblah
and[Text3]
:[Text1][Text2] bla blah[Text3]
The strings
[Text1][Text2]
andblah[Text3]
are considered as a single word, even if you double-click on these strings. Indeed all chars inside, are, from now on,word
characters !Best Regards,
guy038
-
-
I tried the “word character list” thing before you posted about it. I found that adding
[]
to it still doesn’t make N++ work like other windows applications in regards to Ctrl+left/right, so I don’t think that will satisfy the OP.