Created
September 10, 2015 00:14
-
-
Save rfdrake/ffd320885e7602dec847 to your computer and use it in GitHub Desktop.
A nice default re.pl rc file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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