{"action":"created","issue":{"url":"https://api.github.com/repos/SirVer/ultisnips/issues/428","labels_url":"https://api.github.com/repos/SirVer/ultisnips/issues/428/labels{/name}","comments_url":"https://api.github.com/repos/SirVer/ultisnips/issues/428/comments","events_url":"https://api.github.com/repos/SirVer/ultisnips/issues/428/events","html_url":"https://github.com/SirVer/ultisnips/issues/428","id":55122115,"number":428,"title":"Custom auto-complete with UltiSnips in vim","user":{"login":"byakugan","id":9567745,"avatar_url":"https://avatars.githubusercontent.com/u/9567745?v=3","gravatar_id":"","url":"https://api.github.com/users/byakugan","html_url":"https://github.com/byakugan","followers_url":"https://api.github.com/users/byakugan/followers","following_url":"https://api.github.com/users/byakugan/following{/other_user}","gists_url":"https://api.github.com/users/byakugan/gists{/gist_id}","starred_url":"https://api.github.com/users/byakugan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/byakugan/subscriptions","organizations_url":"https://api.github.com/users/byakugan/orgs","repos_url":"https://api.github.com/users/byakugan/repos","events_url":"https://api.github.com/users/byakugan/events{/privacy}","received_events_url":"https://api.github.com/users/byakugan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-22T07:19:18Z","updated_at":"2015-01-22T07:29:48Z","closed_at":"2015-01-22T07:29:48Z","body":"\r\n\r\nI would like to create snippets that do a custom completion at each tab stop using Vim's complete() function. Here's a simple example of what i want to achieve.\r\n\r\n```vim\r\nsnippet date \"Date snippet\"\r\n   day of month: ${1:`!v complete(col('.'), [1, 2, 3, 4])`}\r\n   month: ${2:`!v complete(col('.'), ['Jan', 'Feb', 'March'])`}\r\n   year: ${3:`!v complete(col('.'), ['2012', '2013', '2014', '2015'])`}\r\nendsnippet\r\n```\r\nAt the first tab stop i want to see Vim's auto-complete menu with [1, 2, 3, 4] items. Similarly for other tab stops. But, when i actually run this snippet I get the following output\r\n```\r\nday of month: Jan0an0\r\nmonth: 201200120\r\nyear:100\r\n```\r\nThere might be other ways to achieve auto-complete as shown in screen cast Episode 4: Python Interpolation. But, I would love to see Vim's auto-complete inside UltiSnips.\r\n\r\nPlease anyone suggest on how to achieve this. I posted in statckoverflow but i did not receive any response for this http://stackoverflow.com/questions/27962109/custom-auto-complete-with-ultisnips-in-vim\r\n"},"comment":{"url":"https://api.github.com/repos/SirVer/ultisnips/issues/comments/70981500","html_url":"https://github.com/SirVer/ultisnips/issues/428#issuecomment-70981500","issue_url":"https://api.github.com/repos/SirVer/ultisnips/issues/428","id":70981500,"user":{"login":"SirVer","id":140115,"avatar_url":"https://avatars.githubusercontent.com/u/140115?v=3","gravatar_id":"","url":"https://api.github.com/users/SirVer","html_url":"https://github.com/SirVer","followers_url":"https://api.github.com/users/SirVer/followers","following_url":"https://api.github.com/users/SirVer/following{/other_user}","gists_url":"https://api.github.com/users/SirVer/gists{/gist_id}","starred_url":"https://api.github.com/users/SirVer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirVer/subscriptions","organizations_url":"https://api.github.com/users/SirVer/orgs","repos_url":"https://api.github.com/users/SirVer/repos","events_url":"https://api.github.com/users/SirVer/events{/privacy}","received_events_url":"https://api.github.com/users/SirVer/received_events","type":"User","site_admin":false},"created_at":"2015-01-22T07:29:48Z","updated_at":"2015-01-22T07:29:48Z","body":"Sorry, can't happen. The problem is that Vim is not open for extension in the way UltiSnips needs it - so UltiSnips is quite the hack (for example at each key movement we take a partial diff of the buffer before and after the movement to guess the edit action, since Vim does not provide it to us). That also means that it is not stable against any sort of interruption - like running other vim script during evaluation. This is precisely what you want to do here. \r\n\r\nI wish I had better news, but before neovim - which solves all of these issues - this cannot happen unfortunately :(."}}