diff options
-rw-r--r-- | bookmarks | 3 | ||||
-rwxr-xr-x | install.sh | 158 | ||||
-rw-r--r-- | repos.zsh | 19 | ||||
-rw-r--r-- | sed | 11 | ||||
-rw-r--r-- | vim/.netrwhist | 4 | ||||
-rw-r--r-- | zshrc | 18 |
6 files changed, 34 insertions, 179 deletions
@@ -4,5 +4,6 @@ dotfiles : /home/urbain/dotfiles phd : /home/urbain/Dropbox/phd code : /home/urbain/Dropbox/phd/code/spectral feature : /home/urbain/Dropbox/phd/code/spectral/feature -develop : /home/urbain/Dropbox/phd/code/spectral/develop presentation : /home/urbain/Dropbox/phd/presentations/spectral +develop : /home/urbain/Dropbox/phd/code/spectral/develop +github : /home/urbain/github @@ -4,120 +4,6 @@ home=/home/urbain dir=$home/dotfiles olddir=$home/dotfiles_old -declare -A repodirs -repodirs[alols/xcape]=$home/xcape -repodirs[Anthony25/gnome-terminal-colors-solarized]=$home/github/gnome-terminal-colors-solarized -repodirs[altercation/mutt-colors-solarized]=$home/github/mutt-colors-solarized -repodirs[seebi/dircolors-solarized]=$home/github/dircolors-solarized -repodirs[uvaes/fzf-marks]=$home/github/fzf-marks -repodirs[atweiden/fzf-extras]=$home/github/fzf-extras -repodirs[rupa/z]=$home/github/z -repodirs[junegunn/fzf]=$home/.fzf -repodirs[icholy/ttygif]=$home/github/ttygif -repodirs[tmux-plugins/tpm]=$home/.tmux/plugins/tpm -repodirs[junegunn/vim-plug]=$dir/vim/vim-plug -repodirs[tarjoilija/zgen]=$home/.zgen - -function after_vimplug { - cd .. - rm -rf autoload - mkdir -p autoload - cd autoload - ln -s ../vim-plug/plug.vim; -} - -declare -A actions -actions[Anthony25/gnome-terminal-colors-solarized]='' -actions[alols/xcape]='make' -actions[altercation/mutt-colors-solarized]='' -actions[icholy/ttygif]='make' -actions[junegunn/fzf]='./install' -actions[rupa/z]='make' -actions[atweiden/fzf-extras]='' -actions[junegunn/vim-plug]='after_vimplug' -actions[seebi/dircolors-solarized]='' -actions[tmux-plugins/tpm]='' -actions[uvaes/fzf-marks]='' - -function fetch_repo { - cd $1 - echo "Fetching origin of git repository stored in $1 ..." - git fetch -q origin master -} - -function clone_repo { - githubDir=https://github.com/$1 - echo "Cloning $repo in $2" - git clone -q $githubDir $2 - cd $2 -} - -function waitjobs { - for job in `jobs -p` - do - wait $job - done -} - -function install_repos { - echo -e "\n*** \e[1mInstalling git repositories\e[0m ***" - - for repo in "${!repodirs[@]}"; do - - repodir=${repodirs[$repo]} - action=${actions[$repo]} - - if [ ! -d $repodir ]; then - clone_repo $repo $repodir $action & - else - echo -e "\e[0mRepository $repo already installed in ${repodir}.\e[0m" - fi - done - waitjobs - echo "--> Done!"; echo - - echo -e "*** \e[1mExectutiong actions after installation\e[0m ***" - for repo in "${!repodirs[@]}"; do - cd ${repodirs[$repo]} - eval ${actions[$repo]} - done -} - -function update_repos { - echo -e "\n*** \e[1mUpdating git repositories\e[0m ***" - - for repo in "${!repodirs[@]}"; do - - repodir=${repodirs[$repo]} - - if [ -d $repodir ]; then - fetch_repo $repodir & - fi - done - - waitjobs - echo "--> Done!"; echo - - for repo in "${!repodirs[@]}"; do - - repodir=${repodirs[$repo]} - - if [ -d $repodir ]; then - cd $repodir - echo "Merging upstream updates of git repository stored in ${repo}..." - cat <(git log --reverse --pretty=format:"-- %h %s (%cr)" -4); echo -e "\e[36m" - output=$(git log HEAD..origin) - if [[ ! -z $output ]]; then - cat <(git log --reverse --pretty=format:"-- %h %s (%cr)" HEAD..origin); echo -e "\e[0m" - else - echo -e "-- No updates since last pull\e[0m" - fi - git merge -q origin/master - echo - fi - done -} - function install_dotfiles { echo -e "\n*** \e[1mInstalling dotfiles\e[0m ***" @@ -145,12 +31,6 @@ function install_dotfiles { } function clean { - echo -e "\n*** \e[1mCleaning repositories\e[0m ***" - for repo in "${!repodirs[@]}"; do - echo "Cleaning $repo in ${repodirs[$repo]}" - rm -rf ${repodirs[$repo]} - done - echo -e "\n*** \e[1mCleaning dotfiles\e[0m ***" for file in `ls`; do rm -rfv ~/.$file @@ -180,39 +60,5 @@ function update_dotfiles { fi } -if [[ $# = 0 ]]; then - update_dotfiles - install_dotfiles - update_repos -fi - -while [[ $# > 0 ]] -do - key="$1" - case $key in - -d|--dotfiles) - install_dotfiles - ;; - -i|--repositories) - install_repos - ;; - -u|--repositories) - update_repos - ;; - -p|--packages) - install_packages - ;; - -c|--clean) - clean - ;; - -a|--all) - clean - install_dotfiles - install_repos - update_repos - ;; - *) - ;; - esac - shift -done +update_dotfiles +install_dotfiles @@ -1,29 +1,25 @@ -home=/home/urbain -vimdir=$home/dotfiles - declare -A repodirs +declare -A actions # General purpose -repodirs[alols/xcape]=/home/urbain/xcape repodirs[icholy/ttygif]=/home/urbain/github/ttygif +repodirs[alols/xcape]=/home/urbain/xcape # Solarized -# repodirs[Anthony25/gnome-terminal-colors-solarized]=/home/urbain/github/gnome-terminal-colors-solarized repodirs[altercation/mutt-colors-solarized]=/home/urbain/github/mutt-colors-solarized -repodirs[seebi/dircolors-solarized]=/home/urbain/github/dircolors-solarized -# Mp plugins +# My plugins repodirs[uvaes/fzf-marks]=/home/urbain/github/fzf-marks -# repodirs[uvaes/grm]=/home/urbain/github/grm +repodirs[uvaes/grm]=/home/urbain/.grm # fzf-related -# repodirs[atweiden/fzf-extras]=/home/urbain/github/fzf-extras repodirs[junegunn/fzf]=/home/urbain/.fzf +repodirs[atweiden/fzf-extras]=/home/urbain/github/fzf-extras # Plugin managers -repodirs[tmux-plugins/tpm]=/home/urbain/.tmux/plugins/tpm repodirs[junegunn/vim-plug]=/home/urbain/.vim/vim-plug -repodirs[tarjoilija/zgen]=/home/urbain/.zgen +repodirs[tmux-plugins/tpm]=/home/urbain/.tmux/plugins/tpm +# repodirs[tarjoilija/zgen]=/home/urbain/.zgen function after_vimplug { cd .. @@ -37,5 +33,4 @@ declare -A actions actions[alols/xcape]='make' actions[icholy/ttygif]='make' actions[junegunn/fzf]='./install' -actions[rupa/z]='make' actions[junegunn/vim-plug]='after_vimplug' @@ -0,0 +1,11 @@ + repodirs[alols/xcape]=$home/xcape + repodirs[altercation/mutt-colors-solarized]=$home/github/mutt-colors-solarized + repodirs[atweiden/fzf-extras]=$home/github/fzf-extras + repodirs[icholy/ttygif]=$home/github/ttygif + repodirs[junegunn/fzf]=$home/.fzf + repodirs[junegunn/vim-plug]=$dir/vim/vim-plug +repodirs[seebi/dircolors-solarized]=$home/github/dircolors + repodirs[tarjoilija/zgen]=$home/.zgen + repodirs[tmux-plugins/tpm]=$home/.tmux/plugins/tpm + repodirs[uvaes/fzf-marks]=$home/github/fzf-marks + repodirs[uvaes/grm]=$home/github/grm s/^[^[].*\(\[.*\]\).*$/\1/g diff --git a/vim/.netrwhist b/vim/.netrwhist index 76938f5..637791c 100644 --- a/vim/.netrwhist +++ b/vim/.netrwhist @@ -1,3 +1,5 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =1 +let g:netrw_dirhist_cnt =3 let g:netrw_dirhist_1='/home/urbain/Dropbox/phd/code/spectral/develop/cpp' +let g:netrw_dirhist_2='/home/urbain/dotfiles' +let g:netrw_dirhist_3='/home/urbain' @@ -1,4 +1,4 @@ -# Load zgen +Load zgen source "/home/urbain/.zgen/zgen.zsh" if ! zgen saved; then @@ -26,7 +26,7 @@ if ! zgen saved; then # My plugins zgen load uvaes/fzf-marks - zgen load uvaes/grm + # zgen load uvaes/grm # Other plugins zgen load rupa/z @@ -39,24 +39,24 @@ if ! zgen saved; then zgen save fi -# Custom key bindings +# Custom key bindings for widgets bindkey -a 'k' history-beginning-search-backward bindkey -a 'j' history-beginning-search-forward bindkey '^P' history-beginning-search-backward bindkey '^N' history-beginning-search-forward +bindkey '^y' autosuggest-execute-suggestion -# Plugins configuration -REPOFILE="/home/urbain/dotfiles/repos.zsh" +# Environment variables for plugins +AUTOSUGGESTION_HIGHLIGHT_COLOR='fg=6' +REPOFILE=/home/urbain/dotfiles/repos.zsh # Autosuggestion -AUTOSUGGESTION_HIGHLIGHT_COLOR='fg=6' -bindkey '^y' autosuggest-execute-suggestion zle-line-init() { zle autosuggest-start } zle -N zle-line-init -# Fzf-marks +# Repofile # User configuration export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" @@ -145,7 +145,6 @@ fshow() { xargs -I % sh -c "git show --color=always % | less -R"' } -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then @@ -199,3 +198,4 @@ z() { _z "$@" fi } +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh |