{"action":"created","issue":{"url":"https://api.github.com/repos/Kuniwak/vint/issues/126","labels_url":"https://api.github.com/repos/Kuniwak/vint/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/Kuniwak/vint/issues/126/comments","events_url":"https://api.github.com/repos/Kuniwak/vint/issues/126/events","html_url":"https://github.com/Kuniwak/vint/issues/126","id":68244626,"number":126,"title":"Feature request: warn about missing `autocmd!` from `augroup`","user":{"login":"lencioni","id":195534,"avatar_url":"https://avatars.githubusercontent.com/u/195534?v=3","gravatar_id":"","url":"https://api.github.com/users/lencioni","html_url":"https://github.com/lencioni","followers_url":"https://api.github.com/users/lencioni/followers","following_url":"https://api.github.com/users/lencioni/following{/other_user}","gists_url":"https://api.github.com/users/lencioni/gists{/gist_id}","starred_url":"https://api.github.com/users/lencioni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lencioni/subscriptions","organizations_url":"https://api.github.com/users/lencioni/orgs","repos_url":"https://api.github.com/users/lencioni/repos","events_url":"https://api.github.com/users/lencioni/events{/privacy}","received_events_url":"https://api.github.com/users/lencioni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Kuniwak/vint/labels/feature","name":"feature","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-14T02:45:42Z","updated_at":"2015-04-17T03:10:02Z","closed_at":null,"body":"Usually when defining an `augroup`, you want to include `autocmd!` at the top to clear any old autocommands before defining new ones. More info: http://learnvimscriptthehardway.stevelosh.com/chapters/14.html\r\n\r\nIt might be nice for vint to warn about `augroup`s that are missing an `autocmd!` at the top. What do you think?"},"comment":{"url":"https://api.github.com/repos/Kuniwak/vint/issues/comments/93884125","html_url":"https://github.com/Kuniwak/vint/issues/126#issuecomment-93884125","issue_url":"https://api.github.com/repos/Kuniwak/vint/issues/126","id":93884125,"user":{"login":"Kuniwak","id":1124024,"avatar_url":"https://avatars.githubusercontent.com/u/1124024?v=3","gravatar_id":"","url":"https://api.github.com/users/Kuniwak","html_url":"https://github.com/Kuniwak","followers_url":"https://api.github.com/users/Kuniwak/followers","following_url":"https://api.github.com/users/Kuniwak/following{/other_user}","gists_url":"https://api.github.com/users/Kuniwak/gists{/gist_id}","starred_url":"https://api.github.com/users/Kuniwak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kuniwak/subscriptions","organizations_url":"https://api.github.com/users/Kuniwak/orgs","repos_url":"https://api.github.com/users/Kuniwak/repos","events_url":"https://api.github.com/users/Kuniwak/events{/privacy}","received_events_url":"https://api.github.com/users/Kuniwak/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T03:10:02Z","updated_at":"2015-04-17T03:10:02Z","body":"Sound good.\r\n\r\nHow about these examples?\r\n\r\n#### Examples\r\n\r\nGood:\r\n\r\n```viml\r\naugroup Foo\r\n  autocmd!\r\n  autocmd BufNewFile * put ='Nyan'\r\naugroup END\r\n```\r\n\r\n```viml\r\naugroup Foo\r\n  autocmd! BufNewFile * put ='Nyan'\r\n  \" :au[tocmd]! [group] {event} {pat} [nested] {cmd} should be allowed,\r\n  \" because this command is a short-hand equivalent to the first case.\r\naugroup END\r\n```\r\n\r\n```viml\r\naugroup Foo\r\n  \" Comment node placed before autocmd! should be allowed.\r\n  autocmd!\r\n  autocmd BufNewFile * put ='Nyan'\r\naugroup END\r\n```\r\n\r\nBad:\r\n\r\n```viml\r\naugroup Foo\r\n  autocmd BufNewFile * put ='Nyan'\r\n  \" autocmd! not found.\r\naugroup END\r\n```\r\n\r\n```viml\r\naugroup Foo\r\n  autocmd! BufNewFile *\r\n  \" Partial removing should not be allowed.\r\naugroup END\r\n```\r\n\r\n```viml\r\nautocmd! Foo\r\naugroup Foo\r\n  autocmd BufNewFile * put ='Nyan'\r\naugroup END\r\n\" It should not allowed because there are many similar cases.\r\n\" I want to keep allowed notations lean.\r\n```\r\n\r\n```viml\r\naugroup Foo\r\n  autocmd! Foo\r\n  autocmd BufNewFile * put ='Nyan'\r\naugroup END\r\n\" Same reason.\r\n```\r\n\r\n#### Limitation\r\nWe cannot check the case:\r\n\r\n- https://github.com/google/vim-maktaba/blob/a5f242b8566e15db97aed04df3beb42557900679/autoload/maktaba/autocmd.vim"}}