{"action":"created","issue":{"url":"https://api.github.com/repos/SirVer/ultisnips/issues/680","repository_url":"https://api.github.com/repos/SirVer/ultisnips","labels_url":"https://api.github.com/repos/SirVer/ultisnips/issues/680/labels{/name}","comments_url":"https://api.github.com/repos/SirVer/ultisnips/issues/680/comments","events_url":"https://api.github.com/repos/SirVer/ultisnips/issues/680/events","html_url":"https://github.com/SirVer/ultisnips/issues/680","id":144625108,"number":680,"title":"Visual and non visual snippet","user":{"login":"netei","id":13066384,"avatar_url":"https://avatars.githubusercontent.com/u/13066384?v=3","gravatar_id":"","url":"https://api.github.com/users/netei","html_url":"https://github.com/netei","followers_url":"https://api.github.com/users/netei/followers","following_url":"https://api.github.com/users/netei/following{/other_user}","gists_url":"https://api.github.com/users/netei/gists{/gist_id}","starred_url":"https://api.github.com/users/netei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netei/subscriptions","organizations_url":"https://api.github.com/users/netei/orgs","repos_url":"https://api.github.com/users/netei/repos","events_url":"https://api.github.com/users/netei/events{/privacy}","received_events_url":"https://api.github.com/users/netei/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SirVer/ultisnips/labels/pending%20feedback","name":"pending feedback","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-30T15:16:10Z","updated_at":"2016-04-01T07:04:42Z","closed_at":null,"body":"I'd like to be able to have two snippets with the same name, one for VISUAL, the other for INSERT mode\r\n\r\n```\r\nsnippet cl\r\nconsole.log(${1:$VISUAL});\r\nendsnippet\r\n```\r\n\r\nINSERT MODE `cl<Tab>` would write console.log(<cursor>);\r\nand with the text `user` \r\n\r\nNORMAL MODE `ve<Tab>cl<Tab>` would write  `console.log(user);`\r\n\r\nIs this already possible somehow ?\r\n\r\nIt would maybe make sense to say that VISUAL=$1 when you trigger the snippet without visual mode for all snippets.\r\n\r\nWhat do you think ?"},"comment":{"url":"https://api.github.com/repos/SirVer/ultisnips/issues/comments/204277635","html_url":"https://github.com/SirVer/ultisnips/issues/680#issuecomment-204277635","issue_url":"https://api.github.com/repos/SirVer/ultisnips/issues/680","id":204277635,"user":{"login":"netei","id":13066384,"avatar_url":"https://avatars.githubusercontent.com/u/13066384?v=3","gravatar_id":"","url":"https://api.github.com/users/netei","html_url":"https://github.com/netei","followers_url":"https://api.github.com/users/netei/followers","following_url":"https://api.github.com/users/netei/following{/other_user}","gists_url":"https://api.github.com/users/netei/gists{/gist_id}","starred_url":"https://api.github.com/users/netei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netei/subscriptions","organizations_url":"https://api.github.com/users/netei/orgs","repos_url":"https://api.github.com/users/netei/repos","events_url":"https://api.github.com/users/netei/events{/privacy}","received_events_url":"https://api.github.com/users/netei/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T07:04:42Z","updated_at":"2016-04-01T07:04:42Z","body":"I also think one of the following two behaviours would make sense : \r\n\r\n1. If `${VISUAL}` is not is a snippet, then, when triggered visually, replace ${1} by ${1:${VISUAL}}\r\n2. If `${VISUAL}` is not in a snippet, then, it shouldn't be possible to trigger it visually.\r\n"}}