Created
November 13, 2012 14:16
-
-
Save Cside/4065970 to your computer and use it in GitHub Desktop.
~/.re.pl/repl.rc
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
#!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