LoginSignup
4
4

More than 5 years have passed since last update.

nyagos で peco を使ったヒストリのインクリメンタルサーチ

Last updated at Posted at 2016-03-13

一応、ネイティブで C-r のインクリメンタルサーチが実装されているけれども、peco を使った分かりやすいインクリメンタルサーチの手法を hisomura さんが提示されていたので、紹介せずにはいられなかった。

https://github.com/zetamatta/nyagos/issues/117 より:

nyagos.bindkey("C_R",
    function(this)
        local path = nyagos.getenv("APPDATA") .. '\\NYAOS_ORG\\nyagos.history'
        local result = nyagos.eval('type ' .. path .. ' | peco')
        this:call("CLEAR_SCREEN")
        return result
    end)

これ、いろんなもんで応用できるんじゃね :smile::smile:

4
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4