Binds: Difference between revisions
m typo |
|||
Line 24: | Line 24: | ||
You can nest multiple quoted strings in a single line by escaping each new set of quotes with backslashes. | You can nest multiple quoted strings in a single line by escaping each new set of quotes with backslashes. | ||
bind <span style="color:green">[key]</span> <span style="color:red">"</span>bind <span style="color:green">[key]</span> <span style="color:orange">\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span><span style="color:red">;</span> bind <span style="color:green">[key]</span> <span style="color:orange">\\\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span> <span style="color:orange">\\\</span><span style="color:red">"</span><span style="color:orange">\</span><span style="color:red">""</span> | bind <span style="color:green">[key]</span> <span style="color:red">"</span>bind <span style="color:green">[key]</span> <span style="color:orange">\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span><span style="color:red">;</span> bind <span style="color:green">[key]</span> <span style="color:orange">\\\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span> <span style="color:orange">\\\</span><span style="color:red">"</span><span style="color:orange">\</span><span style="color:red">""</span> | ||
As the quoted strings go deeper, you also need to escape the backslash. Since each new layer will again un-escape them, you need to double the amount of backslashes per layer. The | As the quoted strings go deeper, you also need to escape the backslash. Since each new layer will again un-escape them, you need to double the amount of backslashes per layer. The maximum amount of layers you can use is 5 before the console gives you an error. | ||
bind <span style="color:green">[key]</span> <span style="color:red"> | |||
"</span>bind <span style="color:green">[key]</span> <span style="color:orange"> | |||
\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span><span style="color:red">;</span> bind <span style="color:green">[key]</span><span style="color:orange"> | |||
\\\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span><span style="color:red">;</span> bind <span style="color:green">[key]</span> <span style="color:orange"> | |||
\\\\\\\</span><span style="color:red">"</span><span style="color:blue">[command/setting]</span> <span style="color:purple">[value]</span><span style="color:orange"> | |||
\\\\\\\</span><span style="color:red">"</span><span style="color:orange"> | |||
\\\</span><span style="color:red">"</span><span style="color:orange"> | |||
\</span><span style="color:red">" | |||
"</span> | |||
If this is confusing to look at, try making a new line for each escaped quote to get a more clear visual idea of what's happening. | |||
bind <span style="color:green">[key]</span> <span style="color:red"> | bind <span style="color:green">[key]</span> <span style="color:red"> |