#!/usr/bin/perl ########################################### # dotfiles # 2005, Mike Schilli ########################################### use strict; use warnings; use vars qw($CVSVERSION); $CVSVERSION = '$Revision: 1.2 $'; blurt(vimrc(), "$ENV{HOME}/.vimrc"); blurt(bashrc(), "$ENV{HOME}/.bashrc"); blurt(inputrc(), "$ENV{HOME}/.inputrc"); ########################################### sub blurt { ########################################### my($data, $file) = @_; open FILE, ">$file" or die "Cannot open $file"; print FILE $data; close FILE; } ########################################### sub inputrc { ########################################### return <<'EOT'; set editing-mode vi set keymap vi-insert EOT } ########################################### sub bashrc { ########################################### return <<'EOT'; export PATH=.:~/bin:$PATH #PS1='\033[1;34m\h.\u:\W\$\033[0m ' #PS1='\033[1;34m\$\033[0m ' PS1='\h.\u:\W\$ ' set editing-mode vi alias m=make export EDITOR=vi alias cvd='cvs diff' alias cvu='cvs -q update' alias cvc='cvs commit' alias cva='cvs add' function c () { cd `cdbm $1`; pwd; ls; } alias cpan='perl -MCPAN -eshell' function lcd () { cd `symlinkdir $1`; pwd; ls; } EOT } ########################################### sub vimrc { ########################################### return <<'EOT'; version 6.0 map !L iuse Log::Log4perl qw(:easy);Log::Log4perl->easy_init($DEBUG); map !D iuse Data::Dumper; print Dumper();hi map !P i#!/usr/bin/perl -w ########################################### # xx --  # Mike Schilli, 2005 (m@perlmeister.com) ########################################### use strict; use Sysadm::Install qw(:all);  map F o43i#yypo}kkosub {hi map U !G~/bin/ix2iso.stdout map f !Gperl -MText::Autoformat -e'autoformat{right=>70}' set fileencodings=utf-8,latin1 set formatoptions=tcql set history=50 set hlsearch set ruler set shiftwidth=4 :autocmd FileType perl :set cindent :autocmd FileType perl :set expandtab set smarttab :nnoremap X :w:!perl -MVi::QuickFix -cw % :nnoremap _t :%!perltidy -i=2 -l=29 -pt=2 -ce -q :set tags=~/.ptags.txt :set iskeyword+=: :nnoremap E :cf set viminfo='20,\"50,:20,%,n~/.viminfo au BufReadPost * if line("'\"")|execute("normal `\"")|endif EOT } __END__ =head1 NAME dotfiles - Install dotfiles .bashrc, .vimrc, .inputrc =head1 DOWNLOAD _SRC_HERE_ =head1 SYNOPSIS dotfiles =head1 DESCRIPTION C creates my preferred versions of C<.bashrc>, C<.vimrc>, and C<.inputrc>. =head1 LEGALESE Copyright 2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR 2005, Mike Schilli