WeeChat dev news - Tag - bufferWeeChat development blog2024-01-22T17:53:19+01:00urn:md5:edd364dae4d94114a2ba146603903683DotclearAuto renumber of buffersurn:md5:41968b7d4e7dfa788c16f373224abd772013-12-11T19:49:00+01:002017-05-19T21:46:47+02:00Sébastien Helleucorebuffernumber <p>Auto renumber of buffers can now be disabled.</p>
<p>Two options have been added:</p>
<ul>
<li>weechat.look.buffer_auto_renumber</li>
<li>weechat.look.buffer_position</li>
</ul>
<p>A bar item has beed added as well:</p>
<ul>
<li>buffer_last_number</li>
</ul>
<p>When auto renumber is disabled, gaps between buffer numbers are allowed and the first buffer can have a number greater than 1.</p>
<p>Following options for command <code>/buffer</code> are affected when auto renumber is off:</p>
<ul>
<li><code>move</code>:
<ul>
<li>the current number will be left free for use, and the target number can be any number >= 1 (possibly higher than the current last buffer number)</li>
<li>the value can be "-" (which moves the buffer to number 1) or "+" (which moves the buffer to the end, ie last number + 1)</li>
</ul></li>
<li><code>swap</code>:
<ul>
<li>now the buffers are swapped in the list without being "moved"</li>
</ul></li>
<li><code>(+/-)N</code>:
<ul>
<li>it is now working with gaps in buffer numbers</li>
</ul></li>
<li><code>merge</code>:
<ul>
<li>it can now merge a group of merged buffers into another buffer (or buffers merged themselves)</li>
</ul></li>
</ul>So many ways to go to first buffer...urn:md5:f27b140f8ac183c79b010ad9b0a27b0e2011-11-01T20:39:00+01:002022-10-09T13:58:50+02:00Sébastien Helleucorebuffer <ol>
<li>key Alt+1</li>
<li>key Alt+j, then 0, then 1</li>
<li>key F5 <sup> *</sup></li>
<li>key F6 <sup> *</sup></li>
<li>key Ctrl+p <sup> *</sup></li>
<li>key Ctrl+n <sup> *</sup></li>
<li>key Alt+Left <sup> *</sup></li>
<li>key Alt+Right <sup> *</sup></li>
<li>key Alt+Up <sup> *</sup></li>
<li>key Alt+Down <sup> *</sup></li>
<li>key Alt+a (if buffer #1 is first in hotlist)</li>
<li>left mouse button with long gesture to the left (with mouse enabled)</li>
<li>command <code>/buffer 1</code></li>
<li>command <code>/buffer core.weechat</code> (if core buffer is #1)</li>
<li>command <code>/buffer close 2-99999</code> (<strong>joke!</strong> - this will destroy all buffers and keep only buffer(s) with number 1)</li>
<li>command <code>/buffer move 1</code> (<strong>joke!</strong> - current buffer will become #1)</li>
</ol>
<p>There are other ways with scripts, but it's cheating!</p>
<p><sup>*</sup> : press key many times until you reach buffer #1.</p>Change short name of buffersurn:md5:927cbc06a020c9ab9a7eccd62bb3d0ca2011-10-28T10:55:00+02:002019-01-16T13:41:31+01:00Sébastien Helleuscriptsbuffer <p>The short name of buffers can be changed with <code>/buffer set short_name <new_name></code> command. This might be useful for long channel names displayed in the buffers bar (buflist plugin with WeeChat ≥ 1.8 or script <a href="https://weechat.org/files/scripts/buffers.pl">buffers.pl</a> with an older version).</p>
<p>For example on channel #weechat:</p>
<pre>/buffer set short_name #wee</pre>
<p>New value is used immediately, but is not saved in config file. To make it persistent, you have to use script <a href="https://weechat.org/files/scripts/buffer_autoset.py">buffer_autoset.py</a>:</p>
<pre>/autosetbuffer add irc.freenode.#weechat short_name #wee</pre>
<p>Note1: it's not recommended to set short name of query buffers, because WeeChat will change name of buffer when nick changes.</p>
<p>Note2: you should use command <code>/buffer set</code> with precautions, it is not recommended to change other buffer properties if you're not sure about what you do. This could lead to weird behaviour or a crash.</p>Highlight with regex in specific buffersurn:md5:268d9763dba0ab35a995affff47516542011-06-15T20:00:00+02:002017-05-19T22:26:26+02:00Sébastien Helleucorebufferhighlightregex <p>A local variable "highlight_regex" has been added in buffers.</p>
<p>It is recommended to use script <a href="https://weechat.org/scripts/source/stable/buffer_autoset.py">buffer_autoset.py</a> to set it, so that it's saved and set at any time when buffer is created.</p>
<p>However, it's still possible to set it manually (for testing) with command: <code>/buffer set highlight_regex XXX</code>.</p>
<p>For example, to highlight all messages on server freenode, channel #test:</p>
<pre>/autosetbuffer add irc.freenode.#test highlight_regex .*</pre>Colored time for messagesurn:md5:fb0fd7a8355458f3d3839c302ab443092010-12-07T22:58:00+01:002019-11-04T22:02:51+01:00Sébastien Helleucorebuffertime <p>It is now possible to add color in time displayed for each line in formated buffers.</p>
<p>Option weechat.look.buffer<sub>time</sub>format now supports colors with format: "${xxx}" where "xxx" is a color name (lightblue, red, ...) or a number (for example: "214" for orange).</p>
<p>Note: <strong>updated in 0.4.2</strong>, the syntax is now: "${color:xxx}".</p>
<p>Screenshot of colored time, with french flag colors:</p>
<p><a href="https://blog.weechat.org/public/weechat_french_time.png"><img src="https://blog.weechat.org/public/.weechat_french_time_m.jpg" alt="French time" style="display:table; margin:0 auto;" title="French time, déc. 2010" /></a></p>Target buffer for IRC messagesurn:md5:0f6765efe6a4db5acaee93de3f45a6432010-01-01T14:31:00+01:002022-10-22T20:08:10+02:00Sébastien Helleuircbufferirc <p>New options have been added to choose target buffer for IRC messages.</p>
<p>More info and examples in documentation: <a href="https://weechat.org/doc/devel/user#irc_target_buffer" hreflang="en">https://weechat.org/doc/devel/user#irc_target_buffer</a></p>Merge of buffersurn:md5:a3d5d964daf3421c0b490cec82e61e312009-06-10T19:42:00+02:002022-10-09T13:55:42+02:00Sébastien Helleucorebuffer <p>It is now possible to merge buffers with command /buffer merge (or unmerge). IRC plugin uses that feature to merge server buffers, with the new option irc.look.server_buffer (merge_with_core, merge_without_core, independent).</p>
<p>When a buffer is merged to one or more other buffers, they will have same number, and chat area will display mixed lines (short name of buffer is displayed on each line, to know to which buffer line belongs). Bars still display content for current selected buffer.</p>
<p>New key Ctrl+x has been added to swtich current active buffer when many buffers are merged (old key Alt+s has been removed).</p>
<p>For devel users: it's not possible to upgrade from previous versions to this one, and you should do <code>/key missing</code> to add missing key.</p>