[vim] Amélioration fonction fold

master
Julien Rosset 12 years ago
parent f4a7576526
commit a77ead8fd4

@ -1 +1 @@
Subproject commit 929d57fd1ec18fb68d0fa5d7b4ad9073cc0802a3
Subproject commit d4161cdc685c22d2f419ccf3814b2406ddeb4b0a

@ -1 +1 @@
Subproject commit c035ac24269b999a4caebb5bb7b318ee96614129
Subproject commit 2c1c0d0eeb7d36d8cbea22bd63144a104846047a

@ -1 +1 @@
Subproject commit fd79a1718902f3eee78a40547d9a792b0e54927f
Subproject commit b60d08c468337f65bad2f1a041779b05e64d6bf8

@ -1 +1 @@
Subproject commit 592cc412cfe7df63120b0b8afc9dd205f37ae681
Subproject commit 3c9f8bb979a0bc451811c33a73c26df3ca3ea58e

@ -17,6 +17,7 @@ set noexpandtab " Utilise le caractère tabulation, pas des espaces
set nostartofline " Conserve le caractère sur la même colonne quand on change de ligne
set autoindent " Indentation automatique
set smartindent " Idem
set paste " Pas d'insertion d'indentation lors du copier-coller
set showcmd " Montre la commande en cours
set ignorecase " Pas de casse pour les recherches
@ -165,11 +166,14 @@ set statusline=%f%m%r%h%w\ \ \ \ \ [%{&fileencoding}]\ \ \ \ [%{&fileformat}]\ \
"=====================================================================
function! MyFoldFunction()
let line = getline(v:foldstart)
"Cleanup unwanted things in first line
let sub = substitute(line, '/\*\|\*/\|^\s+', '', 'g')
let sub_space = substitute(line, '/\*\|\*/\|{', '', 'g')
let sub = substitute(sub_space, '\(^\s*\)\@<=\s', '-', 'g')
"Calculate lines in folded text
let lines = v:foldend - v:foldstart + 1
return v:folddashes.sub.' {...'.lines.' lignes...}'
return sub.' {...'.lines.' lignes...}'
endfunction
set foldtext=MyFoldFunction()

Loading…
Cancel
Save