0

Is there a plugin that can display sloc? I have searched every where and all I get is how to display total lines or how to show line numbers...

  • 2
    What do you want to do with it? For example, if I have cloc installed I might just run :!cloc. Or i could do my own command :w !grep -v \# | wc -l, etc. Afaik no plugin exists simply because “sloc” is not always easy to define. – D. Ben Knoble Sep 8 '20 at 22:37
  • I was thinking about adding it to my status line, it would be easier with a plugin, but running :!cloc is enough too – user419050 Sep 9 '20 at 18:55
  • You can get the output of cloc using system/systemlist, which you can manipulate and put in the statusline. But be warned: running an external command directly in the statusline can slow down vim (it may get called on each statusline update!) – D. Ben Knoble Sep 9 '20 at 18:56
  • @D.BenKnoble I would attempt this, but I don't really know any vim script – user419050 Sep 10 '20 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.