summaryrefslogtreecommitdiff
path: root/src/core/wee-command.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2022-05-26 23:11:44 +0200
committerSébastien Helleu <flashcode@flashtux.org>2022-05-27 22:16:55 +0200
commit5ef4731c621c1fb1ed933ad4f83837c00cea84a8 (patch)
tree178bfde59c4ee86850c81d75a1ebe5eb429a4b0b /src/core/wee-command.c
parent007958e82c272a63255f4389155bd4dd58c461c3 (diff)
downloadweechat-5ef4731c621c1fb1ed933ad4f83837c00cea84a8.zip
core: add examples in /help item (issue #808)
Diffstat (limited to 'src/core/wee-command.c')
-rw-r--r--src/core/wee-command.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 4c48fe472..79f912d9e 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -8063,10 +8063,36 @@ command_init ()
" -all: delete all custom bar items\n"
"\n"
"Examples:\n"
- " /item add terminfo \"${buffer.number} == 1\" "
+ " add item with terminal size, displayed only in buffers with "
+ "number = 1:\n"
+ " /item add terminfo \"${buffer.number} == 1\" "
"\"term:${info:term_width}x${info:term_height}\"\n"
- " /item add bufinfo \"\" \"${buffer.number}:${buffer.name}"
- "${if:${buffer.zoomed}?(Z)}\""),
+ " add item with buffer info:\n"
+ " /item add bufinfo \"\" \"${buffer.number}:${buffer.name}"
+ "${if:${buffer.zoomed}?(Z)}\"\n"
+ " add item with date/time using format \"Dec 25, 12:34 +0100\", "
+ "refreshed every minute:\n"
+ " /item add datetime \"\" \"${date:%b %d, %H:%M %z}\"\n"
+ " /trigger add datetime_refresh timer \"60000;60\" \"\" \"\" "
+ "\"/item refresh datetime\"\n"
+ " add item with number of lines in buffer (displayed/total), "
+ "refreshed each time a new line is displayed or if filtered lines "
+ "have changed:\n"
+ " /item add lines_count \"\" "
+ "\"${calc:${buffer.lines.lines_count}-${buffer.lines.lines_hidden}}/"
+ "${buffer.lines.lines_count} lines\"\n"
+ " /trigger add lines_count_refresh_print print \"\" \"\" \"\" "
+ "\"/item refresh lines_count\"\n"
+ " /trigger add lines_count_refresh_signal signal \"window_switch;"
+ "buffer_switch;buffer_lines_hidden;filters_*\" \"\" \"\" "
+ "\"/item refresh lines_count\"\n"
+ " force refresh of item \"lines_count\":\n"
+ " /item refresh lines_count\n"
+ " recreate item \"lines_count\" with different conditions or "
+ "content:\n"
+ " /item recreate lines_count\n"
+ " delete item \"lines_count\":\n"
+ " /item del lines_count"),
"list"
" || add %(custom_bar_items_names)"
" || addreplace %(custom_bar_items_names) %(custom_bar_item_content)"