We've got plenty of Linux/UNIX users around here; let's see some of the black magic in your dotfiles.

Parts of my .bashrc:

Code:
# Get quick status info on softraid on shell launch
raidstat() {
    S=`grep -A1 "$1" /proc/mdstat | tail -n1 | egrep -o "[0-9]+/[0-9]+"`
    echo $1: $S OK
}
raidstat md0

# Prompt something like
# [01:19:29 /foo/bar]
# [tari@Kerwin]$
PS1="[\e[0;36m\t \w\e[m]\n[\u@\h]$ "

# Priority to my own bin directory
PATH="~/bin/:$PATH"

# Misc preferences
alias ls='ls --color=auto'
alias l='ls'
export EDITOR=vim

# Notify of updated packages (pacman -Sy in a cron job)
UPGRADES=$(pacman -Qu | wc -l)
[ $UPGRADES -eq 0 ] && UPGRADES="No"
echo "$UPGRADES package updates available."

Selections from .vimrc:

Code:
" Indent intelligently, replace <Tab> with "    ", smarter backspacing
set autoindent smartindent
set tabstop=4 shiftwidth=4 expandtab
set backspace=indent,eol,start

" Note matching braces/whatever when closing
set showmatch

" Enable smart completion on supported langs
" (C-x C-o)
filetype plugin on
set ofu=syntaxcomplete#Complete

" Turn on lexical highlighting
:syntax on

" Show line numbers
set number

" Make comments (much) easier to read
hi Comment ctermfg=6

# Quick tap of jj to exit insert mode
inoremap jj <ESC>


I've done neat things with my .tmux.conf lately as well, but it needs a bit of cleanup to behave nicely on machines other than my laptop, so I'll leave it with these two for now.
Linux people must have a very loose definition of "black magic".
Would you prefer 'non-default customizations'?
merthsoft wrote:
Linux people must have a very loose definition of "black magic".


People who don't do much pointer arithmetic, interaction with hardware, or nasty things with floating point numbers have a very loose definition of black magic.

My dotfiles don't much special, except to alias ls to have nice default options, and to set PS1 to give me a pretty prompt.
.zshrc

Cronjobs run every five minutes from one of my servers to pull weather, Google calendar, and a random fortune. Other systems will pull these files every half hour, and display it.


Code:
clear
echo -ne "Today is "; date
uname -a
echo -ne "Uptime:";uptime | awk /'up/
{print $3,$4}'
  cat .cachecow
  echo -ne "\n"
  cat .cacheweather
  echo -ne ""
  echo -ne "\n"
  echo -ne "Your Agenda"
  cat .cachecal


Various auto-complete options.


Code:
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]}' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=* l:|=*'
zstyle ':completion:*' menu select=1
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename '/da21/d49/nikky/.zshrc'
autoload -U compinit
compinit


Various aliases.


Code:
setopt autocd
setopt correctall
autoload -U promptinit
promptinit
typeset -U path
alias ls="ls -BF --color=auto"
alias ll='ls -aslFh --color=auto'
alias gls='ls -aslph --color=auto | grep $1'
alias gps='ps aux | grep $1'
alias ps='ps uxww'
alias cdw='cd `wwwhome`'
alias cp='cp -ir'
alias mv='mv -i'
alias grep='grep --color=auto'
alias gcal='gcalcli'
function cdl { cd $1; ls;}


Custom Prompt


Code:
export PROMPT="--> %B%(?..[%?] )%b%F{cyan}[%T]%f %F{yellow}%n%f@%F{red}%m%f %# "
export RPROMPT="%F{magenta}%~%f"
My .bashrc is decent; my .vimrc files are generally very plain, serving only to give me highlighting for dark backgrounds, search match highlighting, and a few other tweaks.
Here's my .bashrc file. I just add stuff to it as I need it:

Code:
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
   . /etc/bashrc
fi

# User specific aliases and functions
PS1='\u@\h:\w\$ '
PATH=$PATH:/usr/local/arm-elf/bin
export TIGCC=/usr/local/gcc4ti
export SDL_AUDIODRIVER=dsp

export CVS_RSH=ssh
export EDITOR=vim
HISTTIMEFORMAT='%F %T '
IGNOREEOF=3

# Get rid of that stupid "command not found" suggestion thing.
# It breaks return values for commands that are not found; it should
# return 127 but it returns 0 instead.
unset command_not_found_handle
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement