start_tab.pl
1 use strict;
2 use Irssi qw(signal_add_first signal_stop settings_get_int settings_add_int);
3 use vars qw($VERSION %IRSSI);
4
5 $VERSION = '0.6';
6 %IRSSI = (
7 authors => 'Mathieu Doidy',
8 contact => 'mdoidy at roulaize dot net',
9 name => 'start_tab',
10 description => 'replaces the <tab> at the beginning of a line by a configurable number of spaces',
11 license => 'GNU GPL v2',
12 url => 'http://irssi.roulaize.net',
13 changed => '10/10/2003'
14 );
15
16 sub sig_complete_word {
17 my $list = shift; shift;
18 return if (shift() || shift());
19 $_ = settings_get_int('start_tab_num_space');
20 push @$list, ' 'x$_;
21 signal_stop();
22 }
23
24 signal_add_first('complete word', \&sig_complete_word);
25 settings_add_int( $IRSSI{name}, 'start_tab_num_space', 4);