add bashrc, vimrc, and install script

This commit is contained in:
Flo 2015-01-09 23:00:06 +01:00
parent 6e9e6780bd
commit d050afd72e
4 changed files with 150 additions and 0 deletions

View File

@ -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

49
bashrc Normal file
View File

@ -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

27
makesymlinks.sh Executable file
View File

@ -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

59
vimrc Normal file
View File

@ -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()