summaryrefslogtreecommitdiff
path: root/doc/it/autogen/user/weechat_commands.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'doc/it/autogen/user/weechat_commands.adoc')
-rw-r--r--doc/it/autogen/user/weechat_commands.adoc38
1 files changed, 21 insertions, 17 deletions
diff --git a/doc/it/autogen/user/weechat_commands.adoc b/doc/it/autogen/user/weechat_commands.adoc
index f9a938620..c84a699af 100644
--- a/doc/it/autogen/user/weechat_commands.adoc
+++ b/doc/it/autogen/user/weechat_commands.adoc
@@ -285,13 +285,15 @@ Some variables are replaced in expression, using the format ${variable}, variabl
1. an evaluated sub-string (format: "eval:xxx")
2. a string with escaped chars (format: "esc:xxx" or "\xxx")
3. a string with chars to hide (format: "hide:char,string")
- 4. a color (format: "color:xxx")
- 5. an info (format: "info:name,arguments", arguments are optional)
- 6. current date/time (format: "date" or "date:format")
- 7. an environment variable (format: "env:XXX")
- 8. an option (format: "file.section.option")
- 9. a local variable in buffer
- 10. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
+ 4. a string with max chars (format: "cut:max,suffix,string")
+ 5. a color (format: "color:xxx")
+ 6. an info (format: "info:name,arguments", arguments are optional)
+ 7. current date/time (format: "date" or "date:format")
+ 8. an environment variable (format: "env:XXX")
+ 9. a ternary operator (format: "if:condition?value_if_true:value_if_false")
+ 10. an option (format: "file.section.option")
+ 11. a local variable in buffer
+ 12. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@@ -302,16 +304,18 @@ Format for hdata can be one of following:
For name of hdata and variables, please look at "Plugin API reference", function "weechat_hdata_get".
Examples (simple strings):
- /eval -n ${info:version} ==> 0.4.3
- /eval -n ${env:HOME} ==> /home/user
- /eval -n ${weechat.look.scroll_amount} ==> 3
- /eval -n ${window} ==> 0x2549aa0
- /eval -n ${window.buffer} ==> 0x2549320
- /eval -n ${window.buffer.full_name} ==> core.weechat
- /eval -n ${window.buffer.number} ==> 1
- /eval -n ${\t} ==> <tab>
- /eval -n ${hide:-,${relay.network.password}} ==> --------
- /eval -n ${date:%H:%M:%S} ==> 07:46:40
+ /eval -n ${info:version} ==> 0.4.3
+ /eval -n ${env:HOME} ==> /home/user
+ /eval -n ${weechat.look.scroll_amount} ==> 3
+ /eval -n ${window} ==> 0x2549aa0
+ /eval -n ${window.buffer} ==> 0x2549320
+ /eval -n ${window.buffer.full_name} ==> core.weechat
+ /eval -n ${window.buffer.number} ==> 1
+ /eval -n ${\t} ==> <tab>
+ /eval -n ${hide:-,${relay.network.password}} ==> --------
+ /eval -n ${cut:2,+,test} ==> te+
+ /eval -n ${date:%H:%M:%S} ==> 07:46:40
+ /eval -n ${if:${info:term_width}>80?big:small} ==> big
Examples (conditions):
/eval -n -c ${window.buffer.number} > 2 ==> 0