Reorganized / added vim folding markers

This commit is contained in:
Emmanuel BENOîT 2020-10-21 09:45:17 +02:00
parent d408760e3a
commit e501848b14

58
spp.pl
View file

@ -9,6 +9,8 @@ use open ':std', ':encoding(UTF-8)';
use POSIX qw(strftime); use POSIX qw(strftime);
# DEFAULT CONFIGURATION ====================================================={{{
our %CONFIG = ( our %CONFIG = (
# Allow overrides from environment # Allow overrides from environment
allow_env_overrides => 0 , allow_env_overrides => 0 ,
@ -106,9 +108,8 @@ our %CONFIG = (
git_show_stash => 1 , git_show_stash => 1 ,
); );
# }}}
#=============================================================================== # THEMES ===================================================================={{{
# THEMES
sub thref { bless {(@_==2)?(t=>$_[0],r=>$_[1]):(r=>$_[0])}, 'ThemeRef'; } sub thref { bless {(@_==2)?(t=>$_[0],r=>$_[1]):(r=>$_[0])}, 'ThemeRef'; }
@ -395,12 +396,12 @@ sub init_themes
return %t; return %t;
} }
our %THEMES = init_themes; our %THEMES;
#=============================================================================== # }}}
# MAIN PROGRAM # MAIN PROGRAM =============================================================={{{
chop( our $COLUMNS = `tput cols` ); our $COLUMNS;
our %TCCACHE = (); our %TCCACHE = ();
our %TLEN = (); our %TLEN = ();
our %SCACHE = (); our %SCACHE = ();
@ -739,8 +740,10 @@ sub get_config_overrides
} }
} }
##### sub main
{
%THEMES = init_themes;
chop( $COLUMNS = `tput cols` );
get_config_overrides if $CONFIG{allow_env_overrides}; get_config_overrides if $CONFIG{allow_env_overrides};
%TLEN = compute_trans_lengths; %TLEN = compute_trans_lengths;
my $pg = gen_term_title; my $pg = gen_term_title;
@ -749,13 +752,14 @@ my ( $ill , $ilt ) = gen_input_line;
$ps1 .= $ilt; $ps1 .= $ilt;
my $ps2 = $pg . gen_ps2( $ill ); my $ps2 = $pg . gen_ps2( $ill );
print "export PS1=\"$ps1\" PS2=\"$ps2\"\n"; print "export PS1=\"$ps1\" PS2=\"$ps2\"\n";
}
main;
#=============================================================================== # }}}
# SECTION RENDERERS # SECTION RENDERERS ========================================================={{{
#------------------------------------------------------------------------------- # Date/time -----------------------------------------------------------------{{{
# DATE/TIME
sub render_datetime sub render_datetime
{ {
@ -773,8 +777,8 @@ sub render_datetime
return { bg => themed 'dt_bg' , content => [@out] }; return { bg => themed 'dt_bg' , content => [@out] };
} }
#------------------------------------------------------------------------------- #}}}
# Current working directory # Current working directory -------------------------------------------------{{{
sub render_cwd sub render_cwd
{ {
@ -799,8 +803,8 @@ sub render_cwd
}; };
} }
#------------------------------------------------------------------------------- # }}}
# USER/HOST # User/Host -----------------------------------------------------------------{{{
sub render_userhost sub render_userhost
{ {
@ -842,8 +846,8 @@ sub render_userhost
}; };
} }
#------------------------------------------------------------------------------- # }}}
# PREVIOUS COMMAND STATE # Previous command state ----------------------------------------------------{{{
sub render_prevcmd sub render_prevcmd
{ {
@ -879,8 +883,8 @@ sub render_prevcmd
}; };
} }
#------------------------------------------------------------------------------- # }}}
# LOAD AVERAGE # Load average --------------------------------------------------------------{{{
sub render_load sub render_load
{ {
@ -918,8 +922,8 @@ sub render_load
}; };
} }
#------------------------------------------------------------------------------- # }}}
# GIT REPOSITORY INFORMATION # Git repository information ------------------------------------------------{{{
sub _render_git_branch sub _render_git_branch
{ {
@ -1074,8 +1078,8 @@ sub render_git
return @out; return @out;
} }
#------------------------------------------------------------------------------- # }}}
# PYTHON VIRTUAL ENVIRONMENT # Python virtual environment ------------------------------------------------{{{
sub render_pyenv sub render_pyenv
{ {
@ -1095,3 +1099,7 @@ sub render_pyenv
] , ] ,
}; };
} }
# }}}
# }}}