{"action":"created","issue":{"url":"https://api.github.com/repos/lervag/vimtex/issues/166","labels_url":"https://api.github.com/repos/lervag/vimtex/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/lervag/vimtex/issues/166/comments","events_url":"https://api.github.com/repos/lervag/vimtex/issues/166/events","html_url":"https://github.com/lervag/vimtex/issues/166","id":74204864,"number":166,"title":"Feature Request: support word count","user":{"login":"xu-cheng","id":3105373,"avatar_url":"https://avatars.githubusercontent.com/u/3105373?v=3","gravatar_id":"","url":"https://api.github.com/users/xu-cheng","html_url":"https://github.com/xu-cheng","followers_url":"https://api.github.com/users/xu-cheng/followers","following_url":"https://api.github.com/users/xu-cheng/following{/other_user}","gists_url":"https://api.github.com/users/xu-cheng/gists{/gist_id}","starred_url":"https://api.github.com/users/xu-cheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xu-cheng/subscriptions","organizations_url":"https://api.github.com/users/xu-cheng/orgs","repos_url":"https://api.github.com/users/xu-cheng/repos","events_url":"https://api.github.com/users/xu-cheng/events{/privacy}","received_events_url":"https://api.github.com/users/xu-cheng/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-05-08T02:48:32Z","updated_at":"2015-05-16T20:17:08Z","closed_at":"2015-05-16T20:14:58Z","body":"It would be great for vimtex to support word count. This is a quick implementation in below but you probably would come out a better one.\r\n\r\n```vim\r\n\" TeX Word Count\r\nfunction! TeXWordCount()\r\n    let l:data = g:vimtex#data[b:vimtex.id]\r\n    let l:main_tex_dir = l:data.root\r\n    let l:main_tex_file = l:data.base\r\n    :echo system('cd \"' . l:main_tex_dir . '\"; texcount \"' . l:main_tex_file . '\"')\r\nendfunction\r\nnmap <localleader>lw :call TeXWordCount()<cr>\r\n```\r\n\r\nThanks for this excellent vim plugin. "},"comment":{"url":"https://api.github.com/repos/lervag/vimtex/issues/comments/102679147","html_url":"https://github.com/lervag/vimtex/issues/166#issuecomment-102679147","issue_url":"https://api.github.com/repos/lervag/vimtex/issues/166","id":102679147,"user":{"login":"lervag","id":998898,"avatar_url":"https://avatars.githubusercontent.com/u/998898?v=3","gravatar_id":"","url":"https://api.github.com/users/lervag","html_url":"https://github.com/lervag","followers_url":"https://api.github.com/users/lervag/followers","following_url":"https://api.github.com/users/lervag/following{/other_user}","gists_url":"https://api.github.com/users/lervag/gists{/gist_id}","starred_url":"https://api.github.com/users/lervag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lervag/subscriptions","organizations_url":"https://api.github.com/users/lervag/orgs","repos_url":"https://api.github.com/users/lervag/repos","events_url":"https://api.github.com/users/lervag/events{/privacy}","received_events_url":"https://api.github.com/users/lervag/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T20:17:08Z","updated_at":"2015-05-16T20:17:08Z","body":"The last update should provide a good version of the command. Note that I added `VimtexWordCount!` which will display a count for each project file. I've put the count result in its own buffer, which makes it easy to inspect the result. Also, one may close the buffer with `q`.\r\n\r\nNote that I've removed the count from the result of `VimtexInfo`.\r\n\r\nI've closed the issue, but feel free to comment. Suggestions for improvements are of course welcome."}}