{"action":"closed","issue":{"url":"https://api.github.com/repos/hanslub42/rlwrap/issues/50","repository_url":"https://api.github.com/repos/hanslub42/rlwrap","labels_url":"https://api.github.com/repos/hanslub42/rlwrap/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/hanslub42/rlwrap/issues/50/comments","events_url":"https://api.github.com/repos/hanslub42/rlwrap/issues/50/events","html_url":"https://github.com/hanslub42/rlwrap/issues/50","id":167401474,"number":50,"title":"Binding a key sequence to a macro","user":{"login":"hokuda","id":3060308,"avatar_url":"https://avatars.githubusercontent.com/u/3060308?v=3","gravatar_id":"","url":"https://api.github.com/users/hokuda","html_url":"https://github.com/hokuda","followers_url":"https://api.github.com/users/hokuda/followers","following_url":"https://api.github.com/users/hokuda/following{/other_user}","gists_url":"https://api.github.com/users/hokuda/gists{/gist_id}","starred_url":"https://api.github.com/users/hokuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokuda/subscriptions","organizations_url":"https://api.github.com/users/hokuda/orgs","repos_url":"https://api.github.com/users/hokuda/repos","events_url":"https://api.github.com/users/hokuda/events{/privacy}","received_events_url":"https://api.github.com/users/hokuda/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-25T15:55:53Z","updated_at":"2016-08-15T08:25:40Z","closed_at":"2016-08-15T08:25:39Z","body":"This is relevant with the issue #47.\r\nI have used [peco](https://github.com/peco/peco) for history expansion on bash for the last years. Adding the following code in my `.bashrc`, my `ctrl-r` invokes [peco](https://github.com/peco/peco):\r\n~~~\r\n_complete_history() {\r\n    local l=$(HISTTIMEFORMAT= history | tac | sed -e 's/^\\s*[0-9]*  //' | peco --query \"$READLINE_LINE\")\r\n    if [ \"${l}x\" != \"x\" ]; then\r\n        READLINE_LINE=\"$l\"\r\n        READLINE_POINT=${#l}\r\n    fi\r\n}\r\nbind -x '\"\\C-r\": _complete_history'\r\n~~~\r\nIf the `rlwrap` has the feature like the `bind` command of `bash` to bind a key sequence to a macro, it augments the `rlwrap`'s history expansion feature and gives the `rlwrap` more flexibility."}}
{"actor":{"display_login":"hanslub42"}}