Skip to content

Instantly share code, notes, and snippets.

@diegok
Created March 14, 2016 18:24
Show Gist options
  • Save diegok/4e6ef2e5d2a3a735d8af to your computer and use it in GitHub Desktop.
Save diegok/4e6ef2e5d2a3a735d8af to your computer and use it in GitHub Desktop.
~/.re.pl/repl.rc
use feature ':5.10';
use lib './lib';
use Term::ANSIColor;
$_REPL->load_plugin($_) for qw(
History Colors
FancyPrompt Refresh
Interrupt OutputCache
DDC Nopaste
PPI
ReadLineHistory
MultiLine::PPI
Completion
CompletionDriver::Keywords
CompletionDriver::LexEnv
CompletionDriver::Methods
CompletionDriver::INC
CompletionDriver::Globals
CompletionDriver::Turtles
);
$_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))
});
#package main;
$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