paperlined.org
new_computer_setup > unix
document updated 11 months ago, on Nov 22, 2023
Minimal settings for me to be comfortable.

prompt

PS1="\[\033[7m\]\u@\h:\w\\$\[\033[0m\] "

If you want to customize it, see https://bash-prompt-generator.org/.

For Ksh, remove the square brackets:

export PS1="`tput rev`$USER@$HOSTNAME:\$PWD \$`tput sgr0` "

~/.bashrc

[ -z "$PS1" ] && return
#export PS1="\t \u@\h:\w \$ "
#export PS1="\[$(tput rev)\]\t \u@\h:\w \$\[$(tput sgr0)\] "
export PS1="\[\033]0;\h -- \u -- $(uname)\007\]\[\033[102;30m\]\t \u@\h:\w \$\[\033[00m\] "
set -o vi
bind -m vi-insert \\C-l:clear-screen
export EDITOR=vim
export PAGER=less   LESS=-i
[ -f ~/.bash_aliases ] && . ~/.bash_aliases

~/.bash_profile

[ -f ~/.bashrc ] && . ~/.bashrc

ksh's ~/.profile

typeset -RZ2 _x1 _x2 _x3; let SECONDS=$(date '+3600*%H+60*%M+%S');
_s='(_x1=(SECONDS/3600)%24)==(_x2=(SECONDS/60)%60)==(_x3=SECONDS%60)';
export HOSTNAME=$(hostname|sed 's/\..*//');
export PS1="$(printf "\033]0;${HOSTNAME} -- $USER -- $(uname)\007\033[102;30m\${_d[_s]}\$_x1:\$_x2:\$_x3 ${USER}@${HOSTNAME}:\${PWD} === \033[0m ")"

~/.vimrc

set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent   " tab and indent settings
set nocompatible                                                " turn off vi-compatibility mode
set nobackup
set ignorecase hlsearch                                         " search settings
" swap the : and ; keys                                                                              
nnoremap ; :| nnoremap : ;                                                                           
vnoremap ; :| vnoremap : ;

~/.xinitrc

(be sure to run ln -s ~/.xinitrc ~/.xsession)
xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'          # Caps-lock works as an Escape key

~/.lesskey

Copy-n-paste this at the command line:
printf "[ prev-file\n] next-file\n" > ~/.lesskey;  lesskey

~/.screenrc

startup_message off     # don't display the copyright page
escape ``               # use ` for the escape key
defscrollback 1000      # use a bigger scrollback buffer!
msgwait 1               # how long to display temporary messages for.

hardstatus alwayslastline "%= %3n %t%? [%h]%? %="
caption always "%= %-w%L>%{= BW}%n*%t%{-}%52<%+w %L="

~/.inputrc

C-L: clear-screen
set bell-style none

~/.bash_aliases

##  easily edit & reload aliases
alias rl='. ~/.bash_aliases'
alias ea='${EDITOR:-vi} ~/.bash_aliases; rl'


# gnome-open, kde-open, etc
function go() { xdg-open "$@"; }


## combinations of less/grep/find/xargs
function lgrep()  { grep -Zls  "$@" | xargs -0 less    -p "$1"; }
function lgrepi() { grep -Zlsi "$@" | xargs -0 less -i -p "$1"; }
function xgrep() { xargs -i grep "$@" /dev/null {} ; }          # Solaris version only, needed for its braindead find/xargs/grep arguments.


function vimwhich()  { vim  `which $1`; }
function lesswhich() { less `which $1`; }


function largefiles() { find ${1:-~} -type f -print0 | xargs -0 ls -l | sort -n +4 | tail -100 | perl -ple 's/^.{32}\s*//; s/$ENV{HOME}/~/'; }
function largedirs() { du -k ${1:-~} | sort -n; }
function largeindividualdirs() { du -Sk ${1:-~} | sort -n | tail -1000; }

~/.gitconfig

[color]
    ui = auto

ack

export ACK_PAGER='less -R'

CPAN modules

See CPAN settings here.

cpanm   Getopt::Casual   JSON::XS

Modules I use now, but may not use forever: ("view source" to see the rationale for each)

cpanm   String::Formatter