commit de2ed9065921150b67b5c92dc0c806944be0abe5 Author: Faerbit Date: Sat Jan 11 00:18:09 2014 +0100 Initial Commit; Removed all previous commits to protect sensitive data diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ + diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..6fd8b32 --- /dev/null +++ b/LICENCE @@ -0,0 +1,6 @@ +Copyright (C) 2013 Faerbit + +"THE BEER-WARE LICENSE" (Revision 42): +Faerbit wrote this file. As long as you retain this notice you +can do whatever you want with this stuff. If we meet some day, and you think +this stuff is worth it, you can buy me a beer in return. Faerbit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4344303 --- /dev/null +++ b/Makefile @@ -0,0 +1,15 @@ +all: symlinks setup-vim + +symlinks: + chmod +x make_symlinks.sh + ./make_symlinks.sh + +setup-vim: + mkdir -p ../.vim + cp -r vim/* ../.vim + chmod +x ../.vim/custom_make.sh + cd ../.vim/bundle; make -f Makefile init + +sensitive: + multigpg extract zsh_sensitive.tar.gpg zsh_sensitive + mv zsh_sensitive ../.zsh_sensitive diff --git a/README.md b/README.md new file mode 100644 index 0000000..aa2b36d --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +#dotfiles + +These are my personal dotfiles. + +To deploy them I clone this repo and just run the Makefile. + +##License + +This is Beerware, see LICENCE for details. diff --git a/gitconfig b/gitconfig new file mode 100644 index 0000000..36e8ad3 --- /dev/null +++ b/gitconfig @@ -0,0 +1,10 @@ +[user] + name = Faerbit + email = faerbit@server.fake +[credential] + helper = cache +[push] + default = simple +[core] + editor = vim -c 'startinsert' + excludesfile = ~/.globalgitignore diff --git a/globalgitignore b/globalgitignore new file mode 100644 index 0000000..1377554 --- /dev/null +++ b/globalgitignore @@ -0,0 +1 @@ +*.swp diff --git a/make_symlinks.sh b/make_symlinks.sh new file mode 100755 index 0000000..5aaf3f6 --- /dev/null +++ b/make_symlinks.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +test -f ../.zshrc || ln -s .dotfiles/zshrc ../.zshrc +test -f ../.zsh_functions || ln -s .dotfiles/zsh_functions ../.zsh_functions +test -f ../.vimrc || ln -s .dotfiles/vimrc ../.vimrc +test -f ../.gitconfig || ln -s .dotfiles/gitconfig ../.gitconfig +test -f ../.globalgitignore || ln -s .dotfiles/globalgitignore ../.globalgitignore diff --git a/vim/bundle/Makefile b/vim/bundle/Makefile new file mode 100644 index 0000000..ec6ea90 --- /dev/null +++ b/vim/bundle/Makefile @@ -0,0 +1,11 @@ +all: update + +init: + git init + test -d tlib || git submodule add https://github.com/tomtom/tlib_vim.git tlib + test -d addon-mw-utils || git submodule add https://github.com/MarcWeber/vim-addon-mw-utils.git addon-mw-utils + test -d snipmate || git submodule add https://github.com/garbas/vim-snipmate.git snipmate + test -d snippets || git submodule add https://github.com/honza/vim-snippets.git snippets + +update: + git submodule update diff --git a/vim/custom_make.sh b/vim/custom_make.sh new file mode 100644 index 0000000..12a7e22 --- /dev/null +++ b/vim/custom_make.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +done=false + +until $done +do + if [ -f Makefile ] + then + echo "Executing $(pwd)/Makefile:" + make + done=true + break + fi + if [ -d .git ] + then + echo "Didn't find a makefile in this repository. Aborting." + done=true + break + fi + if [ $(pwd) = '/' ] + then + echo "Didn't find a makefile. Aborting." + done=true + break + fi + cd .. + echo "Entering super directory: $(pwd)" +done diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..99796e2 --- /dev/null +++ b/vimrc @@ -0,0 +1,30 @@ +set background=dark +set autoindent +set number +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set incsearch +set hlsearch +set expandtab +set foldmethod=indent +set nofoldenable +set foldlevel=99 +set autowrite +set cmdheight=2 +set wildmode=longest,list,full +set wildmenu +syntax on +filetype plugin indent on +"Change working dir to current dir +:cd %:p:h +:nmap :! ~/.vim/custom_make.sh +"only execute pathogen if it exists +runtime! autoload/pathogen.vim +if exists("*pathogen#infect") + execute pathogen#infect() +endif +"Split view if multiple files are opened +if argc() == 2 + silent vertical all +endif diff --git a/zsh_functions b/zsh_functions new file mode 100644 index 0000000..114595e --- /dev/null +++ b/zsh_functions @@ -0,0 +1,42 @@ +copy_img_to_usb(){ + if [[ $1 = "" ]] + then + return 1 + fi + FILE=$1 + FILESIZE=$(stat -c%s "$1") + TARGET=$2 + lsblk + echo "Are you sure you want to copy $FILE to $TARGET?" + read + if [[ $REPLY =~ ^[Yy]$ ]] + then + sudo umount $TARGET?* + dd bs=4M if=$FILE | pv -s $FILESIZE | sudo dd of=$TARGET && sync + fi +} + +cdtemp(){ + local tmpfolder=$(mktemp -d) + cd $tmpfolder + aliasstring="change_dir $tmpfolder " + #delete folder if cd out of it + alias cd=$aliasstring +} + +#belongs to the cdtemp function +change_dir(){ + #If no dir is specified go to home directory as expected + if [[ $2 = "" ]] + then + cd + else + cd "$2" + fi + if [ ! $(expr match $(pwd) '\(/tmp/tmp.[a-zA-Z0-9]*\)') ] + then + echo "Deleting tmp folder $1." + rm -rf "$1" + unalias cd + fi +} diff --git a/zsh_sensitive.tar.gpg b/zsh_sensitive.tar.gpg new file mode 100644 index 0000000..c990ef2 --- /dev/null +++ b/zsh_sensitive.tar.gpg @@ -0,0 +1 @@ +  [jBS56o&Hw5-=D0lhU^$kQqM R} g?9ly8QKw J16|_ߣp|( ztEk=TjP.Ae1 %e[[ yMeũ)Imo7}e'#-;N]rMh^Ak\Dfs`,gڞZf݄ :}_ijDʼnuQT:D/)95rړaAhTfƝm7Z4DLYƈ0c2G>Vj |5 \ No newline at end of file diff --git a/zshrc b/zshrc new file mode 100644 index 0000000..bd439a4 --- /dev/null +++ b/zshrc @@ -0,0 +1,38 @@ +alias sudo='sudo ' +alias tasks="ps -u fab" +alias update-grub="grub-mkconfig -o /boot/grub/grub.cfg" +alias sml2p='/home/fab/.Sync-my-L2P/Sync-my-L2P.run' +alias updatemirrors='reflector --verbose -p http -l 7 --sort rate --sort delay --country 'Germany' --save /etc/pacman.d/mymirrorlist' +alias ssh='ssh ' +alias ping='ping ' +alias aur-update='yaourt -Sbu --aur --noconfirm' +alias clear-orphans='pacman -Rns $(pacman -Qqdt)' +alias rmtex='rm *.log; rm *.aux' +alias ghibernate='gnome-screensaver-command --lock && sudo pm-hibernate' +alias load-vboxdrivers='modprobe -a vboxdrv vboxnetadp vboxnetflt' +#Now with extra shibe +alias wow='git status' +alias very='git' +alias much='git' +alias such='git' +#Do not store commmands with leading space +setopt HIST_IGNORE_SPACE +#Do not store ls and cd +alias cd=' cd' +alias ls=' ls --color=auto' +if [ -f .zsh_environment ] +then + source ~/.zsh_environment +fi +#for accounts whithout root +if [ -f .zsh_grml ] +then + source ~/.zsh_grml +fi +#for untrusted machines +if [ -f .zsh_sensitive ] +then + source ~/.zsh_sensitive +fi +source ~/.zsh_functions +export EDITOR=vim