Skip to content

Instantly share code, notes, and snippets.

@rfdrake
Created September 10, 2015 00:14
Show Gist options
  • Save rfdrake/ffd320885e7602dec847 to your computer and use it in GitHub Desktop.
Save rfdrake/ffd320885e7602dec847 to your computer and use it in GitHub Desktop.
A nice default re.pl rc file
use feature 'say'; # to don't write \n all the time
use Data::Dumper;
use Term::ANSIColor;
# pretty print data structures
sub pp { print Data::Dumper->Dump([@_]) }
load_plugin qw(
FancyPrompt
ReadLineHistory Colors
Refresh
Interrupt OutputCache
PPI Nopaste
MultiLine::PPI
Completion
CompletionDriver::INC
CompletionDriver::LexEnv
CompletionDriver::Keywords
CompletionDriver::Methods
);
$_REPL->fancy_prompt(sub {
my $self = shift;
# \ca = chr(1) = Start of Heading
# \cb = chr(2) = Start of Text
"\ca" . color('cyan') . "\cb" . $self->current_package .':'.
"\ca" . color('magenta') . "\cb". $self->lines_read .
"\ca" . color('green') . "\cb" . '(0)' .
"\ca" . color('reset') . "\cb" . '> '
} );
$_REPL->fancy_continuation_prompt(sub {
my $self = shift;
"\ca" . color('cyan') . "\cb" . $self->current_package .':'.
"\ca" . color('magenta') . "\cb". $self->lines_read .
"\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