fonctions.vim 395 B

1234567891011121314151617181920
  1. function! FileSize()
  2. let bytes = getfsize(expand('%:p'))
  3. if bytes <= 0
  4. return ''
  5. endif
  6. if bytes < 1024
  7. return bytes
  8. else
  9. return (bytes / 1024) . 'k'
  10. endif
  11. endfunction
  12. function! HunkSummary()
  13. if !get(g:, 'gitgutter_enabled', 0)
  14. return ''
  15. endif
  16. let l:summary = GitGutterGetHunkSummary()
  17. return '+'.l:summary[0].' ~'.l:summary[1].' -'.l:summary[2]
  18. endfunction