TEXT 27
Vimrc path.txt Guest on 26th April 2021 05:35:03 AM
  1.  
  2. "begin folding commands for reverse indent outlining  April-May 2008 TW
  3. :imap <D-;> <C-o>zc
  4. :map <D-;> zc<CR>  
  5. "zt makes a fold down to the next equal or greater indent
  6. :map zt 0y/<C-i>*/<CR>:let @a = "zf/^" . @0 . "/"<CR>@a<CR>
  7. :map zt2 zf/^           /<cr>
  8. :map zt3 zf/^                 /<cr>
  9. :map zt4 zf/^                       /<cr>
  10. :map zt5 zf/^                             /<cr>
  11. :map zt6 zf/^                                   /<cr>
  12.  
  13. :set foldtext=substitute(getline(v:foldstart),'\      ','\ \ \ \ \ \ \ \ ','g')
  14. " :TWz folds up a file formatted with reverse indent outlining
  15. " it adds a line with 7 tabs at the end unless one is present already.
  16. :command TWz :call TWzfunc()
  17. :function s:appendtabs()
  18. :   $append
  19.                                          
  20. .
  21. :endfunction
  22. function TWzfunc()
  23. :   normal zE
  24. :  $g!/^                                        / call s:appendtabs()
  25. :    g/^          [^    ]/normal zt2
  26. :    g/^                [^    ]/normal zt3
  27. :    g/^                      [^    ]/normal zt4
  28. :    g/^                            [^    ]/normal  zt5
  29. :    g/^                                  [^    ]/normal zt6
  30. :endfunction

Paste-bin is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.