{"action":"created","issue":{"url":"https://api.github.com/repos/guns/vim-sexp/issues/10","labels_url":"https://api.github.com/repos/guns/vim-sexp/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/guns/vim-sexp/issues/10/comments","events_url":"https://api.github.com/repos/guns/vim-sexp/issues/10/events","html_url":"https://github.com/guns/vim-sexp/issues/10","id":66281752,"number":10,"title":"Capturing elements like emacs slurp","user":{"login":"snoe","id":105012,"avatar_url":"https://avatars.githubusercontent.com/u/105012?v=3","gravatar_id":"","url":"https://api.github.com/users/snoe","html_url":"https://github.com/snoe","followers_url":"https://api.github.com/users/snoe/followers","following_url":"https://api.github.com/users/snoe/following{/other_user}","gists_url":"https://api.github.com/users/snoe/gists{/gist_id}","starred_url":"https://api.github.com/users/snoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoe/subscriptions","organizations_url":"https://api.github.com/users/snoe/orgs","repos_url":"https://api.github.com/users/snoe/repos","events_url":"https://api.github.com/users/snoe/events{/privacy}","received_events_url":"https://api.github.com/users/snoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-04T06:14:35Z","updated_at":"2015-10-26T19:21:48Z","closed_at":null,"body":"Hi, great plugin! \r\n\r\nThere are two features of slurping in emacs paredit mode that I really miss in vim-sexp. The cheat sheet here shows how it behaves and below is why it feels more natural for me to use than the vim equivalents.\r\nhttp://emacswiki.org/emacs/PareditCheatsheet (See `Barfage & Slurpage`)\r\n\r\nTake the example of introducing a `let` for the `map` result, after typing `(something xs)`\r\n\r\n```clj\r\n(let [xs])\r\n(map to-x ys)\r\n(something xs)\r\n```\r\n\r\nThe first thing I miss, is that slurping an element does not move the cursor (or if at the end of a line it moves to the prev char). It makes it far easier to quickly drop out of insert, put forms in the right place and then back to insert without losing focus of where you were working. In the example, I can finish the vector and easily slurp in the `map` I was working on with `...[xs])<ESC><slurp><slurp>`. With vim-sexp captures, it's painful to do this as I need to navigate to the previous form after each slurp.\r\n\r\nThe second thing is that slurping will recursively slurp up the tree if there's nothing to slurp in the current form. In the example, my cursor can be on the `s` (the last non-closing char I need to type) and I can just slurp three times to get the map into the binding and the final form into the body. \r\n\r\nWould it be possible to change capture to behave in this way or introduce slurp and barf calls with this behavior?\r\n\r\nI would have loved to do a PR but I've never written a vim plugin and I felt like I was way over my head when I dove into this. \r\n"},"comment":{"url":"https://api.github.com/repos/guns/vim-sexp/issues/comments/151255698","html_url":"https://github.com/guns/vim-sexp/issues/10#issuecomment-151255698","issue_url":"https://api.github.com/repos/guns/vim-sexp/issues/10","id":151255698,"user":{"login":"snoe","id":105012,"avatar_url":"https://avatars.githubusercontent.com/u/105012?v=3","gravatar_id":"","url":"https://api.github.com/users/snoe","html_url":"https://github.com/snoe","followers_url":"https://api.github.com/users/snoe/followers","following_url":"https://api.github.com/users/snoe/following{/other_user}","gists_url":"https://api.github.com/users/snoe/gists{/gist_id}","starred_url":"https://api.github.com/users/snoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoe/subscriptions","organizations_url":"https://api.github.com/users/snoe/orgs","repos_url":"https://api.github.com/users/snoe/repos","events_url":"https://api.github.com/users/snoe/events{/privacy}","received_events_url":"https://api.github.com/users/snoe/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T19:21:48Z","updated_at":"2015-10-26T19:21:48Z","body":"@guns if you want to take a different path forward on this, please feel free to reject my PRs."}}