-
Notifications
You must be signed in to change notification settings - Fork 12
Query
t9md edited this page Mar 11, 2017
·
7 revisions
- Overview
- AND: chain word separated by
white-space
- OR: chain word separated by
|
. - Case sensitivity
- Wildcard by
*
- Negate by
!
starting or ending( optional ) query - Word-boundary by
>
and<
- Used to filter items on
narrow-editor
. - You can input query on first line of
narrow-editor
. - Basically query is matched as-is
- No regular expression support currently.
- Meta character for regular expression is auto-excaped.
- Can chain multiple query separating by
whilte-space
.- e.g.
foo bar
means, select items matchesfoo
andbar
.
- e.g.
- See also Query expressiveness.
- General rule:
white-space
is treated asAND
,|
is treated asOR
, - Exception: First query on
narrow:scan
is NOT evaluated as query as described in this page.- In
narrow:scan
, when you inputaaa bbb ccc
in query area.-
aaa
is searched byeditor.scan
as literally, out-of-scope of query expression. -
bbb ccc
is treated as query
-
- In
- Query:
aaa bbb ccc
means, "matches item which includeaaa
ANDbbb
ANDccc
"(no order matter).
- Query:
aaa|bbb
matches items includeaaa
ORbbb
. - Query:
a|b|c d
means, matches items ((a
ORb
ORc
) ANDd
).- General rule:
|
is treated asOR
, white-space is always treated asAND
.
- General rule:
- Limitation: You can NOT use
!
( negate ) expression in each segment.-
!a|b
is evaluated as!(a|b)
, means "matches items include neithera
norb
." -
!a|!b
is evaluated as!(a|!b)
,!
in!b
is not evaluated as negate( which is not what you expect ).
-
- Exception: When query starts or ends with
|
char,|
is NOT evaluated asOR
.- e.g.
|
,||
,|a
,a|
,|a|b
,a|b|
,|a|b|
, all searched as-is(literally),|
is not evaluated asOR
.
- e.g.
- Query case sensitivity is configurable with config
caseSensitivityForNarrowQuery
.- Can override global setting on each provider if you want.
-
smartcase
is determined by each query.
-
*
is treated as wildcard, internally converted to.*
regular expression.- To search
*
itself, use*
solely separate it by space. - Or use double
**
. ( e.g. To match to string*hello
use**hello
as query).
- To search
-
!
is treated as negate,!foo
means 'not matchingfoo
'.- If config
negateNarrowQueryByEndingExclamation
set totrue
, you can also usefoo!
.
- If config
- Query case sensitivity is configurable with config
caseSensitivityForNarrowQuery
.- Can override global setting on each provider if you want.
- Prepend
>
to match word-boundary(\b
) at beginning of query - Append
<
to match word-boundary(\b
) at end of query -
\b
boundary is NOT appended when\b
is useless.(e.g.\b=
match nothing) - Regardless of uselessness or not, beginning
>
and ending<
are initenally removed from query. - Translation example
-
>word<
to\bword\b
-
>word
to\bword
-
word<
toword\b
-
>=
to=
( because\b
is useless ) -
=<
to=
( because\b
is useless ) -
>>=
to>=
( because\b
is useless ) -
=<<
to=<
( because\b
is useless )
-