Sublime Forum

Ignoring (skipping maybe) next occurrence when using Ctrl + D

#1

Hi fellow forum members,

I just have started using Sublime Text 3 as a newbie user, and approached here to ask a question regarding “Next Occurrence Selection” (Ctrl + D).

Assume that I have the following codes.

local AB = _G["ActionButton" .. i .. tempTable[i]];
local MBBLB = _G["MultiBarBottomLeftButton" .. i .. tempTable[i]];
local MBBRB = _G["MultiBarBottomRightButton" .. i .. tempTable[i]];
local MBLB = _G["MultiBarLeftButton" .. i .. tempTable[i]];
local MBRB = _G["MultiBarRightButton" .. i .. tempTable[i]];

When I select “i” between first “… …” on the first line and press Ctrl + D, it would also select an “i” in “tempTable[i]” and an “i” in “MultiBarBottomLeftButton” as well while I would like to make it to select an “i” between “… …” only.

Is there any possible ways to select a particular “i” or ignore the next selection?

(I could think of a cheaty way to select “… i …” then rewrite this, but I don’t think that is an efficient way to do so)

0 Likes

#2

For this particular case you select “… i …” then press ATL+F3.

And the original question, CTRL+D to select next, CTRL+K,CTRL+D to ignore what you just selected and continue select next

1 Like

#3

So, Alt + F3 to select all the occurrences, and Ctrl + D & Ctrl + K to ignore and continue.

Thank you so much tito :smiley: !!

0 Likes

#4

Another option is to create a multi line selection (either with the mouse via middle click or shift+rightclick, or by selecting all lines and turning them into line selections with ctrl+shift+l and then pressing the end key, or by clicking one line and expanding the caret with ctrl+alt+up/down) and just direct to the location in the line, either from the beginning or the end of the line using word-wise movements.

0 Likes

#5

If you don’t make selection before pressing Ctrl+D then Sublime will do ‘whole word’ match. That means it would still select ‘i’ within ‘[i]’ but not within the words.
There is a caveat though, if you skip selection using Ctrl+K then Sublime will forget about making ‘whole word’ matches and start matching any ‘i’. Might be a bug, not sure.

1 Like

#6

that was it!

thank you rchl!!!

0 Likes

#7

@jps Yes, please add it to your list of issues to fix:

0 Likes

#8
0 Likes