Skip to content

Instantly share code, notes, and snippets.

@Cside
Created November 13, 2012 14:16
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cside/4065970 to your computer and use it in GitHub Desktop.
Save Cside/4065970 to your computer and use it in GitHub Desktop.
~/.re.pl/repl.rc
#!perl
=pod
Original rc file is https://gist.github.com/3fb14d60757e29f8ef13.
ttakezawa++
=cut
use strict;
use warnings;
use Term::ANSIColor;
my @plugins = (
'ReadLineHistory', # history saved across sessions
'FancyPrompt', # provide an irb-like prompt
'OutputCache', # access previous results
'MultiLine::PPI', # allow multiple lines
'Completion',
'CompletionDriver::Keywords', # substr, while, etc
'CompletionDriver::LexEnv', # current environment
'CompletionDriver::Globals', # global variables
'CompletionDriver::INC', # loading new modules
'CompletionDriver::Methods', # class method completion
);
$_REPL->load_plugin($_) for @plugins;
# via http://github.com/doy/conf/blob/master/re.pl/repl.rc
$_REPL->fancy_prompt(sub {
my $self = shift;
"\ca" . color('blue') . "\cb" . $self->current_package
. "\ca" . color('green') . "\cb" . '(0)'
. "\ca" . color('reset') . "\cb" . '> '
} );
$_REPL->fancy_continuation_prompt(sub {
my $self = shift;
"\ca" . color('blue') . "\cb"
. $self->current_package
. "\ca" . color('yellow') . "\cb" . '(' . $self->line_depth . ')'
. "\ca" . color('reset') . "\cb" . '> ' . (' ' x ($self->line_depth * 2))
});
$Devel::REPL::Plugin::Packages::PKG_SAVE = 'main';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment