Browse Source

vimrc, plugins, et script d'update

Plugins :
* pathogen.vim
* NERD Tree
* NERD Commenter
* supertab
* numbertoggle
* fugitive.vim
* vim-gitgutter
* surround.vim
* matchit
* Node.vim
* vim-jade
* mustang (modifié)
Thibaut Marty 9 years ago
commit
b2c49f0bed

+ 2 - 0
.gitignore

@@ -0,0 +1,2 @@
+.netrwhist
+backups

+ 36 - 0
.gitmodules

@@ -0,0 +1,36 @@
+[submodule "pathogen"]
+	path = pathogen
+	url = https://github.com/tpope/vim-pathogen
+[submodule "bundle/vim-jade"]
+	path = bundle/vim-jade
+	url = https://github.com/digitaltoad/vim-jade
+[submodule "bundle/nerdtree"]
+	path = bundle/nerdtree
+	url = https://github.com/scrooloose/nerdtree
+[submodule "bundle/vim-fugitive"]
+	path = bundle/vim-fugitive
+	url = https://github.com/tpope/vim-fugitive
+[submodule "bundle/supertab"]
+	path = bundle/supertab
+	url = http://github.com/ervandew/supertab
+[submodule "bundle/vim-node"]
+	path = bundle/vim-node
+	url = https://github.com/moll/vim-node
+[submodule "bundle/vim-numbertoggle"]
+	path = bundle/vim-numbertoggle
+	url = https://github.com/jeffkreeftmeijer/vim-numbertoggle
+[submodule "bundle/nerdcommenter"]
+	path = bundle/nerdcommenter
+	url = https://github.com/scrooloose/nerdcommenter
+[submodule "bundle/vim-gitgutter"]
+	path = bundle/vim-gitgutter
+	url = https://github.com/airblade/vim-gitgutter
+[submodule "bundle/vim-surround"]
+	path = bundle/vim-surround
+	url = https://github.com/tpope/vim-surround
+[submodule "bundle/matchit"]
+	path = bundle/matchit
+	url = https://github.com/tmhedberg/matchit
+[submodule "bundle/mustang-vim"]
+	path = bundle/mustang-vim
+	url = https://github.com/croaker/mustang-vim

+ 32 - 0
README.md

@@ -0,0 +1,32 @@
+# Non-ultimate vimrc
+
+Vim est hautement configurable. Parce qu'il n'existe pas de vimrc ultime, voici le mien.
+
+## Installation
+
+```bash
+cd ~
+git clone --recursive https://github.com/ThibautMarty/non-ultimate-vimrc
+ln -s non-ultimate-vimrc .vim
+```
+
+## Mise à jour
+
+```bash
+~/non-ultimate-vimrc/update
+```
+
+## Liste des plugins
+
+* [pathogen.vim](https://github.com/tpope/vim-pathogen)
+* [NERD Tree](https://github.com/scrooloose/nerdtree)
+* [NERD Commenter](https://github.com/scrooloose/nerdcommenter)
+* [supertab](http://github.com/ervandew/supertab)
+* [numbertoggle](https://github.com/jeffkreeftmeijer/vim-numbertoggle)
+* [fugitive.vim](https://github.com/tpope/vim-fugitive)
+* [vim-gitgutter](https://github.com/airblade/vim-gitgutter)
+* [surround.vim](https://github.com/tpope/vim-surround)
+* [matchit](https://github.com/tmhedberg/matchit)
+* [Node.vim](https://github.com/moll/vim-node)
+* [vim-jade](https://github.com/digitaltoad/vim-jade)
+* [mustang (modifié)](https://github.com/croaker/mustang-vim)

+ 1 - 0
autoload/pathogen.vim

@@ -0,0 +1 @@
+../pathogen/autoload/pathogen.vim

+ 1 - 0
bundle/matchit

@@ -0,0 +1 @@
+Subproject commit 060d9d8aa381d6a650b649d38c992b59db3ed1a3

+ 1 - 0
bundle/mustang-vim

@@ -0,0 +1 @@
+Subproject commit 6533d7d21bf27cae94d9c2caa575f627f003dfd5

+ 1 - 0
bundle/nerdcommenter

@@ -0,0 +1 @@
+Subproject commit 0b3d928dce8262dedfc2f83b9aeb59a94e4f0ae4

+ 1 - 0
bundle/nerdtree

@@ -0,0 +1 @@
+Subproject commit b0bb781fc73ef40365e4c996a16f04368d64fc9d

+ 1 - 0
bundle/supertab

@@ -0,0 +1 @@
+Subproject commit 940885c872b6c2889604271dd613651d264f1c70

+ 1 - 0
bundle/vim-fugitive

@@ -0,0 +1 @@
+Subproject commit c4713200f76550f3f310fe7e176925d3f4ec1809

+ 1 - 0
bundle/vim-gitgutter

@@ -0,0 +1 @@
+Subproject commit 64ad9e46a5d3ac8f00273ffaee9baaca8032807d

+ 1 - 0
bundle/vim-jade

@@ -0,0 +1 @@
+Subproject commit 7791b60f520a025300fee6dbbecf8da27bacb9f7

+ 1 - 0
bundle/vim-node

@@ -0,0 +1 @@
+Subproject commit 07a5e9f914dda778cdcefde3274d0f2ee5a75961

+ 1 - 0
bundle/vim-numbertoggle

@@ -0,0 +1 @@
+Subproject commit 51c9731a9727fc0efa755ff33ada2b140dc5b391

+ 1 - 0
bundle/vim-surround

@@ -0,0 +1 @@
+Subproject commit f85cb4e788356f664d033e8519abdd8e1bc26762

+ 20 - 0
fonctions.vim

@@ -0,0 +1,20 @@
+function! FileSize()
+  let bytes = getfsize(expand('%:p'))
+  if bytes <= 0
+    return ''
+  endif
+  if bytes < 1024
+    return bytes
+  else
+    return (bytes / 1024) . 'k'
+  endif
+endfunction
+
+
+function! HunkSummary()
+  if !get(g:, 'gitgutter_enabled', 0)
+    return ''
+  endif
+  let l:summary = GitGutterGetHunkSummary()
+  return '+'.l:summary[0].' ~'.l:summary[1].' -'.l:summary[2]
+endfunction

+ 4 - 0
ftplugin/make.vim

@@ -0,0 +1,4 @@
+"# Utilise des vraies tabulations
+setlocal noexpandtab
+"# Affiche les tabulations comme des espaces
+setlocal listchars+=tab:\ \ 

+ 1 - 0
pathogen

@@ -0,0 +1 @@
+Subproject commit ed01fca95c271ab83e14b041aded328a9f9574a7

BIN
spell/en.utf-8.spl


BIN
spell/en.utf-8.sug


BIN
spell/fr.utf-8.spl


BIN
spell/fr.utf-8.sug


+ 4 - 0
update

@@ -0,0 +1,4 @@
+#!/bin/bash
+
+git pull
+git submodule foreach git pull

+ 133 - 0
vimrc

@@ -0,0 +1,133 @@
+"# Encodage général
+set encoding=utf-8
+
+"# Chargement de pathogen
+call pathogen#infect()
+call pathogen#helptags()
+
+source ~/.vim/fonctions.vim
+
+"# Change le <leader> en , à la place de \
+let mapleader=","
+
+
+"# Indentation
+set autoindent
+" Intelligente ({}, commentaires...)
+set smartindent
+" Remplace les tabulations par des espaces
+set expandtab
+" <BS> supprime un niveau d'indentation
+set smarttab
+" Affiche 2 espaces pour les tabulations
+set tabstop=2
+" Indentation de 2 espaces
+set shiftwidth=2
+" Arrondi à un niveau d'indentation
+set shiftround
+
+"# Début de ligne au premier caractère non blanc
+map 0 ^
+
+"# Numérotation
+set number
+
+"# Affichage de caractères spéciaux
+set list
+set listchars=nbsp:¬,tab:»·,trail:·
+
+
+"# Statusline
+" Informations git (branche +-~) :
+set statusline+=%{strlen(fugitive#statusline())?'\ \ ('.fugitive#statusline()[5:-3].'\ '.HunkSummary().')\ ':''}
+" Nom du fichier
+set statusline+=%f%<
+" Encodage du fichier
+set statusline+=\ %{strlen(&fenc)?'<'.&fenc.'>':'<aucun>'}
+" Taille du fichier
+set statusline+=\ %{FileSize()}
+" Drapeau modifié, read-only
+set statusline+=\ %m\ %r
+" Séparateur gauche droite
+set statusline+=%=
+" <ligne courante>/<total>:<colonne> | <pourcents>
+set statusline+=%l/%L:%v\ \|\ %4P\ 
+" L'affiche toujours
+set laststatus=2
+
+"# Pas de sonneries
+set noerrorbells
+set novisualbell
+
+"# Limites haute et basse du curseur
+set scrolloff=12
+
+"# Limites gauche et droite du curseur
+"set nowrap
+"set sidescrolloff=15
+"set sidescroll=1
+
+" Revient à la même position à la réouverture d'un fichier
+autocmd BufReadPost *
+  \ if line("'\"") > 0 && line("'\"") <= line("$") |
+  \   exe "normal! g`\"" |
+  \ endif
+
+
+"# Recherche
+" Va au résultat directement
+set incsearch
+set smartcase
+" Surligne les résultats
+set hlsearch
+" et pour l'enlever : ,/
+nnoremap <Leader><Space> :nohlsearch<CR>
+
+
+"# Désactive les fichiers swap
+set noswapfile
+set nobackup
+set nowritebackup
+
+
+"# Undo persistant
+if has("persistent_undo")
+  " Crée le dossier s'il le faut
+  silent !mkdir ~/.vim/backups > /dev/null 2>&1
+  set undodir=~/.vim/backups
+  set undofile
+endif
+
+"# Clipboard mélangé avec celui de X
+if has("xterm_clipboard")
+  set clipboard=unnamedplus
+endif
+
+
+"# Commande w!! pour enregistrer avec sudo
+"cmap w!! %!sudo tee > /dev/null %
+cabbrev w!! %!sudo tee > /dev/null %
+
+"# Correction (à activer avec set spell)
+set spelllang=en,fr
+set spellsuggest=5
+
+"# Pas de repliement
+set nofoldenable
+
+"# Désactive l'accès au mode Ex
+map Q <Nop>
+
+"# Active l'indentation et les plugins spécifiques
+filetype indent on
+filetype plugin on
+
+
+"# Thème
+try
+  colorscheme mustang
+catch
+endtry
+
+"# Couleur pour GitGutter
+highlight SignColumn ctermbg=232