1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00
Files
weechat/doc/en/usage.en.xml
T
2008-02-24 10:45:55 +01:00

948 lines
27 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!--
WeeChat documentation (english version)
Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org>
This manual is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<chapter id="chapUsage">
<title>Usage</title>
<para>
This chapter explains how to run WeeChat, the default key bindings
used, internal and IRC commands, setup file, and FIFO pipe use.
</para>
<section id="secRunningWeeChat">
<title>Running WeeChat</title>
<para>
Command line arguments:
<informaltable colsep="0" frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>Parameter</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>-a, --no-connect</literal></entry>
<entry>
Disable auto-connect to servers at startup
</entry>
</row>
<row>
<entry><literal>-c, --config</literal></entry>
<entry>
Display config help (list of options)
</entry>
</row>
<row>
<entry><literal>-d, --dir &lt;path&gt;</literal></entry>
<entry>
Set path as home for WeeChat (used for configuration files,
logs, user plugins and scripts). Default value is
"<literal>~/.weechat</literal>". Please note that directory
is created if not found by WeeChat.
</entry>
</row>
<row>
<entry><literal>-f, --key-functions</literal></entry>
<entry>
Display WeeChat internal functions for keys
</entry>
</row>
<row>
<entry><literal>-h, --help</literal></entry>
<entry>
Display help
</entry>
</row>
<row>
<entry><literal>-i, --irc-commands</literal></entry>
<entry>
Display IRC commands list
</entry>
</row>
<row>
<entry><literal>-k, --keys</literal></entry>
<entry>
Display WeeChat default keys
</entry>
</row>
<row>
<entry><literal>-l, --license</literal></entry>
<entry>
Display WeeChat license
</entry>
</row>
<row>
<entry><literal>-p, --no-plugin</literal></entry>
<entry>
Disable plugins auto-load
</entry>
</row>
<row>
<entry><literal>-v, --version</literal></entry>
<entry>
Display WeeChat version
</entry>
</row>
<row>
<entry><literal>-w, --weechat-commands</literal></entry>
<entry>
Display WeeChat commands list
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
<para>
It is also possible to give URL for one or many IRC servers, as
follow:
<screen>irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/channel][,channel[...]</screen>
Example to join #weechat and #toto on
"<literal>irc.freenode.net</literal>" server, default port (6667),
with "nono" nick:
<screen><prompt>$ </prompt><userinput>weechat-curses irc://nono@irc.freenode.net/#weechat,#toto</userinput></screen>
</para>
<para>
To start WeeChat, issue this command:
<itemizedlist>
<listitem>
<para>
for Curses GUI: <userinput>weechat-curses</userinput>
</para>
</listitem>
<listitem>
<para>
for Gtk GUI: <userinput>weechat-gtk</userinput>
</para>
</listitem>
<listitem>
<para>
for wxWidgets GUI: <userinput>weechat-wxwidgets</userinput>
</para>
</listitem>
<listitem>
<para>
for Qt GUI: <userinput>weechat-qt</userinput>
</para>
</listitem>
</itemizedlist>
</para>
<para>
When you run WeeChat for the first time, a default configuration
file is created, with default options.
The default configuration file is:
"<literal>~/.weechat/weechat.rc</literal>"
</para>
<para>
You can edit this file at your convenience to configure WeeChat
(ONLY if WeeChat is not running), or you can set parameters with
"<literal>/set</literal>" command in WeeChat
(see <xref linkend="secWeeChatCommands" />)
</para>
</section>
<section id="secKeyboardShortcuts">
<title>Key bindings</title>
<para>
<informaltable colsep="0" frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>Key</entry>
<entry>Action</entry>
</row>
</thead>
<tbody>
<row>
<entry>Left arrow / Ctrl + B</entry>
<entry>
Go to previous char in command line
</entry>
</row>
<row>
<entry>Right arrow / Ctrl + F</entry>
<entry>
Go to next char in command line
</entry>
</row>
<row>
<entry>Ctrl + left arrow</entry>
<entry>
Go to previous word in command line
</entry>
</row>
<row>
<entry>Ctrl + right arrow</entry>
<entry>
Go to next word in command line
</entry>
</row>
<row>
<entry>Home / Ctrl + A</entry>
<entry>
Go to the beginning of command line
</entry>
</row>
<row>
<entry>Ctrl + C then B</entry>
<entry>
Insert code for bold text.
</entry>
</row>
<row>
<entry>Ctrl + C then C</entry>
<entry>
Insert code for colored text.
</entry>
</row>
<row>
<entry>Ctrl + C then O</entry>
<entry>
Insert code for color reset.
</entry>
</row>
<row>
<entry>Ctrl + C then R</entry>
<entry>
Insert code for reverse color.
</entry>
</row>
<row>
<entry>Ctrl + C then U</entry>
<entry>
Insert code for underlined text.
</entry>
</row>
<row>
<entry>End / Ctrl + E</entry>
<entry>
Go to the end of command line
</entry>
</row>
<row>
<entry>Ctrl + K</entry>
<entry>
Delete from cursor until end of command line
</entry>
</row>
<row>
<entry>Ctrl + L</entry>
<entry>
Redraw whole window
</entry>
</row>
<row>
<entry>Ctrl + R</entry>
<entry>
Search for text in buffer history
(two times: search exact text)
</entry>
</row>
<row>
<entry>Ctrl + S then Ctrl + U</entry>
<entry>
Set unread marker on all buffers
</entry>
</row>
<row>
<entry>Ctrl + T</entry>
<entry>
Transpose chars
</entry>
</row>
<row>
<entry>Ctrl + U</entry>
<entry>
Delete from cursor until beginning of command line
</entry>
</row>
<row>
<entry>Ctrl + W</entry>
<entry>
Delete previous word of command line
</entry>
</row>
<row>
<entry>Ctrl + Y</entry>
<entry>
Paste clipboard content
</entry>
</row>
<row>
<entry>Backspace / Ctrl + H</entry>
<entry>
Delete previous char in command line
</entry>
</row>
<row>
<entry>Delete / Ctrl + D</entry>
<entry>
Delete next char in command line
</entry>
</row>
<row>
<entry>Tab / Shift + Tab</entry>
<entry>
Complete command or nick
(Tab again: find next completion)
</entry>
</row>
<row>
<entry>Any char</entry>
<entry>
Insert char at cursor position in command line
</entry>
</row>
<row>
<entry>Enter / Ctrl + J / Ctrl + M</entry>
<entry>
Execute command or send message
(in search mode: stop search)
</entry>
</row>
<row>
<entry>Up arrow / Down arrow</entry>
<entry>
Call again last commands/messages (in search mode: search
up/down)
</entry>
</row>
<row>
<entry>Ctrl + up arrow / Ctrl + down arrow</entry>
<entry>
Call again last commands/messages in global history
(common for all buffers)
</entry>
</row>
<row>
<entry>PageUp / PageDown</entry>
<entry>
Scroll up / down one page in buffer history
</entry>
</row>
<row>
<entry>Alt + PageUp / Alt + PageDown</entry>
<entry>
Scroll up / down a few lines in buffer history
</entry>
</row>
<row>
<entry>Alt + Home / Alt + End</entry>
<entry>
Scroll to top / bottom of buffer
</entry>
</row>
<row>
<entry>F5 / Alt + left arrow</entry>
<entry>
Switch to previous buffer
</entry>
</row>
<row>
<entry>F6 / Alt + right arrow</entry>
<entry>
Switch to next buffer
</entry>
</row>
<row>
<entry>F7</entry>
<entry>
Switch to previous window
</entry>
</row>
<row>
<entry>F8</entry>
<entry>
Switch to next window
</entry>
</row>
<row>
<entry>F9 / F10</entry>
<entry>
Scroll topic
</entry>
</row>
<row>
<entry>F11 / F12</entry>
<entry>
Scroll nicklist
</entry>
</row>
<row>
<entry>Alt + F11 / Alt + F12</entry>
<entry>
Go to the beginning / the end of nicklist
</entry>
</row>
<row>
<entry>Alt + A</entry>
<entry>
Switch to next buffer with activity
(with priority: highlight, message, other)
</entry>
</row>
<row>
<entry>Alt + B</entry>
<entry>
Go to previous word in command line
</entry>
</row>
<row>
<entry>Alt + D</entry>
<entry>
Delete next word in command line
</entry>
</row>
<row>
<entry>Alt + F</entry>
<entry>
Go to next word in command line
</entry>
</row>
<row>
<entry>Alt + H</entry>
<entry>
Clear hotlist
(activity notification on other buffers)
</entry>
</row>
<row>
<entry>Alt + I</entry>
<entry>
Remove last infobar message
</entry>
</row>
<row>
<entry>Alt + J then Alt + D</entry>
<entry>
Display DCC buffer
</entry>
</row>
<row>
<entry>Alt + J then Alt + L</entry>
<entry>
Switch to last buffer
</entry>
</row>
<row>
<entry>Alt + J then Alt + P</entry>
<entry>
Switch to buffer previously displayed
</entry>
</row>
<row>
<entry>Alt + J then Alt + R</entry>
<entry>
Switch to raw IRC data buffer
</entry>
</row>
<row>
<entry>Alt + J then Alt + S</entry>
<entry>
Switch to server buffer
</entry>
</row>
<row>
<entry>Alt + J then Alt + X</entry>
<entry>
Switch to first channel of next server
(or server buffer if no channel is opened)
</entry>
</row>
<row>
<entry>Alt + digit (0-9)</entry>
<entry>
Switch to buffer by number (0 = 10)
</entry>
</row>
<row>
<entry>Alt + J then number (01-99)</entry>
<entry>
Switch to buffer by number
</entry>
</row>
<row>
<entry>Alt + K</entry>
<entry>
Grab a key and insert its code in command line
</entry>
</row>
<row>
<entry>Alt + N</entry>
<entry>
Scroll to next highlight
</entry>
</row>
<row>
<entry>Alt + P</entry>
<entry>
Scroll to previous highlight
</entry>
</row>
<row>
<entry>Alt + R</entry>
<entry>
Delete entire command line
</entry>
</row>
<row>
<entry>Alt + S</entry>
<entry>
Switch servers on servers buffer
(if option "look_one_server_buffer" is enabled)
</entry>
</row>
<row>
<entry>Alt + U</entry>
<entry>
Scroll to first unread line in buffer
</entry>
</row>
<row>
<entry>Alt + W then Alt + arrow</entry>
<entry>
Switch to window with direction
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</section>
<section id="secCommandLine">
<title>Command line</title>
<para>
WeeChat command line (at the bottom of window) lets you send text on
channels and execute WeeChat or IRC commands (see
<xref linkend="secWeeChatIRCCommands" />).
</para>
<para>
Commands begin with "/" char, followed by name of command.
For example, to initiate a private chat with "<literal>toto</literal>":
<screen><userinput>/query toto</userinput></screen>
</para>
<para>
Text sent to a channel is any text that does not begin with "/" char.
For example, to send text "<literal>hello</literal>" on current
channel:
<screen><userinput>hello</userinput></screen>
</para>
<para>
However, it is possible to start with "/" char, by adding another.
For example, to send text "<literal>/query toto</literal>" on current
channel:
<screen><userinput>//query toto</userinput></screen>
</para>
<para>
If option for sending IRC colors ("<literal>irc_colors_send</literal>")
is enabled, you can use color codes and attributes, as follow (press
Ctrl-C then following letter, with optional value):
<informaltable colsep="0" frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>Code</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>^Cb</entry>
<entry>
bold text
</entry>
</row>
<row>
<entry>^Ccxx</entry>
<entry>
text color "<literal>xx</literal>"
(see colors table below)
</entry>
</row>
<row>
<entry>^Ccxx,yy</entry>
<entry>
text color "<literal>xx</literal>"
and background "<literal>yy</literal>"
(see colors table below)
</entry>
</row>
<row>
<entry>^Co</entry>
<entry>
disable color and attributes
</entry>
</row>
<row>
<entry>^Cr</entry>
<entry>
reverse video (revert text color with background)
</entry>
</row>
<row>
<entry>^Cu</entry>
<entry>
underlined text
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
Note: the same code (without number for ^Cc) may be used to stop the
attribute.
</para>
<para>
Color codes for ^Cc are:
<informaltable colsep="0" frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>Code</entry>
<entry>Color</entry>
</row>
</thead>
<tbody>
<row>
<entry>00</entry>
<entry>white</entry>
</row>
<row>
<entry>01</entry>
<entry>black</entry>
</row>
<row>
<entry>02</entry>
<entry>dark blue</entry>
</row>
<row>
<entry>03</entry>
<entry>dark green</entry>
</row>
<row>
<entry>04</entry>
<entry>light red</entry>
</row>
<row>
<entry>05</entry>
<entry>dark red</entry>
</row>
<row>
<entry>06</entry>
<entry>magenta</entry>
</row>
<row>
<entry>07</entry>
<entry>orange</entry>
</row>
<row>
<entry>08</entry>
<entry>yellow</entry>
</row>
<row>
<entry>09</entry>
<entry>light green</entry>
</row>
<row>
<entry>10</entry>
<entry>cyan</entry>
</row>
<row>
<entry>11</entry>
<entry>light cyan</entry>
</row>
<row>
<entry>12</entry>
<entry>light blue</entry>
</row>
<row>
<entry>13</entry>
<entry>light magenta</entry>
</row>
<row>
<entry>14</entry>
<entry>gray</entry>
</row>
<row>
<entry>15</entry>
<entry>light gray (white)</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
<para>
Example: display of "<literal>hello everybody!</literal>" with
"<literal>hello</literal>" in light blue bold, and
"<literal>everybody</literal>" in light red underlined:
<screen><userinput>^Cc12^Cbhello^Cb^Cc04^Cu everybody^Cu^Cc!</userinput></screen>
</para>
</section>
<section id="secWeeChatIRCCommands">
<title>WeeChat / IRC commands</title>
<para>
This chapter lists all WeeChat and IRC commands.
</para>
<section id="secWeeChatCommands">
<title>WeeChat commands</title>
<para>
&weechat_commands.xml;
</para>
</section>
<section id="secKeyFunctions">
<title>Key functions</title>
<para>
<informaltable colsep="0" frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>Function</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
&key_functions.xml;
</tbody>
</tgroup>
</informaltable>
</para>
</section>
<section id="secIRCCommands">
<title>IRC commands</title>
<para>
&irc_commands.xml;
</para>
</section>
</section>
<section id="secConfigurationFile">
<title>Configuration file</title>
<para>
List of options for config file:
<informaltable colsep="0" frame="none">
<tgroup cols="5">
<thead>
<row>
<entry>Option</entry>
<entry>Type</entry>
<entry>Values</entry>
<entry>Default</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
&config.xml;
</tbody>
</tgroup>
</informaltable>
</para>
<para>
Colors for Curses GUI are:
<informaltable colsep="0" frame="none">
<tgroup cols="2">
<thead>
<row>
<entry>Keyword</entry>
<entry>Color</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>default</literal></entry>
<entry>default color (transparent for background)</entry>
</row>
<row>
<entry><literal>black</literal></entry>
<entry>black</entry>
</row>
<row>
<entry><literal>red</literal></entry>
<entry>dark red</entry>
</row>
<row>
<entry><literal>lightred</literal></entry>
<entry>light red</entry>
</row>
<row>
<entry><literal>green</literal></entry>
<entry>dark green</entry>
</row>
<row>
<entry><literal>lightgreen</literal></entry>
<entry>light green</entry>
</row>
<row>
<entry><literal>brown</literal></entry>
<entry>brown</entry>
</row>
<row>
<entry><literal>yellow</literal></entry>
<entry>yellow</entry>
</row>
<row>
<entry><literal>blue</literal></entry>
<entry>dark blue</entry>
</row>
<row>
<entry><literal>lightblue</literal></entry>
<entry>light blue</entry>
</row>
<row>
<entry><literal>magenta</literal></entry>
<entry>dark magenta</entry>
</row>
<row>
<entry><literal>lightmagenta</literal></entry>
<entry>light magenta</entry>
</row>
<row>
<entry><literal>cyan</literal></entry>
<entry>dark cyan</entry>
</row>
<row>
<entry><literal>lightcyan</literal></entry>
<entry>light cyan</entry>
</row>
<row>
<entry><literal>white</literal></entry>
<entry>white</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</section>
<section id="secFIFOpipe">
<title>FIFO pipe</title>
<para>
You can remote control WeeChat, by sending commands or text to a
FIFO pipe (you have to enable option "irc_fifo_pipe", it is disabled
by default).
</para>
<para>
The FIFO pipe is located in "<literal>~/.weechat/</literal>" and is
called "weechat_fifo_xxxxx" (where xxxxx is the process ID (PID) of
running WeeChat). So if many WeeChat are running, you have many FIFO
pipes, one for each session.
</para>
<para>
The syntax for the FIFO pipe commands/text is:
<screen>server,channel *text or command here</screen>
where server and channel are optional, but if channel is here, server
should be too.
</para>
<para>
Some examples:
<itemizedlist>
<listitem>
<para>
nick change on freenode to "mynick|out" :
<screen><prompt>$ </prompt><userinput>echo 'freenode */nick mynick|out' &gt;~/.weechat/weechat_fifo_12345</userinput></screen>
</para>
</listitem>
<listitem>
<para>
display text on #weechat channel:
<screen><prompt>$ </prompt><userinput>echo 'freenode,#weechat *hello everybody!' >~/.weechat/weechat_fifo_12345</userinput></screen>
</para>
</listitem>
<listitem>
<para>
display text on current channel (buffer displayed by WeeChat):
<screen><prompt>$ </prompt><userinput>echo '*hello!' >~/.weechat/weechat_fifo_12345</userinput></screen>
<emphasis>Warning:</emphasis> this is dangerous and you should
not do that except if you know what you do!
</para>
</listitem>
<listitem>
<para>
send two commands to unload/reload Perl scripts (you have to
separate them with "\n"):
<screen><prompt>$ </prompt><userinput>echo -e "freenode */perl unload\nfreenode */perl autoload" >~/.weechat/weechat_fifo_12345</userinput></screen>
</para>
</listitem>
</itemizedlist>
</para>
<para>
You can write a script to send command to all running WeeChat at same
time, for example:
<screen>
#!/bin/sh
if [ $# -eq 1 ]; then
for fifo in ~/.weechat/weechat_fifo_*
do
echo -e "$1" >$fifo
done
fi
</screen>
If the script is called "auto_weechat_command", you can run it with:
<screen><prompt>$ </prompt><userinput>./auto_weechat_command "freenode,#weechat *hello"</userinput></screen>
</para>
</section>
</chapter>