diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 90c73a6..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -copyconfigurations.sh diff --git a/config/vimrc b/config/vimrc new file mode 100644 index 0000000..dc843d3 --- /dev/null +++ b/config/vimrc @@ -0,0 +1,14 @@ +filetype on +syntax on +set background=dark +set linebreak +set visualbell +set showmatch +set hlsearch +set autoindent +set expandtab +set shiftwidth=2 +set smartindent +set smarttab +set softtabstop=2 +set mouse=a diff --git a/config/zshrc b/config/zshrc new file mode 100644 index 0000000..5cf6cb5 --- /dev/null +++ b/config/zshrc @@ -0,0 +1,102 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="candy" +bindkey '^H' backward-kill-word + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" diff --git a/configurations/.Xdefaults b/configurations/.Xdefaults deleted file mode 100644 index 07387fa..0000000 --- a/configurations/.Xdefaults +++ /dev/null @@ -1,72 +0,0 @@ -xscreensaver.Dialog.headingFont: -*-fixed-bold-r-*-*-*-100-*-*-*-*-iso8859-1 - -/* URxvt */ -URxvt*termName: rxvt -URxvt*allow_bold: true -URxvt*depth: 32 -URxvt*foreground: white -URxvt*background: black -URxvt.background: [95]#000000 -URxvt*shading: 10 -URxvt*tint: black -URxvt.cursorColor: #008C00 -URxvt*scrollBar: false -URxvt*saveLines: 10000 -URxvt*perl-ext-common: default,matcher,tabbed,clipboard,font-size -URxvt*url-launcher: firefox -URxvt*colorUL: #3465A4 -URxvt*matcher.button: 3 -URxvt*tabbed.tabbar-fg: 10 -URxvt*tabbed.tabbar-bg: 8 -URxvt*tabbed.tab-fg: 14 -URxvt*tabbed.tab-bg: 8 -URxvt.geometry: 90x25 -URxvt.font: xft:Monospace:size=11 - - -! do not scroll with output -URxvt*scrollTtyOutput: false - -! scroll in relation to buffer (with mouse scroll or Shift+Page Up) -URxvt*scrollWithBuffer: true - -! scroll back to the bottom on keypress -URxvt*scrollTtyKeypress: true - -URxvt.keysym.Control-Right: \033[1;5C -URxvt.keysym.Control-Left: \033[1;5D - -URxvt.keysym.Shift-PageUp: command:\033]720;1\007 -URxvt.keysym.Shift-PageDown: command:\033]721;1\007 - -URxvt.keysym.C-Up: perl:clipboard:copy -URxvt.keysym.C-Down: perl:clipboard:paste - -URxvt.keysym.C-0x2b: perl:font-size:increase -URxvt.keysym.C-0x2d: perl:font-size:decrease - -! black -! URxvt*color0 : #424242 -! URxvt*color8 : #000000 -! ! red -! URxvt*color1 : #CC0000 -! URxvt*color9 : #EF2929 -! ! green -! URxvt*color2 : #4E9A06 -! URxvt*color10 : #1CB500 -! ! yellow -! URxvt*color3 : #C4A000 -! URxvt*color11 : #FCE94F -! ! blue -! URxvt*color4 : #3465A4 -! URxvt*color12 : #729FCF -! ! magenta -! URxvt*color5 : #75507B -! URxvt*color13 : #AD7FA8 -! ! cyan -! URxvt*color6 : #06989A -! URxvt*color14 : #00F3FF -! ! white -! URxvt*color7 : #D3D7CF -! URxvt*color15 : #EEEEEC - diff --git a/configurations/.vimrc b/configurations/.vimrc deleted file mode 100644 index 6f245ff..0000000 --- a/configurations/.vimrc +++ /dev/null @@ -1,176 +0,0 @@ -" za pour les folds -" ctrl + n pour le multi curseur -" crtl + ] pour aller à la définition de fonction -" ctrl + t pour revenir à avant ctrl + ] -" gf pour suivre le fichier sous le curseur - -set nocompatible " be iMproved, required -filetype off " required - -" set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/vundle/ -call vundle#rc() - -" let Vundle manage Vundle, required -Plugin 'gmarik/vundle' -Plugin 'tpope/vim-fugitive' -Plugin 'vim-scripts/a.vim' -" Plugin 'Rip-Rip/clang_complete' -Plugin 'vim-scripts/DoxygenToolkit.vim' -Plugin 'ervandew/supertab' -Plugin 'emezeske/manpageview' -Plugin 'terryma/vim-multiple-cursors' -Plugin 'scrooloose/nerdcommenter' -Plugin 'scrooloose/nerdtree' -Plugin 'vim-perl/vim-perl' -Plugin 'c9s/perlomni.vim' -Plugin 'scrooloose/syntastic' -Plugin 'wincent/command-t' -Plugin 'vim-scripts/taglist.vim' -" Plugin 'Raimondi/delimitMate' -" Plugin 'WolfgangMehner/vim-plugins' -Plugin 'SirVer/ultisnips' -Plugin 'honza/vim-snippets' -Plugin 'chrisbra/Replay' -" Plugin 'fatih/vim-go' -Plugin 'terryma/vim-expand-region' - -filetype plugin indent on - -syntax enable " Coloration syntaxique -set t_Co=256 " Nombre de couleurs différentes -highlight NbSp ctermbg=5 -match NbSp /\%xa0/ - -set ai " Activer l'indentation automatique -set si " Activer l'indentation intelligente -set showcmd " Affiche (partiellement) la commande dans la barre de statut -set showmatch " Afficher les brackets qui correspondent -set ignorecase " Recherche insensible à la casse -set incsearch " Recherche insensible à la casse -set mouse=a " Activer la souris pour tous les modes -set number " Afficher les numéros de ligne -set shiftwidth=2 " Une tabulation = 4 espaces -set tabstop=2 -set expandtab " Transformer les tabulations en espaces -set ruler " Afficher la position courante -set smarttab " Être intelligent dans l'utilisation des tabluations -set fileencoding=utf-8 " Encoder en UTF-8 -set shell=zsh " Votre shell -set wildmenu " Completion dans l'interface -set wildmode=list:longest " Comportement de la complétion semblable à celui d'un shell -set wildignore=*.o,*~ "Ignorer les fichiers temporaires et objets -set foldmethod=indent " Méthode pour cacher du code (donc selon l'indentation) -set nofoldenable " Ne rien cacher par défaut - -set background=dark - -" Autocomplétion intelligente -set omnifunc=syntaxcomplete#Complete - -" Désactiver les commentaires auto -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o - -" Touche bonus que l'on peut utiliser pour mapper certaines commandes -let mapleader = "," - -" Afficher arborescence -map :NERDTreeToggle:NERDTreeMirror -" Afficher la liste des fonctions -map :TlistToggle -" Switcher .h/.c -map :A -" Correction orthographique -map :setlocal spell! spelllang=fr -" Générer les blocs de commentaires Doxygen pour la ligne d'en dessous -map :Dox -" Exécuter PerlTidy sur l'actuel buffer -map :%!perltidy -i 2 -" Splitter horizontalement -map - :sp -" Splitter verticalement -map \| :vsp -" Aller à l'onglet suivant -nnoremap :tabprevious -" Aller à l'onglet précédent -nnoremap :tabnext -" Fermer l'onglet courant -nnoremap :tabclose -" Ouvrir un nouvel onglet -nnoremap :tabnew -" Exécuter CommandT (ouvrir un fichier rapidement en écrivant son nom) -noremap o :CommandT -" Commencer l'enregistrement en GIF de Vim -nnoremap s :ScreenRecord!: -" Arrêter l'enregistrement -nnoremap r :ScreenRecord: -" Save -nnoremap w :w -" Copy/Paste -vmap y "+y -vmap d "+d -nnoremap y "+yy -nnoremap p "+p -nnoremap P "+P -vnoremap p "+p -vnoremap P "+P -" Expand region -vmap v (expand_region_expand) -vmap (expand_region_shrink) - -" Action automatique pour les fichier de type C -autocmd FileType c call CodeC() -" Action automatique pour les fichier de type Perl -autocmd FileType perl call CodePerl() - -" Fonction à appeler pour initialiser Vim pour un script Perl -function CodePerl() - " Utiliser l'omnicompletion pour la tabulation - let g:SuperTabDefaultCompletionType = "" -endfunction - -" Fonction à appeler pour initialiser Vim pour un code C -function CodeC() - " Pour forcer ClangComplete à la tabulation - let g:SuperTabDefaultCompletionType = "" -endfunction - - -" Correction orthographique -setlocal spell spelllang=fr " Correcteur orthographique français -set nospell " Par défaut, pas de correction orthographique -autocmd BufEnter,BufNewFile,BufRead *.txt set spell " Activation pour les .txt -autocmd BufEnter,BufNewFile,BufRead *.txt let g:spellactive=1 " Ajustement pour la fonction d’activation/desactivation de la correction orthographique - -" UltiSnip - Lister les snippets disponible -let g:UltiSnipsListSnippets="" - -" Complétion -set pumheight=10 " Taille du menu d'autocomplétion -set completeopt=menu,longest -let g:clang_complete_auto=0 -let g:clang_snippets=1 " Utiliser un moteur de snippets pour les placeolders -let g:clang_snippets_engine='ultisnips' " Spécification du moteur de snippets que l'on utilise -let g:clang_auto_select=1 " Sélectionner la complétion vide par défaut - -" Vérification syntaxique (du code, pas du français :p ) -let g:syntastic_enable_signs=1 " Activer les signes dans la barre d'erreur à gauche -let g:syntastic_enable_perl_checker=1 " Réactiver l'analyse pour le Perl (désactivé car risque de sécurité sur les scripts Perl étrangers) -let g:syntastic_perl_checkers=['perl'] -let g:syntastic_check_on_open=1 " Analyser le fichier à l'ouverture -let g:syntastic_c_include_dirs = [ '../include', 'include', '../INC', 'INC', '../inc', 'inc' ] " Spécifications des dossier d'inclusion perso - -" Afficher la syntaxe et les couleurs pour les commentaires doxygen -let g:load_doxygen_syntax=1 -let g:doxygen_enhanced_colour=1 - -" Sauvegarder et restaurer les folds (fold = cacher le code entre accolades) -" Par défaut lorsque vous cachez un bloc de code, celui-ci n'est pas sauvegardé -autocmd BufWinLeave *.* mkview -autocmd BufWinEnter *.* silent loadview - -" Pour changer entre le .c/.h, on spécifie nos dossiers d'inclusions persos -let g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../SRC,sfr:../include,sfr:../inc,sfr:../INC' - -" Enregistrer les actions faites dans Vim dans une vidéo ou GIF -let g:replay_record=1 diff --git a/configurations/.zsh_functions b/configurations/.zsh_functions deleted file mode 100644 index 7968040..0000000 --- a/configurations/.zsh_functions +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/bash - -assignProxy(){ - PROXY_ENV=("http_proxy" "ftp_proxy" "https_proxy" "all_proxy" "no_proxy" "HTTP_PROXY" "HTTPS_PROXY" "FTP_PROXY" "NO_PROXY" "ALL_PROXY") - for envar in $PROXY_ENV - do - export $envar=$1 - done - - git config --global http.proxy "$1" -} - -proxyclear(){ - assignProxy "" # This is what 'unset' does. - echo "Proxy desactivé." -} - -proxyfac(){ - proxy_value="http://www-cache.ujf-grenoble.fr:3128" - assignProxy $proxy_value - echo "Proxy activé." -} - - -function cdfind() { - goto=$@; - IFS=' - ' - lall=( $(find . -iname "$goto*" -type d -readable 2>/dev/null) ) - - if [[ ${#lall[*]} == 0 ]]; then - echo "Aucune valeur trouvée"; - elif [[ ${#lall[*]} == 1 ]]; then - cd "${lall[0]}"; - else - for i in $(seq 1 $((${#lall[*]})) ); do - echo "[$i] - ${lall[$(( $i - 1 ))]}"; - done - read -p "#?" i - cd "${lall[ $(( $i - 1 )) ]}" - fi - IFS=' ' -} - -function up() { - LIMIT=$1 - P="$PWD" - for ((i=1; i <= LIMIT; i++));do - P=$P/.. - done - cd "$P" -} - - -function ssh_tmux() { - ssh -t "$1" tmux a || ssh -t "$1" tmux; -} - -function translate() { - if [[ "$1" = -r ]]; then - /usr/bin/translate fr en "$2" - else - /usr/bin/translate en fr "$1" - fi -} - -function rmcontainer() { - sudo docker ps -a | awk ' $1 != "CONTAINER" { print "sudo docker stop " $1 " && sudo docker rm " $1 }' | bash -} - -function vpn() { - sudo systemctl $1 openvpn@client -} diff --git a/configurations/.zshrc b/configurations/.zshrc deleted file mode 100644 index d49f63b..0000000 --- a/configurations/.zshrc +++ /dev/null @@ -1,85 +0,0 @@ -# Path to your oh-my-zsh installation. -export ZSH="$HOME/.oh-my-zsh" - -# Set name of the theme to load. -# Look in ~/.oh-my-zsh/themes/ -# Optionally, if you set this to "random", it'll load a random theme each -# time that oh-my-zsh is loaded. -# candy, pygmalion, smt -ZSH_THEME="candy" - -# Uncomment the following line to use case-sensitive completion. -CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. Case -# sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(copydir copyfile cp docker codeclimate encode64 extract fancy-ctrl-z git-flow git-remote-branch history nmap scw zsh_reload) - -# User configuration - -export PATH="/sbin:/usr/sbin:/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/android-sdk/platform-tools:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" -# export MANPATH="/usr/local/man:$MANPATH" - -source $ZSH/oh-my-zsh.sh - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -export EDITOR='vim' - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# ssh -# export SSH_KEY_PATH="~/.ssh/dsa_id" - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Example aliases -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" - -source ~/.zshrc_perso - -# added by travis gem -[ -f /home/florian/.travis/travis.sh ] && source /home/florian/.travis/travis.sh diff --git a/configurations/.zshrc_perso b/configurations/.zshrc_perso deleted file mode 100644 index ac57613..0000000 --- a/configurations/.zshrc_perso +++ /dev/null @@ -1,20 +0,0 @@ -unset SSH_ASKPASS # Dialog - -bindkey "^H" backward-delete-word # Ctrl + back - -export HISTSIZE=10000 -export SAVEHIST=10000 -export HISTFILE="$HOME/.history" -export XDG_CONFIG_HOME="$HOME/.config" -# export WORDCHARS='*?_-.[]~=/&;!#$%^(){}<>' -export WORDCHARS='' -export TERM=xterm-256color - -if [ -f ~/.zsh_functions ]; then - . ~/.zsh_functions -fi - -if [ -f ~/.zsh_aliases ]; then - . ~/.zsh_aliases -fi - diff --git a/unixconf.sh b/unixconf.sh index 90f5a17..db29075 100755 --- a/unixconf.sh +++ b/unixconf.sh @@ -1,6 +1,5 @@ #!/bin/sh -gitlink="https://gitlab.cpy.re/florian/unixconf/repository/archive.zip?ref=master" musthaves="zsh wget git vim unzip" if [ ! -z ${1+x} ] && [ "$1" == "skip-install" ]; then @@ -11,7 +10,7 @@ for musthave in $musthaves; do which "$musthave" >/dev/null 2>&1 if [ "$?" -ne 0 ]; then echo "You should install ${musthave}." - echo "On Ubuntu: apt-get install zsh wget git vim unzip" + echo "On Ubuntu: apt-get install zsh wget git vim-nox unzip" exit fi done @@ -20,3 +19,6 @@ done SHELL=zsh sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" echo "Setting ZSH as default." echo "exec zsh" >> "$HOME/.bash_profile" + +wget https://gitlab.cpy.re/florian/unixconf/raw/master/config/zshrc -O ~/.zshrc +wget https://gitlab.cpy.re/florian/unixconf/raw/master/config/vimrc -O ~/.vimrc