Commit 503146be authored by Pierre-antoine Comby's avatar Pierre-antoine Comby
Browse files
parents cf882327 2af4d8fa
# ssh files should stay private.
id_rsa
id_rsa.pub
known_hosts
......@@ -17,7 +17,7 @@
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'
alias cleanlatex='rm -f *.aux *.log *.out *.synctex.gz'
alias cleanlatex='rm -f *.aux *.log *.out *.synctex.gz *.bbl *.bcf *.blg *.fls *.run.xml *.fdb_latexmk'
# Afficher la taille des partitions en human-readable
alias df='df -h'
......@@ -165,4 +165,4 @@ mvln () {
# VirtualEnv, trop long a taper
alias actenv='source env/bin/activate'
alias matlab='matlab2018'
alias matlab_cli='matlab2018 -nodesktop -nosplash'
......@@ -144,13 +144,6 @@ git_detect(){
return 1
}
# Mercurial isn't
hg_detect(){
check_command hg || return 1
vcs_comm[detect_need_file]=store
detect_by_dir '.hg'
return $?
}
# .svn in each directories
svn_detect() {
......@@ -159,34 +152,6 @@ svn_detect() {
return 1
}
bzr_detect(){
check_command bzr || return 1
vcs_comm[detect_need_file]=branch/format
detect_by_dir '.bzr'
return $?
}
cdv_detect(){
check_command cdv || return 1
vcs_comm[detect_need_file]=format
detect_by_dir '.cdv'
return $?
}
cvs_detect(){
check_command svn || return 1
[[ -d "./CVS" ]] && [[ -r "./CVS/Repository" ]] && return 0
return 1
}
darcs_detect(){
check_command darcs || return 1
# darcs diff seems a good choice since big diff is not the
# common state
darcs diff 2> /dev/null 1>&2 || return 1
vcs_comm[basedir]=$(darcs show repo |awk '{if($1 == "Root:") print $2}')
return 0
}
# Find git's branch
git_getbranch (){
......@@ -309,18 +274,6 @@ git_get_data(){
return 0
}
hg_get_data(){
local hgbranch hgbase file
hgbase=${vcs_comm[basedir]}
# Check if hg branch is efficient
hgbranch=$(hg branch)
vcs_formats '' "${hgbranch}" "${hgbase}" ''
return 0
}
svn_get_data(){
local svnbase svnbranch
local -a svninfo
......@@ -337,51 +290,7 @@ svn_get_data(){
return 0
}
bzr_get_data(){
local bzrbase bzrrev bzrbranch bzrinfo
bzrbase=$(bzr info|awk '{if ($1 == "branch" && $2 == "root:") print $3}')
bzrbase="$(vcs_realpath ${bzrbase})"
bzrinfo=$(bzr version-info|awk '{if ($1 == "branch-nick:"||$1 == "revno:") print $2}')
bzrrev=$(echo $bzrinfo|awk '{print $1}')
bzrbranch=$(echo $bzrinfo|awk '{print $2}')
vcs_formats '' "${bzrbranch}" "${bzrbase}" "${bzrrev}"
return 0
}
cdv_get_data(){
local cdvbase
cdvbase=${vcs_comm[basedir]}
vcs_formats '' "${cdvbase/*\/}" "${cdvbase}" ''
return 0
}
cvs_get_data(){
local cvsbranch cvsbase basename
cvsbase="."
while [[ -d "${cvsbase}/../CVS" ]]; do
cvsbase="${cvsbase}/.."
done
cvsbase="$(vcs_realpath ${cvsbase})"
cvsbranch=$(< ./CVS/Repository)
basename=${cvsbase/*\/}
cvsbranch=${cvsbranch#${basename}/}
[[ -z ${cvsbranch} ]] && cvsbranch=${basename}
vcs_formats '' "${cvsbranch}" "${cvsbase}" ''
return 0
}
darcs_get_data(){
local darcsbase
darcsbase=${vcs_comm[basedir]}
vcs_formats '' "${darcsbase/*\/}" "${darcsbase}" ''
return 0
}
vcs_info(){
local -i found
......@@ -392,7 +301,7 @@ vcs_info(){
local -A disabled
vcs="init"
vcss=(git hg darcs svn bzr cvs cdv)
vcss=(git svn )
disabled[cdv]=1
disabled[cvs]=1
disabled[bzr]=1
......@@ -540,6 +449,11 @@ function prompt_command
else
VENV=''
fi
if [[ ${STY} != "" ]]
then
SCREEN_NAME=${STY//[[:digit:]]/}
SCREEN_ENV="[${SCREEN_NAME#.}]"
fi
# Génération des différents morceaux du prompt, avec ou sans la couleur
if [ "$color_prompt" = yes ]; then
......@@ -553,7 +467,7 @@ function prompt_command
DATE="( ${date_color}\D{%H:%M:%S}${line_color_prompt} )"
# Deuxième ligne du prompt "user@host $"
# Attention "\\\$" devient \$, c'est-à-dire # pour root, $ pour les autres
PROMPT="${username_color}\u${symbols_color}@${host_color}\h ${symbols_color}${VENV}${symbols_color}\\\$ ${nocolor_prompt}"
PROMPT="${username_color}\u${symbols_color}@${host_color}\h ${symbols_color}${SCREEN_ENV}${VENV}${symbols_color}\\\$ ${nocolor_prompt}"
# On fusionne tout ça
PS1=$TITLE${line_color_prompt}$MINUS_CHAR$DATE$MINUS_CHAR$DIR$MINUS_CHAR${line_color_prompt}$POST_DIR$VCS_info$ERR'\n'$PROMPT
else
......
......@@ -40,5 +40,5 @@
# (dans git 2.0, le comportement par défaut deviendra simple)
default = matching
[core]
excludesfile = /home/pac/.gitignore_global
excludesfile = ~/.gitignore_global
editor = "vim"
......@@ -73,7 +73,7 @@ _minted*
# auto folder when using emacs and auctex
./auto/*
*.el
# *.el
......
......@@ -691,6 +691,21 @@ Host zephir.adm zephir zephir.adm.crans.org
ForwardAgent yes
ProxyJump stitch.crans.org
#~# # +---------+
#~# # | KIT IPE |
#~# # +---------+
Host ipepc21 ipebridge 141.52.64.12
HostName 141.52.64.12
User vt6798
ForwardX11 yes
ForwardAgent yes
Host ipecalc ipeyig-xubuntu.ipe.kit.edu
HostName ipeyig-xubuntu.ipe.kit.edu
User comby
ForwardX11 yes
ForwardAgent yes
ProxyJump 141.52.64.12
#~# # +-------+
#~# # | Perso |
#~# # +-------+
......
......@@ -8,7 +8,7 @@ fi
# Change dir to files location in repo, in case script was called from somewhere else
cd "$(dirname "$0")"
filesdir="$(pwd)/files"
filesdir="$(pwd)/files/"
# Recursively create symlinks
cp -TdRbs "$filesdir" "$HOME"
# ln -vsf "$filesdir/.*" "$HOME"
find "$filesdir" -maxdepth 1 -mindepth 1| while read file; do ln -sf "$file" "$HOME/"; done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment