{"action":"created","issue":{"url":"https://api.github.com/repos/kassio/neoterm/issues/39","labels_url":"https://api.github.com/repos/kassio/neoterm/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/kassio/neoterm/issues/39/comments","events_url":"https://api.github.com/repos/kassio/neoterm/issues/39/events","html_url":"https://github.com/kassio/neoterm/issues/39","id":103728475,"number":39,"title":"Expanding arguments to :T","user":{"login":"icholy","id":943597,"avatar_url":"https://avatars.githubusercontent.com/u/943597?v=3","gravatar_id":"","url":"https://api.github.com/users/icholy","html_url":"https://github.com/icholy","followers_url":"https://api.github.com/users/icholy/followers","following_url":"https://api.github.com/users/icholy/following{/other_user}","gists_url":"https://api.github.com/users/icholy/gists{/gist_id}","starred_url":"https://api.github.com/users/icholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icholy/subscriptions","organizations_url":"https://api.github.com/users/icholy/orgs","repos_url":"https://api.github.com/users/icholy/repos","events_url":"https://api.github.com/users/icholy/events{/privacy}","received_events_url":"https://api.github.com/users/icholy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-28T14:29:45Z","updated_at":"2015-08-28T14:49:55Z","closed_at":null,"body":"I'm trying to cd to the current directory, but the path is not expanding correctly.\r\n\r\n``` vim\r\n:T cd %:h:p\r\n:T cd expand('%:h:p')\r\n```\r\nI've tried messing around with [neoterm#expand_cmd](https://github.com/kassio/neoterm/blob/cf3778d19fe6115932bf5ab27e31cc13960484c8/autoload/neoterm.vim#L78) but my VimScript chops aren't that good.\r\n\r\n**Edit:** I added a special case to expand it\r\n\r\n``` vim\r\n\" Internal: Expands \"%\" in commands to current file full path.\r\nfunction! neoterm#expand_cmd(command)\r\n  let command = substitute(a:command, '%:p:h', expand('%:p:h'), 'g')\r\n  return substitute(command, '%', expand('%:p'), 'g')\r\nendfunction\r\n```\r\n\r\nI'm thinking there must be a cleaner way to do this."},"comment":{"url":"https://api.github.com/repos/kassio/neoterm/issues/comments/135795767","html_url":"https://github.com/kassio/neoterm/issues/39#issuecomment-135795767","issue_url":"https://api.github.com/repos/kassio/neoterm/issues/39","id":135795767,"user":{"login":"kassio","id":120483,"avatar_url":"https://avatars.githubusercontent.com/u/120483?v=3","gravatar_id":"","url":"https://api.github.com/users/kassio","html_url":"https://github.com/kassio","followers_url":"https://api.github.com/users/kassio/followers","following_url":"https://api.github.com/users/kassio/following{/other_user}","gists_url":"https://api.github.com/users/kassio/gists{/gist_id}","starred_url":"https://api.github.com/users/kassio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kassio/subscriptions","organizations_url":"https://api.github.com/users/kassio/orgs","repos_url":"https://api.github.com/users/kassio/repos","events_url":"https://api.github.com/users/kassio/events{/privacy}","received_events_url":"https://api.github.com/users/kassio/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T14:49:55Z","updated_at":"2015-08-28T14:49:55Z","body":"You can use an exec: `:exec \"T cd \".expand('%:h:p')`."}}