Last active
May 26, 2024 19:27
Revisions
-
rupeshtr78 revised this gist
Mar 29, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ -- fzf clink history search -- update cmder\vendor\clink >= clink -- version = 1.1.44 -- install fzf choco install fzf -- add the fzf_history.lua to cmder\config folder -- add below key binding to _inputrc use "clink info" to find inputrc path -- M-x: "luafunc:fzf_history" #Alt x -- Might have to adjust your regex in line 38 39 based on your settings -
rupeshtr78 revised this gist
Mar 26, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ -- update cmder\vendor\clink >= clink -- version = 1.1.44 -- install fzf choco install fzf -- add below key binding to _inputrc use "clink info" to find inputrc path -- M-x: "luafunc:fzf_history" #Alt x -- Might have to adjust your regex in line 38 39 based on your settings -- reference https://chrisant996.github.io/clink/clink.html -
rupeshtr78 revised this gist
Mar 25, 2021 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ settings.add("fzf.height", "40%", "Height to use for the --height flag") local function get_fzf() local height = settings.get("fzf.height") local c = "C:\\cmder\\vendor\\clink\\clink_x64.exe" local session_history = c.." --session".." clink.getsession()".. " history".." --bare" local fzf_command= session_history.." | ".."fzf" if height and height ~= "" then @@ -36,13 +36,12 @@ function fzf_history(rl_buffer) handle:close() if fzf_complete_intercept then for hist in string.gmatch(result, "(.+)$") do rl_buffer:insert(hist) end end fzf_complete_intercept = false rl_buffer:refreshline() end -
rupeshtr78 revised this gist
Mar 25, 2021 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ -- install fzf choco install fzf -- add below key binding to _inputrc use "clink info" to find inputrc path -- M-x: "luafunc:fzf_history" -- Might have to adjust your regex in line 38 39 based on your settings -- reference https://chrisant996.github.io/clink/clink.html settings.add("fzf.height", "40%", "Height to use for the --height flag") -
rupeshtr78 revised this gist
Mar 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ -- fzf clink history search -- update cmder\vendor\clink >= clink -- version = 1.1.44 -- install fzf choco install fzf -- add below key binding to _inputrc use "clink info" to find inputrc path -- M-x: "luafunc:fzf_history" -
rupeshtr78 created this gist
Mar 25, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ -- fzf clink history search -- update cmder\vendor\clink to clink -- version = 1.1.44 -- install fzf choco install fzf -- add below key binding to _inputrc use "clink info" to find inputrc path -- M-x: "luafunc:fzf_history" -- reference https://chrisant996.github.io/clink/clink.html settings.add("fzf.height", "40%", "Height to use for the --height flag") -- settings.add("fzf.exe_location", "", "Location of fzf.exe if not on the PATH") -- Build a command line to pipe history and launch fzf local function get_fzf() local height = settings.get("fzf.height") local c = "C:\\cmder\\vendor\\clink\\clink_x64.exe" local session_history = c.." --session".." clink.getsession()".. " history" local fzf_command= session_history.." | ".."fzf" if height and height ~= "" then fzf_command = fzf_command..' --height '..height..' --layout=reverse' end return fzf_command end local fzf_complete_intercept = false function fzf_history(rl_buffer) print("Searching History") fzf_complete_intercept = true if not fzf_complete_intercept then return end local handle = io.popen(get_fzf()) local result = handle:read("*a") handle:close() if fzf_complete_intercept then for hist in string.gmatch(result, "(.+)$") do local finalhist = string.match(hist,"[^|%s+%d+].+") rl_buffer:insert(finalhist) end end fzf_complete_intercept = false rl_buffer:refreshline() end