diff --git a/.bash_aliases b/.bash_aliases new file mode 100644 index 0000000..0817038 --- /dev/null +++ b/.bash_aliases @@ -0,0 +1,75 @@ +############################################################################### +# File .bash_aliases +# Jonas Mitschang - jonen@mitschang.net +############################################################################### + +# ssh connections to servers +alias picosrv='ssh jscharrenbach@picosrv1' + +# ls aliases +alias l='ls -l' +alias lla='ls -htlr -A' +alias ll='ls -la' + +# change directory +alias ..='cd ..' +alias ...='cd ../..' +alias ....='cd ../../..' +alias .....='cd ../../../..' +alias p='cd -' +alias pp='cd $HOME/projects/pico-erp_svn/' +alias ele='cd $HOME/projects/elements/' + +## go=move to directory and instantly list its contents +go(){ + cd $@ + ls -l +} + +#start tmux with 256 colors every time +alias tmux="tmux -2" +alias tmxa="tmux attach" + +# misc +alias px="ps auxf" +alias o="xdg-open" + +# pretty print json +alias ppjson='python -c "import sys, json; print json.dumps(json.load(sys.stdin), sort_keys=True, indent=4)"' + +# meine lieblingsvertipper ;-) +alias gerp=grep +alias gpre=grep +alias gre=grep +alias grpe=grep +alias gep=grep +alias wcgrp=wcgrep +alias wcgerp=wcgrep +alias wcgrpe=wcgrep +alias wcgre=wcgrep +alias tial=tail +alias snv=svn +alias iv=vi +alias vo=vi +alias vu=vi +alias chmkd=chmod +alias pign=ping +alias :q=exit +alias :w=sync + +# other stuff +# yes, i want to use rvim instead of less +# alias less='rvim' +alias eierabend='xflock4 ; systemctl suspend --no-wall' +alias icingadoc='w3m http://mo/icinga/docs/en/index.html' +alias updgrade='sudo aptitude update && sudo aptitude upgrade -y' + +# better passwords! +alias apg='apg -M sncl -n 15 -m 10 -x 20' + +# pssh! +alias pssh='parallel-ssh' + +# I don't do different rdp... +alias rdp="LANG=de rdesktop -f -g 1920x1080 -d DOM -u jscharrenbach -k de -r disk:ws71=/home/jscharrenbach/ -r clipboard:PRIMARYCLIPBOARD" +alias rdpwinadmin="LANG=de rdesktop -f -g 1920x1080 -d DOM -u winadmin -k de -r disk:ws71=/home/jscharrenbach/ -r clipboard:PRIMARYCLIPBOARD" diff --git a/.bash_profile b/.bash_profile new file mode 100644 index 0000000..01cded9 --- /dev/null +++ b/.bash_profile @@ -0,0 +1,16 @@ +############################################################################### +# File .bash_profile +# ~/.bash_profile: executed by bash for login shells +# Jonas Mitschang - jonen@mitschang.net +############################################################################### + +# set variable identifying the chroot you work in +if [ -f /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# include .bashrc if it exists +if [ -f ~/.bashrc ]; then + . ~/.bashrc +fi + diff --git a/.bashrc b/.bashrc new file mode 100644 index 0000000..986423e --- /dev/null +++ b/.bashrc @@ -0,0 +1,125 @@ +############################################################################### +# File .bashrc +# Jonas Mitschang - jonen@mitschang.net +############################################################################### +umask 022 + +# set PATH so it includes user's private bin if it exists +if [ -d ~/bin ] ; then + PATH="~/bin:${PATH}" + export PATH +fi + +# do the same with MANPATH +if [ -d ~/man ]; then + MANPATH=~/man:"${MANPATH}" + export MANPATH +fi + +# some programs use a special .dot directory for not +# trashing the home directory with .dotfiles +if [ -d ~/.dot ]; then + DOT=~/.dot + export DOT +fi + +export COLORTERM=1 +#export GREP_OPTIONS='--color=auto' + +# prefered editor +export EDITOR=vi + +# bash history control +export HISTCONTROL=ignoreboth:erasedups +export HISTFILESIZE= +export HISTSIZE=5000 +shopt -s histappend +shopt -s cmdhist + +# completion +shopt -s cdspell +shopt -s hostcomplete + +# If not running interactively, don't do any more +[ -z "$PS1" ] && return + +############################################################################### +# running interactively +############################################################################### +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# only linux, not SunOS etc +if [ `uname` == "Linux" ]; then + # enable color support of ls + if [ "$TERM" != "dumb" ]; then + eval `dircolors -b` + alias ls='ls --color' + fi +fi + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)" + +# set a fancy prompt +if [ $UID == 0 ]; then + # root: red + PS_COLOR="\[\033[1;31m\]" +else + # user + PS_COLOR="\[\033[33m\]" +fi +PS1="\t ${PS_COLOR}${debian_chroot:+($debian_chroot)}\u\[\033[0m\]@\h:\w\$ " + +# if this is an xterm modify the title +case $TERM in +xterm*) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME} $(date +%H:%M:%S) [${PWD}]\007"' + ;; +*) + ;; +esac + +# define your own aliases in ~/.bash_aliases +[ -f ~/.bash_aliases ] && source ~/.bash_aliases + +# local bashrc +[ -f ~/.bashrc_local ] && source ~/.bashrc_local + +# enable programmable completion features +if [ -f /etc/bash_completion ]; then + . /etc/bash_completion +fi + +# This allows you to bookmark your favorite places across the file system +# Define a variable containing a path and you will be able to cd into it regardless of the directory you're in +shopt -s cdable_vars + +# Examples: +# export dotfiles="$HOME/dotfiles" +export projects="$HOME/projects" +export elements="$HOME/elements" +export develop="$HOME/elements/develop" + +# ssh using a new window when we are in TMUX +SSHEXEC=$(which ssh) +ssh() { + if [ -n "$TMUX" ] + then + title="$*" + #if [ "$1" = -t ] + #then + # title="$2" + # shift 2 + #fi + #if [ "$1" = "stay" ] + #then + # "$SSHEXEC $@" + #else + tmux new-window -n "$title" "$SSHEXEC $( echo $@ | sed 's/stay//')" + #fi + else + $SSHEXEC $@ + fi +} diff --git a/.bashrc_local b/.bashrc_local new file mode 100644 index 0000000..57122fe --- /dev/null +++ b/.bashrc_local @@ -0,0 +1,22 @@ +# Some settings stolen from sensible.bash +# Automatically trim long paths in the prompt (requires Bash 4.x) +#PROMPT_DIRTRIM=2 + +# Perform file completion in a case insensitive fashion +bind "set completion-ignore-case on" + +# Save multi-line commands as one command +shopt -s cmdhist + +# Avoid duplicate entries +HISTCONTROL="erasedups:ignoreboth" + +# Enable incremental history search with up/down arrows (also Readline goodness) +# Learn more about this here: http://codeinthehole.com/writing/the-most-important-command-line-tip-incremental-history-searching-with-inputrc/ +bind '"\e[A": history-search-backward' +bind '"\e[B": history-search-forward' +bind '"\e[C": forward-char' +bind '"\e[D": backward-char' + +# vi editing mode +set -o vi diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..f048629 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,38 @@ +# I want 256 colors everywhere +# set -g default-terminal "screen-256-color" + +# C-b is not acceptable - VIM uses it +set-option -g prefix C-a +# bind-key C-a last-window + +#Start numbering at 1 +set -g base-index 1 + +#Rather than constraining window size to the maximum size of any client connected the session, +#constrain window size to the maximum size of any client connected to that window. +setw -g aggressive-resize on + +# Allows us to use C-a a to send commands to a TMUX session insisde another TMUX session +bind-key a send-prefix + +#set -s escape-time 0 + +# Highlight active window +set-window-option -g window-status-current-bg red + +#split panes using | and - +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % + +# switch panes using Alt-arrow without prefix +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +# set -g mouse on + +# don't rename windows automatically +set-option -g allow-rename off diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..45ab167 --- /dev/null +++ b/.vimrc @@ -0,0 +1,116 @@ +"------------------------------------------------------------------------------ +" File .vimrc +" Jonas Mitschang - jonen@mitschang.net +"------------------------------------------------------------------------------ +set nocompatible " use vim defaults +syntax on " use syntax highlighting +set background=dark " when using black background terminal +set relativenumber " relative line numbers! How cool is that?! +set number " line numbers +set clipboard=unnamed +set backspace=indent,eol,start " more powerful backspacing +set autoindent " always set autoindenting on +set formatoptions+=t +set nobackup " Don't keep a backup file +set viminfo='20,\"50 " read/write a .viminfo file, don't store more than + " 50 lines of registers +set history=200 " keep many lines of command line history +set showcmd " Show (partial) command in status line. +set showmatch " Show matching brackets. +set ignorecase " Do case insensitive matching +set smartcase " When searching with Uppercase Letters be Case-Sensitive, otherwise don't be +set incsearch " Incremental search +set hlsearch " Search highlight +set noexpandtab +set tabstop=2 +set sw=2 +set smarttab +set smartindent +set enc=utf-8 " default UTF8 encoding +set fileencoding=utf-8 " default UTF8 encoding +set ruler " show the cursor position all the time +set directory=~/.vim/swap/ + +set lazyredraw "to speed up vim a bit + +" show current file with complete file in statusline +set laststatus=2 +set statusline+=%F + +" set mouse=a + +filetype plugin on +filetype indent on +filetype on + +" settings for vim 7 +if version >= 700 + set spellfile=~/.vimspell.de.add,~/.vimspell.en.add + " setlocal spell spelllang=de " enable spell checker +endif + +hi LineTooLong cterm=bold ctermbg=red guibg=LightYellow +match LineTooLong /\%>80v.\+/ + +" grep will sometimes skip displaying the file name +set grepprg=grep\ -nH\ $* + +" Starting with Vim 7, the filetype of empty .tex files defaults to +" 'plaintex' instead of 'tex', which results in vim-latex not being loaded. +" The following changes the default filetype back to 'tex': +let g:tex_flavor='latex' + +"let g:Tex_Folding=0 "I don't like folding. +set iskeyword+=: + +" Press Space to turn off highlighting and clear any message already displayed. +nnoremap :nohlsearch:echo + +" Incrementing selected numbers (works, when numbers are in a column) +function! Incr() + let a = line('.') - line("'<") + let c = virtcol("'<") + if a > 0 + execute 'normal! '.c.'|'.a."\" + endif + normal `< +endfunction +vnoremap :call Incr() + +" Prss CTRL + _ (CTRL + SHIFT + -) to close a html tag +if filereadable(glob('~/.vim/scripts/closetag.vim')) | source ~/.vim/scripts/closetag.vim | endif + +highlight ExtraWhitespace ctermbg=red guibg=red +match ExtraWhitespace /\s\+$\| \+\ze\t/ + +nnoremap :%retab!:set list:%s/^\(\t\+\) */\1/ + +" Press F5 to insert datetime string from normal- and insert mode +nnoremap "=strftime("%c")P +inoremap =strftime("%c") + +" a few autocommands for when silly people send stupid file formats +" Read-only .doc through antiword +autocmd BufReadPre *.doc silent set ro +autocmd BufReadPost *.doc silent %!antiword "%" + +" Read-only odt/odp through odt2txt +autocmd BufReadPre *.odt,*.odp silent set ro +autocmd BufReadPost *.odt,*.odp silent %!odt2txt "%" + +" Read-only pdf through pdftotext +autocmd BufReadPre *.pdf silent set ro +autocmd BufReadPost *.pdf silent %!pdftotext -nopgbrk -layout -q -eol unix "%" - +"| fmt -w250 + +" Read-only rtf through unrtf +autocmd BufReadPre *.rtf silent set ro +autocmd BufReadPost *.rtf silent %!unrtf --text + +" as long as vim isn't in diff-mode check the code at opening and closing +if ! &diff + let g:syntastic_always_populate_loc_list = 1 + let g:syntastic_auto_loc_list = 1 + let g:syntastic_check_on_open = 1 + let g:syntastic_check_on_wq = 1 +endif