Explorar el Código

improved vim foldtext by removing code. Now just indent/line count.

cinaeco hace 15 años
padre
commit
f228efc077
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      vim/vimrc

+ 3 - 1
vim/vimrc

@@ -53,12 +53,14 @@ set foldtext=MyFoldText()
 
 function! MyFoldText()
     let line = getline(v:foldstart)
+    let indent = indent(v:foldstart)
+    let indentOnly = strpart(line, 0, indent-1)
     let linecount = v:foldend+1 - v:foldstart
     let plural = ""
     if linecount != 1
         let plural = "s"
     endif
-    let foldtext = '+'.line.'... ('.linecount.' More lines)'
+    let foldtext = '+'.indentOnly.'... ('.linecount.' More lines)'
     return foldtext
 endfunction