From d050afd72e374e9767183aae1ccb4c9b6b9482a9 Mon Sep 17 00:00:00 2001 From: Flo Date: Fri, 9 Jan 2015 23:00:06 +0100 Subject: [PATCH] add bashrc, vimrc, and install script --- README.md | 15 +++++++++++++ bashrc | 49 ++++++++++++++++++++++++++++++++++++++++ makesymlinks.sh | 27 ++++++++++++++++++++++ vimrc | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 150 insertions(+) create mode 100644 bashrc create mode 100755 makesymlinks.sh create mode 100644 vimrc diff --git a/README.md b/README.md index e69de29..63045b8 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,15 @@ +my dotfiles +=========== + +Install +------- + +we will use script makesymlinks.sh to install dotfiles +change files var to suit yours need, then launch it : + +``` bash +git clone git@grimbergen.fino.fr:flo/dotfiles.git ~/dotfiles +cd ~/dotfiles +./makesymlinks.sh +``` +backup of existing dotfiles will be made in a dotfiles_old folder diff --git a/bashrc b/bashrc new file mode 100644 index 0000000..0e8d9ef --- /dev/null +++ b/bashrc @@ -0,0 +1,49 @@ +# Flo .bashrc + +### set user bin path +PATH="~/bin:$PATH" + +### colors for ls, etc. +eval `dircolors -b /etc/DIR_COLORS` +alias ls="ls --color=always" + +### common aliases +alias ll="ls -l" +alias la="ls -a" +alias lh="ll -h" +alias l="ls -alh" +alias ..="cd .." +alias rm="rm -i" +alias cp="cp -i" +alias mv="mv -i" + +# man in english +alias man="LANG=\"en_US.UTF-8\" man" +export PAGER="/usr/bin/most -s" + +### Change the window title of X terminals +case $TERM in + xterm*|rxvt|Eterm|eterm) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"' + ;; + screen) + PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"' + ;; +esac + +### activate bash-completion: +[ -f /etc/profile.d/bash-completion ] && source /etc/profile.d/bash-completion + +complete -cf sudo +complete -cf man + +# aliases +if [ -f ~/.bash_aliases ]; then + . ~/.bash_aliases +fi + +## load aliases +#source $HOME/.bash_aliases +# +## enable bash completion +#source /etc/profile.d/bash-completion.sh diff --git a/makesymlinks.sh b/makesymlinks.sh new file mode 100755 index 0000000..14ca1df --- /dev/null +++ b/makesymlinks.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# +# This script creates symlinks from the home directory to any desired dotfiles in ~/dotfiles +# + +dir=~/dotfiles # dotfiles directory +olddir=~/dotfiles_old # old dotfiles backup directory +files="bashrc vimrc" # list of files/folders to symlink in homedir + +# create dotfiles_old in homedir +echo "Creating $olddir for backup of any existing dotfiles in ~" +mkdir -p $olddir +echo "...done" + +# change to the dotfiles directory +echo "Changing to the $dir directory" +cd $dir +echo "...done" + +# move any existing dotfiles in homedir to dotfiles_old directory, then create symlinks +for file in $files; do + echo "Moving any existing dotfiles from ~ to $olddir" + mv ~/.$file ~/dotfiles_old/ + echo "Creating symlink to $file in home directory." + ln -s $dir/$file ~/.$file +done diff --git a/vimrc b/vimrc new file mode 100644 index 0000000..e024541 --- /dev/null +++ b/vimrc @@ -0,0 +1,59 @@ +" Use Vim settings, rather then Vi settings (much better!). +" This must be first, because it changes other options as a side effect. +set nocompatible + +"set tabstop=4 +"set shiftwidth=4 + +" allow backspacing over everything in insert mode +set backspace=indent,eol,start + +set history=50 " keep 50 lines of command line history +set ruler " show the cursor position all the time +set showcmd " display incomplete commands +"set incsearch " do incremental searching + +" Don't use Ex mode, use Q for formatting +"map Q gq + +" This is an alternative that also works in block mode, but the deleted +" text is lost and it only works for putting the current register. +"vnoremap p "_dp + +" Switch syntax highlighting on, when the terminal has colors +" Also switch on highlighting the last used search pattern. +"if &t_Co > 2 || has("gui_running") +" syntax on +" set hlsearch +"endif + +" Enable file type detection. +" Use the default filetype settings, so that mail gets 'tw' set to 72, +" 'cindent' is on in C files, etc. +" Also load indent files, to automatically do language-dependent indenting. +filetype plugin on +filetype indent on + +set autoindent " always set autoindenting on +set encoding=utf-8 +set fileencoding=utf-8 + +set showmode +set backspace=indent,eol,start +set sm +syntax on +set hlsearch +set nobackup +set ts=4 +set sw=4 +set tw=0 +set expandtab + +set cryptmethod=blowfish + + +au BufRead,BufNewFile *.pde set filetype=arduino +au BufRead,BufNewFile *.ino set filetype=arduino + +" pathogen +execute pathogen#infect()