Skip to content

Instantly share code, notes, and snippets.

@exaland
Created July 20, 2025 12:48
Show Gist options
  • Select an option

  • Save exaland/20c64f843ed35474a51b368d897554d0 to your computer and use it in GitHub Desktop.

Select an option

Save exaland/20c64f843ed35474a51b368d897554d0 to your computer and use it in GitHub Desktop.
Install VIM avec Theme Gruvbox
#!/bin/bash
# Vérifier si vim est installé, sinon l'installer
if ! command -v vim &> /dev/null; then
echo "Vim n'est pas installé. Installation..."
sudo apt update
sudo apt install -y vim
else
echo "Vim est déjà installé."
fi
# Installer git si pas déjà installé (pour cloner ou télécharger des plugins)
if ! command -v git &> /dev/null; then
echo "Git n'est pas installé. Installation..."
sudo apt install -y git
fi
# Créer le répertoire pour la configuration si nécessaire
mkdir -p ~/.vim/autoload ~/.vim/bundle ~/.vim/plugged
# Installer vim-plug (gestionnaire de plugins)
if [ ! -f ~/.vim/autoload/plug.vim ]; then
echo "Installation de vim-plug..."
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
else
echo "vim-plug est déjà installé."
fi
# Créer ou modifier le fichier de configuration vimrc
cat <<EOL > ~/.vimrc
" Configuration de base
call plug#begin('~/.vim/plugged')
" Thème Gruvbox (joli et populaire)
Plug 'morhetz/gruvbox'
" NERDTree pour la navigation dans les fichiers
Plug 'preservim/nerdtree'
" FZF pour la recherche rapide
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Autocompletion avancée avec coc.nvim
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
" Activer le thème Gruvbox
colorscheme gruvbox
set background=dark
" Activer NERDTree à l'ouverture
autocmd vimentoread * NERDTree
" Configuration supplémentaire pour coc.nvim
" (Peut être personnalisé selon ton besoin)
EOL
# Installer les plugins dans vim
vim +PlugInstall +qall
echo "Installation terminée. Ouvre vim pour commencer à coder!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment